diff --git a/benchmark_report.md b/benchmark_report.md new file mode 100644 index 00000000..9d6b8320 --- /dev/null +++ b/benchmark_report.md @@ -0,0 +1,75 @@ +# Cohort Generation Execution Benchmark + +*Date generated:* 2026-03-18 14:24:28.792419 + +This report compares the execution time of cohort generation between the traditional **CirceR (Java + T-SQL)** and the new **circe_py (Python + Ibis)** implementation. + +### Aggregate Performance +- **CirceR/Java Average Median Time:** 19.30 ms +- **CircePy/Ibis Average Median Time:** 18.85 ms + +> **Conclusion:** `circe_py` (Ibis) is generally **faster** than `SqlRender` by **~2.3%** when evaluating identically generated cohorts. + +### Raw Results +| Cohort | Approach | Min | lq | Mean | Median | uq | Max | Neval | +|---|---|---|---|---|---|---|---|---| +| 10.json | CirceR_Java_DBI | 13.90 | 14.10 | 15.17 | 14.40 | 15.90 | 18.44 | 10 | +| | CircePy_Ibis_DuckDB | 4.48 | 4.58 | 5.47 | 5.21 | 6.28 | 7.43 | 10 | +| 100.json | CirceR_Java_DBI | 23.87 | 24.86 | 27.73 | 27.13 | 29.68 | 33.68 | 10 | +| | CircePy_Ibis_DuckDB | 10.41 | 11.21 | 12.46 | 12.40 | 13.83 | 14.40 | 10 | +| 1000.json | CirceR_Java_DBI | 12.55 | 12.67 | 13.46 | 13.01 | 13.90 | 15.70 | 10 | +| | CircePy_Ibis_DuckDB | 2.96 | 3.25 | 3.51 | 3.52 | 3.60 | 4.18 | 10 | +| 1001.json | CirceR_Java_DBI | 13.38 | 13.56 | 14.38 | 14.24 | 14.47 | 17.32 | 10 | +| | CircePy_Ibis_DuckDB | 3.53 | 3.82 | 4.17 | 4.04 | 4.28 | 5.66 | 10 | +| 1002.json | CirceR_Java_DBI | 13.08 | 13.56 | 14.08 | 14.09 | 14.54 | 15.20 | 10 | +| | CircePy_Ibis_DuckDB | 2.93 | 3.01 | 3.35 | 3.39 | 3.65 | 3.78 | 10 | +| 1003.json | CirceR_Java_DBI | 10.94 | 11.31 | 12.26 | 11.55 | 12.06 | 15.87 | 10 | +| | CircePy_Ibis_DuckDB | 4.93 | 5.53 | 6.57 | 5.68 | 6.88 | 12.75 | 10 | +| 1004.json | CirceR_Java_DBI | 11.22 | 11.73 | 13.00 | 12.40 | 13.43 | 16.80 | 10 | +| | CircePy_Ibis_DuckDB | 4.64 | 5.08 | 5.50 | 5.44 | 5.65 | 7.15 | 10 | +| 1005.json | CirceR_Java_DBI | 14.40 | 14.71 | 16.63 | 16.11 | 18.71 | 19.41 | 10 | +| | CircePy_Ibis_DuckDB | 3.87 | 4.15 | 4.65 | 4.29 | 4.45 | 8.27 | 10 | +| 1006.json | CirceR_Java_DBI | 17.88 | 19.09 | 23.73 | 22.73 | 27.82 | 36.86 | 10 | +| | CircePy_Ibis_DuckDB | 4.05 | 4.36 | 5.27 | 5.19 | 5.70 | 7.24 | 10 | +| 1007.json | CirceR_Java_DBI | 27.90 | 29.12 | 31.12 | 29.98 | 31.89 | 37.63 | 10 | +| | CircePy_Ibis_DuckDB | 19.45 | 19.87 | 24.08 | 23.85 | 25.21 | 34.15 | 10 | +| 1009.json | CirceR_Java_DBI | 51.96 | 52.18 | 54.75 | 53.13 | 57.70 | 60.11 | 10 | +| | CircePy_Ibis_DuckDB | 109.65 | 118.49 | 126.79 | 123.25 | 135.94 | 146.27 | 10 | +| 1010.json | CirceR_Java_DBI | 15.56 | 15.90 | 16.91 | 16.52 | 17.45 | 20.41 | 10 | +| | CircePy_Ibis_DuckDB | 32.26 | 34.48 | 36.62 | 35.08 | 37.44 | 47.88 | 10 | +| 1011.json | CirceR_Java_DBI | 11.31 | 11.76 | 12.08 | 12.06 | 12.42 | 13.06 | 10 | +| | CircePy_Ibis_DuckDB | 4.98 | 5.18 | 5.56 | 5.59 | 6.04 | 6.15 | 10 | +| 1012.json | CirceR_Java_DBI | 11.65 | 11.82 | 12.64 | 12.12 | 12.89 | 16.19 | 10 | +| | CircePy_Ibis_DuckDB | 5.59 | 5.81 | 6.13 | 6.11 | 6.27 | 6.86 | 10 | +| 1013.json | CirceR_Java_DBI | 11.42 | 11.77 | 12.29 | 12.32 | 12.92 | 13.18 | 10 | +| | CircePy_Ibis_DuckDB | 4.86 | 5.37 | 5.48 | 5.41 | 5.74 | 6.14 | 10 | +| 1016.json | CirceR_Java_DBI | 14.41 | 14.75 | 18.62 | 16.87 | 20.66 | 30.34 | 10 | +| | CircePy_Ibis_DuckDB | 7.85 | 9.19 | 10.87 | 9.60 | 13.18 | 18.71 | 10 | +| 1017.json | CirceR_Java_DBI | 11.96 | 12.23 | 12.91 | 12.67 | 13.50 | 15.13 | 10 | +| | CircePy_Ibis_DuckDB | 6.49 | 6.75 | 7.40 | 7.11 | 7.35 | 10.22 | 10 | +| 1018.json | CirceR_Java_DBI | 11.65 | 12.45 | 14.46 | 13.53 | 15.68 | 21.79 | 10 | +| | CircePy_Ibis_DuckDB | 4.56 | 5.07 | 7.10 | 5.34 | 8.30 | 12.47 | 10 | +| 1019.json | CirceR_Java_DBI | 16.19 | 17.09 | 18.92 | 17.54 | 19.98 | 25.55 | 10 | +| | CircePy_Ibis_DuckDB | 16.94 | 17.45 | 19.03 | 18.22 | 21.05 | 22.03 | 10 | +| 1020.json | CirceR_Java_DBI | 26.52 | 28.96 | 37.04 | 34.96 | 44.87 | 51.18 | 10 | +| | CircePy_Ibis_DuckDB | 18.99 | 19.20 | 22.83 | 19.41 | 24.89 | 35.34 | 10 | +| 1021.json | CirceR_Java_DBI | 21.82 | 24.82 | 33.44 | 29.32 | 42.61 | 51.70 | 10 | +| | CircePy_Ibis_DuckDB | 40.08 | 46.80 | 55.84 | 53.25 | 69.19 | 72.25 | 10 | +| 1022.json | CirceR_Java_DBI | 19.17 | 21.31 | 27.71 | 22.62 | 35.44 | 49.43 | 10 | +| | CircePy_Ibis_DuckDB | 24.18 | 24.78 | 27.38 | 26.16 | 28.88 | 36.16 | 10 | +| 1023.json | CirceR_Java_DBI | 25.40 | 27.33 | 28.62 | 28.36 | 29.49 | 32.65 | 10 | +| | CircePy_Ibis_DuckDB | 38.29 | 38.63 | 40.16 | 39.66 | 40.84 | 45.80 | 10 | +| 1024.json | CirceR_Java_DBI | 17.94 | 19.07 | 22.18 | 20.38 | 24.48 | 32.79 | 10 | +| | CircePy_Ibis_DuckDB | 21.80 | 22.29 | 24.13 | 22.64 | 23.39 | 36.53 | 10 | +| 1025.json | CirceR_Java_DBI | 29.39 | 30.29 | 31.92 | 30.97 | 32.82 | 37.89 | 10 | +| | CircePy_Ibis_DuckDB | 34.85 | 36.47 | 39.93 | 38.42 | 43.38 | 52.41 | 10 | +| 1026.json | CirceR_Java_DBI | 13.14 | 14.88 | 20.48 | 16.16 | 25.98 | 43.50 | 10 | +| | CircePy_Ibis_DuckDB | 5.78 | 6.12 | 6.71 | 6.39 | 7.23 | 8.68 | 10 | +| 1027.json | CirceR_Java_DBI | 11.86 | 12.30 | 12.68 | 12.70 | 13.13 | 13.49 | 10 | +| | CircePy_Ibis_DuckDB | 5.24 | 5.54 | 5.69 | 5.68 | 5.88 | 6.15 | 10 | +| 1028.json | CirceR_Java_DBI | 12.69 | 13.13 | 13.69 | 13.37 | 13.62 | 16.58 | 10 | +| | CircePy_Ibis_DuckDB | 4.22 | 4.68 | 4.99 | 4.95 | 5.48 | 5.89 | 10 | +| 1029.json | CirceR_Java_DBI | 13.26 | 13.40 | 15.09 | 14.42 | 14.89 | 22.23 | 10 | +| | CircePy_Ibis_DuckDB | 51.15 | 51.99 | 56.75 | 53.93 | 55.72 | 78.29 | 10 | +| 1030.json | CirceR_Java_DBI | 12.27 | 12.96 | 13.62 | 13.43 | 14.31 | 15.24 | 10 | +| | CircePy_Ibis_DuckDB | 5.82 | 6.05 | 6.33 | 6.38 | 6.54 | 6.76 | 10 | diff --git a/benchmark_report_databricks.md b/benchmark_report_databricks.md new file mode 100644 index 00000000..391eaf67 --- /dev/null +++ b/benchmark_report_databricks.md @@ -0,0 +1,42 @@ +# Cohort Generation Execution Benchmark (Databricks) + +*Date generated:* 2026-03-18 19:13:18.096735 + +This report compares the execution time of cohort generation on **Databricks** between the traditional **CirceR (Java + SqlRender)** and the new **circe_py (Python + Ibis)** implementation. + +## Benchmark Configuration + +- **Pre-compilation**: Both approaches pre-compile SQL/relations before execution +- **Validation**: Python uses `skip_validation=TRUE` to bypass table/row checks (matches Java behavior) +- **Spark Optimizations**: Adaptive query execution, partition coalescing, and broadcast joins enabled +- **Iterations**: Each cohort benchmarked with identical parameters + +### Aggregate Performance +- **CirceR/Java Average Median Time:** 48.78 ms +- **CircePy/Ibis Average Median Time:** 21.62 ms + +> **Conclusion:** `circe_py` (Ibis) is generally **faster** than Circe-be/`SqlRender` by **~55.7%** when evaluating identically generated cohorts. + +### Raw Results +| Cohort | Approach | Min | lq | Mean | Median | uq | Max | Neval | +|---|---|---|---|---|---|---|---|---| +| 10.json | CirceR_Java_Databricks | 53.26 | 53.26 | 53.26 | 53.26 | 53.26 | 53.26 | 1 | +| | CircePy_Ibis_Databricks | 41.86 | 41.86 | 41.86 | 41.86 | 41.86 | 41.86 | 1 | +| 100.json | CirceR_Java_Databricks | 50.24 | 50.24 | 50.24 | 50.24 | 50.24 | 50.24 | 1 | +| | CircePy_Ibis_Databricks | 26.66 | 26.66 | 26.66 | 26.66 | 26.66 | 26.66 | 1 | +| 1000.json | CirceR_Java_Databricks | 50.52 | 50.52 | 50.52 | 50.52 | 50.52 | 50.52 | 1 | +| | CircePy_Ibis_Databricks | 15.47 | 15.47 | 15.47 | 15.47 | 15.47 | 15.47 | 1 | +| 1001.json | CirceR_Java_Databricks | 59.03 | 59.03 | 59.03 | 59.03 | 59.03 | 59.03 | 1 | +| | CircePy_Ibis_Databricks | 37.61 | 37.61 | 37.61 | 37.61 | 37.61 | 37.61 | 1 | +| 1002.json | CirceR_Java_Databricks | 33.83 | 33.83 | 33.83 | 33.83 | 33.83 | 33.83 | 1 | +| | CircePy_Ibis_Databricks | 9.94 | 9.94 | 9.94 | 9.94 | 9.94 | 9.94 | 1 | +| 1003.json | CirceR_Java_Databricks | 33.42 | 33.42 | 33.42 | 33.42 | 33.42 | 33.42 | 1 | +| | CircePy_Ibis_Databricks | 11.35 | 11.35 | 11.35 | 11.35 | 11.35 | 11.35 | 1 | +| 1004.json | CirceR_Java_Databricks | 38.99 | 38.99 | 38.99 | 38.99 | 38.99 | 38.99 | 1 | +| | CircePy_Ibis_Databricks | 11.68 | 11.68 | 11.68 | 11.68 | 11.68 | 11.68 | 1 | +| 1005.json | CirceR_Java_Databricks | 55.79 | 55.79 | 55.79 | 55.79 | 55.79 | 55.79 | 1 | +| | CircePy_Ibis_Databricks | 20.65 | 20.65 | 20.65 | 20.65 | 20.65 | 20.65 | 1 | +| 1006.json | CirceR_Java_Databricks | 69.09 | 69.09 | 69.09 | 69.09 | 69.09 | 69.09 | 1 | +| | CircePy_Ibis_Databricks | 19.52 | 19.52 | 19.52 | 19.52 | 19.52 | 19.52 | 1 | +| 1007.json | CirceR_Java_Databricks | 43.67 | 43.67 | 43.67 | 43.67 | 43.67 | 43.67 | 1 | +| | CircePy_Ibis_Databricks | 21.49 | 21.49 | 21.49 | 21.49 | 21.49 | 21.49 | 1 | diff --git a/circe/execution/api.py b/circe/execution/api.py index c49911a1..c83480e9 100644 --- a/circe/execution/api.py +++ b/circe/execution/api.py @@ -84,6 +84,30 @@ def write_relation( ) from exc +def build_cohort_relation( + expression: CohortExpression, + *, + backend: IbisBackendLike, + cdm_schema: str, + cohort_id: int, + results_schema: str | None = None, + vocabulary_schema: str | None = None, +) -> Table: + """Build cohort relation and project to OHDSI format without materializing. + + This returns a lazy Ibis expression ready to be written to a table. + Useful for benchmarking or when you want to separate compilation from execution. + """ + cohort_expr = build_cohort( + expression, + backend=backend, + cdm_schema=cdm_schema, + results_schema=results_schema, + vocabulary_schema=vocabulary_schema, + ) + return project_to_ohdsi_cohort_table(cohort_expr, cohort_id=cohort_id) + + def write_cohort( expression: CohortExpression, *, @@ -99,14 +123,14 @@ def write_cohort( if if_exists not in {"fail", "replace"}: raise ValueError("if_exists must be one of {'fail', 'replace'} for write_cohort.") - new_rows = build_cohort( + new_rows = build_cohort_relation( expression, backend=backend, cdm_schema=cdm_schema, + cohort_id=cohort_id, results_schema=results_schema, vocabulary_schema=vocabulary_schema, ) - new_rows = project_to_ohdsi_cohort_table(new_rows, cohort_id=cohort_id) if not table_exists(backend, table_name=cohort_table, schema=results_schema): write_relation( @@ -161,3 +185,107 @@ def write_cohort( target_schema=results_schema, if_exists="replace", ) + + +def write_cohort_relation( + cohort_relation: Table, + *, + backend: IbisBackendLike, + cohort_table: str, + cohort_id: int, + results_schema: str | None = None, + if_exists: Literal["fail", "replace", "append"] = "fail", + skip_validation: bool = False, +) -> None: + """Write a pre-built cohort relation to a table. + + This function takes a cohort relation (from build_cohort_relation) and writes it + to the target table. Useful for benchmarking when you want to separate compilation + from execution. + + Args: + cohort_relation: Pre-built cohort relation (from build_cohort_relation) + backend: Ibis backend connection + cohort_table: Name of the target cohort table + cohort_id: Cohort definition ID (for checking conflicts) + results_schema: Schema containing the cohort table + if_exists: What to do if cohort rows exist: "fail", "replace", or "append" + skip_validation: Skip table existence and cohort row checks (faster, use for benchmarking) + """ + if if_exists not in {"fail", "replace", "append"}: + raise ValueError("if_exists must be one of {'fail', 'replace', 'append'} for write_cohort_relation.") + + # Fast path for benchmarking: skip all validation checks + if skip_validation: + insert_relation( + cohort_relation, + backend=backend, + target_table=cohort_table, + target_schema=results_schema, + ) + return + + if not table_exists(backend, table_name=cohort_table, schema=results_schema): + write_relation( + cohort_relation, + backend=backend, + target_table=cohort_table, + target_schema=results_schema, + if_exists="fail", + ) + return + + if if_exists == "append": + # Just append without checking for existing rows + insert_relation( + cohort_relation, + backend=backend, + target_table=cohort_table, + target_schema=results_schema, + ) + return + + if if_exists == "fail": + if cohort_rows_exist( + backend, + cohort_table=cohort_table, + results_schema=results_schema, + cohort_id=cohort_id, + ): + raise ExecutionError( + "Ibis executor write error: cohort table " + f"'{cohort_table}' already contains rows for cohort_id={cohort_id}." + ) + insert_relation( + cohort_relation, + backend=backend, + target_table=cohort_table, + target_schema=results_schema, + ) + return + + # if_exists == "replace" + if supports_transactional_replace(backend): + replace_cohort_rows_transactionally( + cohort_relation, + backend=backend, + cohort_table=cohort_table, + results_schema=results_schema, + cohort_id=cohort_id, + ) + return + + existing = read_table( + backend, + table_name=cohort_table, + schema=results_schema, + ) + filtered = exclude_cohort_rows(existing, cohort_id=cohort_id) + relation = filtered.union(cohort_relation, distinct=False) + write_relation( + relation, + backend=backend, + target_table=cohort_table, + target_schema=results_schema, + if_exists="replace", + ) diff --git a/scripts/benchmark_cohort_generation.R b/scripts/benchmark_cohort_generation.R new file mode 100644 index 00000000..0fd9007d --- /dev/null +++ b/scripts/benchmark_cohort_generation.R @@ -0,0 +1,201 @@ +#!/usr/bin/env Rscript +# scripts/benchmark_cohort_generation.R +# Benchmark cohort GENERATION (execution) process: CirceR + SqlRender vs Ibis (Python) + +# Ensure packages are installed +required_packages <- c("microbenchmark", "reticulate", "CirceR", "SqlRender", "DBI", "duckdb") +for (pkg in required_packages) { + if (!requireNamespace(pkg, quietly = TRUE)) { + cat(sprintf("Installing %s...\n", pkg)) + install.packages(pkg, repos = "https://cloud.r-project.org") + } +} + +library(microbenchmark) +library(reticulate) +library(CirceR) +library(SqlRender) +library(DBI) +library(duckdb) + +cat("Copying Eunomia to a temporary writable database for the benchmark...\n") +eunomia_source <- "tests/eunomia.duckdb" +if (!file.exists(eunomia_source)) { + eunomia_source <- file.path("..", "tests", "eunomia.duckdb") +} +temp_db <- tempfile(fileext = ".duckdb") +file.copy(eunomia_source, temp_db) + +cat("Setting up R DuckDB connection using temp Eunomia...\n") +r_con <- dbConnect(duckdb::duckdb(), dbdir = temp_db) +venv_path <- file.path(getwd(), ".venv") +if (dir.exists(venv_path)) { + use_python(file.path(venv_path, "bin", "python"), required = TRUE) +} else { + # Fallback to current environment +} + +cat("Importing Python libraries via reticulate...\n") +circe_api <- import("circe.api") +ibis <- import("ibis") + +cat("Preparing Ibis duckdb backend referencing temp Eunomia...\n") +py_backend <- ibis$duckdb$connect(temp_db) + +# ============================================================================== +# DEFAULT EUNOMIA BENCHMARK CONFIGURATION +# ============================================================================== +TARGET_DIALECT <- "duckdb" +CDM_SCHEMA <- "main" +TARGET_SCHEMA <- "main" +COHORT_TABLE <- "cohort" + +# ============================================================================== +# LIVE DATABASE CONFIGURATION (Uncomment and edit to benchmark real databases) +# ============================================================================== +# library(DatabaseConnector) +# connectionDetails <- createConnectionDetails(dbms = "postgresql", server = "localhost/cdm", user = "user", password = "pw") +# r_con <- connect(connectionDetails) +# py_backend <- ibis$postgres$connect(host="localhost", database="cdm", user="user", password="pw") +# TARGET_DIALECT <- "postgresql" # Or your true dialect +# CDM_SCHEMA <- "cdm" +# TARGET_SCHEMA <- "results" +# COHORT_TABLE <- "cohort" +# ============================================================================== + +cohorts_dir <- file.path("tests", "cohorts") +if (!dir.exists(cohorts_dir)) { + cohorts_dir <- file.path("..", "tests", "cohorts") +} + +json_files <- list.files(cohorts_dir, pattern = "\\.json$", full.names = TRUE) +if (length(json_files) == 0) stop("No cohort JSON files found in tests/cohorts/") +sample_files <- head(json_files, 30) + +cat("\nStarting Generation Benchmark...\n") + +all_results <- list() + +for (file in sample_files) { + cat("\n========================================\n") + cat(sprintf("Benchmarking Cohort Generation: %s\n", basename(file))) + cat("========================================\n") + + json_str <- readChar(file, file.info(file)$size) + + # PRE-COMPILE JAVA SQL + cohort_expr <- CirceR::cohortExpressionFromJson(json_str) + options <- CirceR::createGenerateOptions(generateStats = FALSE) + sql <- CirceR::buildCohortQuery(cohort_expr, options = options) + rendered_sql <- SqlRender::render(sql, + vocabulary_database_schema = CDM_SCHEMA, + cdm_database_schema = CDM_SCHEMA, + target_database_schema = TARGET_SCHEMA, + results_database_schema = TARGET_SCHEMA, + target_cohort_table = COHORT_TABLE, + target_cohort_id = 1) + translated_sql <- SqlRender::translate(rendered_sql, targetDialect = TARGET_DIALECT) + java_queries <- strsplit(translated_sql, ";\n*\\s*")[[1]] + java_queries_clean <- vector("list", length(java_queries)) + idx <- 1 + for (q in java_queries) { + qc <- trimws(q) + if (nchar(qc) > 0) { + java_queries_clean[[idx]] <- qc + idx <- idx + 1 + } + } + + # PRE-COMPILE IBIS SQL + py_expr <- circe_api$cohort_expression_from_json(json_str) + table_expr <- circe_api$build_cohort(py_expr, backend = py_backend, cdm_schema = CDM_SCHEMA) + ibis_sql_str <- ibis$to_sql(table_expr) + + run_circe_java_execution <- function() { + # Execute on connection without overhead! + for (q in java_queries_clean) { + if (!is.null(q)) { + dbExecute(r_con, q) + } + } + } + + run_circe_ibis_execution <- function() { + # Execute the pre-compiled Ibis SQL directly on duckdb + py_backend$raw_sql(ibis_sql_str) + } + + # Microbenchmark purely on execution! + cat(" Running Pure Execution Microbenchmark (10 iterations)...\n") + mb <- microbenchmark( + CirceR_Java_DBI = run_circe_java_execution(), + CircePy_Ibis_DuckDB = run_circe_ibis_execution(), + times = 10 + ) + print(mb) + all_results[[basename(file)]] <- summary(mb) +} + +# Generate Markdown Report +report_file <- "benchmark_report.md" +cat("Generating report...\n") + +java_medians <- c() +ibis_medians <- c() + +for (cohort_name in names(all_results)) { + res <- all_results[[cohort_name]] + ja <- res$median[res$expr == "CirceR_Java_DBI"] + ib <- res$median[res$expr == "CircePy_Ibis_DuckDB"] + if (length(ja) > 0) java_medians <- c(java_medians, ja) + if (length(ib) > 0) ibis_medians <- c(ibis_medians, ib) +} + +java_avg <- mean(java_medians) +ibis_avg <- mean(ibis_medians) + +diff_pct <- if (ibis_avg < java_avg) ((java_avg - ibis_avg) / java_avg) * 100 else ((ibis_avg - java_avg) / ibis_avg) * 100 +faster_stmt <- if (ibis_avg < java_avg) "faster" else "slower" + +report_summary <- sprintf("> **Conclusion:** `circe_py` (Ibis) is generally **%s** than Circe-be/`SqlRender` by **~%.1f%%** when evaluating identically generated cohorts.", faster_stmt, diff_pct) + +report_lines <- c( + "# Cohort Generation Execution Benchmark", + "", + paste("*Date generated:*", Sys.time()), + "", + "This report compares the execution time of cohort generation between the traditional **CirceR (Java + T-SQL)** and the new **circe_py (Python + Ibis)** implementation.", + "", + "### Aggregate Performance", + sprintf("- **CirceR/Java Average Median Time:** %.2f ms", java_avg), + sprintf("- **CircePy/Ibis Average Median Time:** %.2f ms", ibis_avg), + "", + report_summary, + "", + "### Raw Results", + "| Cohort | Approach | Min | lq | Mean | Median | uq | Max | Neval |", + "|---|---|---|---|---|---|---|---|---|" +) + +for (cohort_name in names(all_results)) { + res <- all_results[[cohort_name]] + for (i in seq_len(nrow(res))) { + row <- res[i, ] + expr_name <- as.character(row$expr) + + # Format times depending on unit (microbenchmark handles units automatically but we extract raw or formatted) + # The summary data frame contains time in the unit specified by attr(res, "unit") or assumes milliseconds/microseconds. + # Actually, print provides nice formatting, but summary() returns raw values depending on unit. + # Usually it's in milliseconds if we don't specify. To be safe, we round them. + format_num <- function(x) sprintf("%.2f", x) + + report_lines <- c(report_lines, sprintf("| %s | %s | %s | %s | %s | %s | %s | %s | %d |", + if(i==1) cohort_name else "", + expr_name, + format_num(row$min), format_num(row$lq), format_num(row$mean), + format_num(row$median), format_num(row$uq), format_num(row$max), row$neval)) + } +} + +writeLines(report_lines, report_file) +cat(sprintf("\nBenchmark Complete. Report saved to %s\n", report_file)) diff --git a/scripts/benchmark_cohort_generation_databricks.R b/scripts/benchmark_cohort_generation_databricks.R new file mode 100644 index 00000000..cca0eaca --- /dev/null +++ b/scripts/benchmark_cohort_generation_databricks.R @@ -0,0 +1,349 @@ +#!/usr/bin/env Rscript +# scripts/benchmark_cohort_generation_databricks.R +# Benchmark cohort GENERATION (execution) process: CirceR + SqlRender vs Ibis (Python) +# +# ============================================================================== +# REQUIRED ENVIRONMENT VARIABLES +# ============================================================================== +# Before running this script, set the following environment variables: +# +# 1. DATABRICKS_HOST +# - Your Databricks workspace hostname +# - Example: "your-workspace.cloud.databricks.com" +# - Set with: Sys.setenv(DATABRICKS_HOST = "your-workspace.cloud.databricks.com") +# +# 2. DATABRICKS_HTTP_PATH +# - The HTTP path to your Databricks SQL warehouse or cluster +# - Example: "/sql/1.0/warehouses/xxxxxxxxxxxxx" +# - Set with: Sys.setenv(DATABRICKS_HTTP_PATH = "/sql/1.0/warehouses/xxxxx") +# +# 3. DATABRICKS_TOKEN +# - Your Databricks personal access token +# - Example: "dapi1234567890abcdef..." +# - Set with: Sys.setenv(DATABRICKS_TOKEN = "dapi...") +# +# 4. DATABRICKS_SCRATCH_SCHEMA +# - Schema (or catalog.schema) for writing benchmark results +# - Example: "my_catalog.my_schema" (Unity Catalog) or "my_schema" (Hive) +# - Set with: Sys.setenv(DATABRICKS_SCRATCH_SCHEMA = "catalog.schema") +# +# 5. CDM_SCHEMA +# - Schema containing your OMOP CDM tables +# - Example: "healthverity_cc.cdm_healthverity_cc_v3470" +# - Set with: Sys.setenv(CDM_SCHEMA = "catalog.cdm_schema") +# +# Quick setup example: +# Sys.setenv( +# DATABRICKS_HOST = "your-workspace.cloud.databricks.com", +# DATABRICKS_HTTP_PATH = "/sql/1.0/warehouses/xxxxx", +# DATABRICKS_TOKEN = "dapi...", +# DATABRICKS_SCRATCH_SCHEMA = "catalog.scratch_schema", +# CDM_SCHEMA = "catalog.cdm_schema" +# ) +# ============================================================================== + +# Ensure packages are installed +required_packages <- c("microbenchmark", "reticulate", "CirceR", "SqlRender", "DatabaseConnector", "glue", "cli") +for (pkg in required_packages) { + if (!requireNamespace(pkg, quietly = TRUE)) { + cat(sprintf("Installing %s...\n", pkg)) + install.packages(pkg, repos = "https://cloud.r-project.org") + } +} + +library(microbenchmark) +library(reticulate) +library(CirceR) +library(SqlRender) +library(DatabaseConnector) +library(glue) +library(cli) + +# ============================================================================== +# DATABRICKS CONFIGURATION FROM ENVIRONMENT VARIABLES +# ============================================================================== +.getDatabricksConnectionDetails <- function(asList = FALSE) { + password <- Sys.getenv("DATABRICKS_TOKEN") + + if (is.null(password) || password == "") + cli::cli_abort("DATABRICKS_TOKEN ENVIRONMENT VARIABLE NOT SET") + + databricksConnectionString <- glue::glue("jdbc:databricks://{Sys.getenv('DATABRICKS_HOST')}/default;transportMode=http;ssl=1;AuthMech=3;httpPath={Sys.getenv('DATABRICKS_HTTP_PATH')}") + + cdList <- list( + dbms = "spark", + connectionString = databricksConnectionString, + user = "token", + password = password + ) + + if (asList) + return(cdList) + + return(do.call(DatabaseConnector::createConnectionDetails, cdList)) +} + +cat("Setting up R Databricks connection via DatabaseConnector (Spark JDBC)...\n") +DATABRICKS_SCRATCH_SCHEMA <- Sys.getenv("DATABRICKS_SCRATCH_SCHEMA") +if (is.null(DATABRICKS_SCRATCH_SCHEMA) || DATABRICKS_SCRATCH_SCHEMA == "") + cli::cli_abort("DATABRICKS_SCRATCH_SCHEMA ENVIRONMENT VARIABLE NOT SET") + +connectionDetails <- .getDatabricksConnectionDetails() +r_con <- connect(connectionDetails) + +venv_path <- file.path(getwd(), ".venv") +if (dir.exists(venv_path)) { + use_python(file.path(venv_path, "bin", "python"), required = TRUE) +} else { + # Fallback to current environment +} + +cat("Importing Python libraries via reticulate...\n") +circe_api <- import("circe.api") +circe_execution <- import("circe.execution.api") +ibis <- import("ibis") + +cat("Preparing Ibis Databricks backend...\n") +# Validate and get environment variables +databricks_host <- Sys.getenv("DATABRICKS_HOST") +if (is.null(databricks_host) || databricks_host == "") + cli::cli_abort("DATABRICKS_HOST ENVIRONMENT VARIABLE NOT SET") + +databricks_http_path <- Sys.getenv("DATABRICKS_HTTP_PATH") +if (is.null(databricks_http_path) || databricks_http_path == "") + cli::cli_abort("DATABRICKS_HTTP_PATH ENVIRONMENT VARIABLE NOT SET") + +databricks_token <- Sys.getenv("DATABRICKS_TOKEN") +if (is.null(databricks_token) || databricks_token == "") + cli::cli_abort("DATABRICKS_TOKEN ENVIRONMENT VARIABLE NOT SET") + +# Normalize host: remove https://, http://, trailing slashes, and :443 port +databricks_host <- sub("^https://", "", databricks_host) +databricks_host <- sub("^http://", "", databricks_host) +databricks_host <- sub("/$", "", databricks_host) +databricks_host <- sub(":443$", "", databricks_host) + +# Normalize http_path: ensure it starts with / +if (!grepl("^/", databricks_http_path)) { + databricks_http_path <- paste0("/", databricks_http_path) +} + +# Split catalog.schema for Unity Catalog-aware connections +scratch_catalog <- NULL +scratch_db <- DATABRICKS_SCRATCH_SCHEMA +if (grepl("\\.", DATABRICKS_SCRATCH_SCHEMA)) { + parts <- strsplit(DATABRICKS_SCRATCH_SCHEMA, "\\.", fixed = FALSE)[[1]] + scratch_catalog <- parts[1] + scratch_db <- parts[2] +} + +# Set environment variables in Python process (reticulate doesn't auto-pass them) +py_os <- import("os") +py_os$environ["DATABRICKS_HOST"] <- databricks_host +py_os$environ["DATABRICKS_HTTP_PATH"] <- databricks_http_path +py_os$environ["DATABRICKS_TOKEN"] <- databricks_token + +# Connect using correct parameter names for ibis.databricks.connect +py_backend <- ibis$databricks$connect( + server_hostname = databricks_host, + http_path = databricks_http_path, + token = databricks_token, + catalog = scratch_catalog, + schema = scratch_db +) + +# ============================================================================== +# DATABRICKS BENCHMARK CONFIGURATION +# ============================================================================== +TARGET_DIALECT <- "spark" +CDM_SCHEMA <- Sys.getenv("CDM_SCHEMA") +TARGET_SCHEMA <- DATABRICKS_SCRATCH_SCHEMA +COHORT_TABLE <- "becnhmark_cohort" +BENCHMARK_ITERATIONS <- 1 # Use 1 for Databricks, 10 for DuckDB + + +cohorts_dir <- file.path("tests", "cohorts") +if (!dir.exists(cohorts_dir)) { + cohorts_dir <- file.path("..", "tests", "cohorts") +} + +json_files <- list.files(cohorts_dir, pattern = "\\.json$", full.names = TRUE) +if (length(json_files) == 0) stop("No cohort JSON files found in tests/cohorts/") +sample_files <- head(json_files, 100) + +# ============================================================================== +# CREATE COHORT TABLE +# ============================================================================== +cat("\nCreating cohort table...\n") + +# Drop table if it exists +drop_table_sql <- sprintf("DROP TABLE IF EXISTS %s.%s", TARGET_SCHEMA, COHORT_TABLE) +tryCatch({ + executeSql(r_con, drop_table_sql) + cat(sprintf(" Dropped existing table %s.%s (if it existed)\n", TARGET_SCHEMA, COHORT_TABLE)) +}, error = function(e) { + cat(sprintf(" Note: Could not drop table (may not exist): %s\n", e$message)) +}) + +# Create cohort table with required schema +create_table_sql <- sprintf(" +CREATE TABLE %s.%s ( + cohort_definition_id BIGINT NOT NULL, + subject_id BIGINT NOT NULL, + cohort_start_date DATE NOT NULL, + cohort_end_date DATE NOT NULL +)", TARGET_SCHEMA, COHORT_TABLE) + +tryCatch({ + executeSql(r_con, create_table_sql) + cat(sprintf(" Created cohort table %s.%s\n", TARGET_SCHEMA, COHORT_TABLE)) +}, error = function(e) { + cli::cli_abort(sprintf("Failed to create cohort table: %s", e$message)) +}) + +cat("\nStarting Generation Benchmark...\n") + +all_results <- list() + +targetId <- 0 +for (file in sample_files) { + targetId <- targetId + 1 + ibis_cohort_id <- targetId + 10000 # Distinct ID for Ibis cohorts + + cat("\n========================================\n") + cat(sprintf("Benchmarking Cohort Generation: %s\n", basename(file))) + cat("========================================\n") + + json_str <- readChar(file, file.info(file)$size) + + # ============================================================================ + # PRE-COMPILATION PHASE (not benchmarked) + # ============================================================================ + cat(" Pre-compiling Java SQL...\n") + cohort_expr <- CirceR::cohortExpressionFromJson(json_str) + options <- CirceR::createGenerateOptions(generateStats = FALSE) + sql <- CirceR::buildCohortQuery(cohort_expr, options = options) + rendered_sql <- SqlRender::render(sql, + vocabulary_database_schema = CDM_SCHEMA, + cdm_database_schema = CDM_SCHEMA, + target_database_schema = TARGET_SCHEMA, + results_database_schema = TARGET_SCHEMA, + target_cohort_table = COHORT_TABLE, + target_cohort_id = targetId) + translated_sql <- SqlRender::translate(rendered_sql, targetDialect = TARGET_DIALECT, tempEmulationSchema = TARGET_SCHEMA) + + cat(" Pre-compiling Ibis cohort relation...\n") + py_expr <- circe_api$cohort_expression_from_json(json_str) + # Build the cohort relation (lazy compilation, not execution) + cohort_relation <- circe_execution$build_cohort_relation( + expression = py_expr, + backend = py_backend, + cdm_schema = CDM_SCHEMA, + cohort_id = as.integer(ibis_cohort_id), + results_schema = TARGET_SCHEMA, + vocabulary_schema = CDM_SCHEMA + ) + + # ============================================================================ + # EXECUTION PHASE (benchmarked - apples to apples) + # ============================================================================ + run_circe_java_execution <- function() { + # Execute pre-compiled SQL + executeSql(r_con, translated_sql) + } + + run_circe_ibis_execution <- function() { + # Execute pre-compiled relation with validation checks skipped + circe_execution$write_cohort_relation( + cohort_relation = cohort_relation, + backend = py_backend, + cohort_table = COHORT_TABLE, + cohort_id = as.integer(ibis_cohort_id), + results_schema = TARGET_SCHEMA, + if_exists = "append", + skip_validation = TRUE + ) + } + + # Microbenchmark purely on SQL execution! + cat(sprintf(" Running Pure SQL Execution Microbenchmark (%d iterations)...\n", BENCHMARK_ITERATIONS)) + cat(sprintf(" Java cohort_id: %d, Ibis cohort_id: %d\n", targetId, ibis_cohort_id)) + mb <- microbenchmark( + CirceR_Java_Databricks = run_circe_java_execution(), + CircePy_Ibis_Databricks = run_circe_ibis_execution(), + times = BENCHMARK_ITERATIONS + ) + print(mb) + all_results[[basename(file)]] <- summary(mb) +} + +# Generate Markdown Report +report_file <- "benchmark_report_databricks.md" +cat("Generating report...\n") + +java_medians <- c() +ibis_medians <- c() + +for (cohort_name in names(all_results)) { + res <- all_results[[cohort_name]] + ja <- res$median[res$expr == "CirceR_Java_Databricks"] + ib <- res$median[res$expr == "CircePy_Ibis_Databricks"] + if (length(ja) > 0) java_medians <- c(java_medians, ja) + if (length(ib) > 0) ibis_medians <- c(ibis_medians, ib) +} + +java_avg <- mean(java_medians) +ibis_avg <- mean(ibis_medians) + +diff_pct <- if (ibis_avg < java_avg) ((java_avg - ibis_avg) / java_avg) * 100 else ((ibis_avg - java_avg) / ibis_avg) * 100 +faster_stmt <- if (ibis_avg < java_avg) "faster" else "slower" + +report_summary <- sprintf("> **Conclusion:** `circe_py` (Ibis) is generally **%s** than Circe-be/`SqlRender` by **~%.1f%%** when evaluating identically generated cohorts.", faster_stmt, diff_pct) + +report_lines <- c( + "# Cohort Generation Execution Benchmark (Databricks)", + "", + paste("*Date generated:*", Sys.time()), + "", + "This report compares the execution time of cohort generation on **Databricks** between the traditional **CirceR (Java + SqlRender)** and the new **circe_py (Python + Ibis)** implementation.", + "", + "## Benchmark Configuration", + "", + "- **Pre-compilation**: Both approaches pre-compile SQL/relations before execution", + "- **Validation**: Python uses `skip_validation=TRUE` to bypass table/row checks (matches Java behavior)", + "- **Spark Optimizations**: Adaptive query execution, partition coalescing, and broadcast joins enabled", + "- **Iterations**: Each cohort benchmarked with identical parameters", + "", + "### Aggregate Performance", + sprintf("- **CirceR/Java Average Median Time:** %.2f ms", java_avg), + sprintf("- **CircePy/Ibis Average Median Time:** %.2f ms", ibis_avg), + "", + report_summary, + "", + "### Raw Results", + "| Cohort | Approach | Min | lq | Mean | Median | uq | Max | Neval |", + "|---|---|---|---|---|---|---|---|---|" +) + +for (cohort_name in names(all_results)) { + res <- all_results[[cohort_name]] + for (i in seq_len(nrow(res))) { + row <- res[i,] + expr_name <- as.character(row$expr) + + # Format times depending on unit (microbenchmark handles units automatically but we extract raw or formatted) + # The summary data frame contains time in the unit specified by attr(res, "unit") or assumes milliseconds/microseconds. + # Actually, print provides nice formatting, but summary() returns raw values depending on unit. + # Usually it's in milliseconds if we don't specify. To be safe, we round them. + format_num <- function(x) sprintf("%.2f", x) + + report_lines <- c(report_lines, sprintf("| %s | %s | %s | %s | %s | %s | %s | %s | %d |", + if (i == 1) cohort_name else "", + expr_name, + format_num(row$min), format_num(row$lq), format_num(row$mean), + format_num(row$median), format_num(row$uq), format_num(row$max), row$neval)) + } +} + +writeLines(report_lines, report_file) +cat(sprintf("\nBenchmark Complete. Report saved to %s\n", report_file)) diff --git a/tests/cohorts/10.json b/tests/cohorts/10.json new file mode 100644 index 00000000..a8affa72 --- /dev/null +++ b/tests/cohorts/10.json @@ -0,0 +1,140 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + }, + { + "Observation" : { + "CodesetId" : 3, + "ObservationTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 3, + "name" : "Nausea or Vomiting", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 31967, + "CONCEPT_NAME" : "Nausea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "422587007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4158495, + "CONCEPT_NAME" : "C/O - vomiting", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "272044004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4101344, + "CONCEPT_NAME" : "Finding of vomiting", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "300359004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4012500, + "CONCEPT_NAME" : "Nausea present", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "162057007", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201218, + "CONCEPT_NAME" : "Epidemic vomiting syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74621002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "EndDate", + "Offset" : 14 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/100.json b/tests/cohorts/100.json new file mode 100644 index 00000000..5597700c --- /dev/null +++ b/tests/cohorts/100.json @@ -0,0 +1,66 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Alzheimer's disease", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 378419, + "CONCEPT_NAME" : "Alzheimer's disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26929004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "EndDate", + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 1 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1000.json b/tests/cohorts/1000.json new file mode 100644 index 00000000..c280affe --- /dev/null +++ b/tests/cohorts/1000.json @@ -0,0 +1,83 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 5, + "name" : "[LEGEND HTN] Nausea", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 30284, + "CONCEPT_NAME" : "Motion sickness", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "37031009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 31967, + "CONCEPT_NAME" : "Nausea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "422587007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 30 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1001.json b/tests/cohorts/1001.json new file mode 100644 index 00000000..d94aa2a7 --- /dev/null +++ b/tests/cohorts/1001.json @@ -0,0 +1,83 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 11, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 11, + "name" : "Edema", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 433595, + "CONCEPT_NAME" : "Edema", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267038008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133299, + "CONCEPT_NAME" : "Swelling of limb", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80068009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 180 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1002.json b/tests/cohorts/1002.json new file mode 100644 index 00000000..51960ada --- /dev/null +++ b/tests/cohorts/1002.json @@ -0,0 +1,1409 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Photosensitivity", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4300445, + "CONCEPT_NAME" : "Acantholytic actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403199007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4263325, + "CONCEPT_NAME" : "Actinic cheilitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46795000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4031007, + "CONCEPT_NAME" : "Actinic folliculitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238529007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442179, + "CONCEPT_NAME" : "Actinic granuloma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79144000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37312586, + "CONCEPT_NAME" : "Actinic intraepidermal squamous cell carcinoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "789051005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 138825, + "CONCEPT_NAME" : "Actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "201101007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4304266, + "CONCEPT_NAME" : "Actinic keratosis of eyelid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "418686001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4064057, + "CONCEPT_NAME" : "Actinic lichen planus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200999007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141374, + "CONCEPT_NAME" : "Actinic prurigo", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "201015007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4031006, + "CONCEPT_NAME" : "Actinic reaction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238528004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439096, + "CONCEPT_NAME" : "Actinic reticuloid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52636001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4070156, + "CONCEPT_NAME" : "Acute actinic otitis externa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21543000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4290728, + "CONCEPT_NAME" : "Acute effect of ultraviolet radiation on normal skin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402165001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4241471, + "CONCEPT_NAME" : "Acute phytophotodermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58306008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36674412, + "CONCEPT_NAME" : "Ataxia, photosensitivity, short stature syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "773769008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4293437, + "CONCEPT_NAME" : "Atrophic actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403200005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4066470, + "CONCEPT_NAME" : "Berloque dermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200836002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4119822, + "CONCEPT_NAME" : "Bowenoid actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "304524009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4033832, + "CONCEPT_NAME" : "Brachioradial summer pruritus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "109252001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37116482, + "CONCEPT_NAME" : "Burn of skin caused by exposure to artificial source of ultraviolet radiation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "733209003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37116483, + "CONCEPT_NAME" : "Burn of skin caused by ultraviolet radiation due to ultraviolet light therapy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "733210008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4290729, + "CONCEPT_NAME" : "Chronic effect of ultraviolet radiation on normal skin (photo-aging)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402166000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239682, + "CONCEPT_NAME" : "Chronic phototoxic dermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69231004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4242265, + "CONCEPT_NAME" : "Chronic phytophotodermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58419006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36715275, + "CONCEPT_NAME" : "Cutaneous photosensitivity and lethal colitis syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "720820000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4230340, + "CONCEPT_NAME" : "Cutis rhomboidalis nuchae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89019003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4300796, + "CONCEPT_NAME" : "Diffuse actinic hyperkeratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403208003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141650, + "CONCEPT_NAME" : "Disseminated superficial actinic porokeratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41495000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4301164, + "CONCEPT_NAME" : "Drug-induced pellagra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403626007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4299673, + "CONCEPT_NAME" : "Familial actinic prurigo of lip", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403210001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4234867, + "CONCEPT_NAME" : "Food-induced photosensitivity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90386003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36715367, + "CONCEPT_NAME" : "Hair defect with photosensitivity and intellectual disability syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "721007005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4308081, + "CONCEPT_NAME" : "Hydroa vacciniforme", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200837006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42709861, + "CONCEPT_NAME" : "Hyperkeratotic actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "449733007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4112749, + "CONCEPT_NAME" : "Hypertrophic solar keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "254667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4300444, + "CONCEPT_NAME" : "Idiopathic photo-onycholysis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403196000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4031005, + "CONCEPT_NAME" : "Juvenile spring eruption", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238526000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4116197, + "CONCEPT_NAME" : "Lentigo maligna", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "302836005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4299672, + "CONCEPT_NAME" : "Lichenoid actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403198004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4080922, + "CONCEPT_NAME" : "Light - exacerbated acne", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238530002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4293560, + "CONCEPT_NAME" : "Multiple actinic keratoses", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403202002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4293562, + "CONCEPT_NAME" : "Multiple actinic keratoses involving face", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403204001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4300794, + "CONCEPT_NAME" : "Multiple actinic keratoses involving forehead and temples", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403205000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4300795, + "CONCEPT_NAME" : "Multiple actinic keratoses involving hands", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403206004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4293563, + "CONCEPT_NAME" : "Multiple actinic keratoses involving legs", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403207008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4293561, + "CONCEPT_NAME" : "Multiple actinic keratoses involving scalp", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403203007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110331, + "CONCEPT_NAME" : "Neonatal burn due to phototherapy caused by ultraviolet radiation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724551009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4006157, + "CONCEPT_NAME" : "Nodular elastosis with cysts and comedones", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111200005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110590, + "CONCEPT_NAME" : "Occupational phototoxic reaction to skin contact with exogenous photoactive agent", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724873006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4292224, + "CONCEPT_NAME" : "Photoaggravated psoriasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402318000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4293593, + "CONCEPT_NAME" : "Photoaggravated rosacea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403365004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4290732, + "CONCEPT_NAME" : "Photoaggravation of disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402179009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537710, + "CONCEPT_NAME" : "Photodermatitis co-occurrent and due to autoimmune disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "737249005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318376, + "CONCEPT_NAME" : "Photoonycholysis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95342006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4234104, + "CONCEPT_NAME" : "Photosensitivity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90128006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537712, + "CONCEPT_NAME" : "Phototoxic reaction of skin caused by cosmetic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "737251009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537711, + "CONCEPT_NAME" : "Phototoxic reaction of skin caused by fragrance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "737250005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4290730, + "CONCEPT_NAME" : "Phototoxic reaction to dye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402174004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4298594, + "CONCEPT_NAME" : "Phototoxic reaction to tar or derivative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402175003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4298593, + "CONCEPT_NAME" : "Phototoxic reaction to topical chemical", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402173005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4270722, + "CONCEPT_NAME" : "Phototoxic reaction to topically applied medicament", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402176002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42539382, + "CONCEPT_NAME" : "Pigmentation of skin caused by artificial ultraviolet light", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "762664003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42709860, + "CONCEPT_NAME" : "Pigmented actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "449732002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4080921, + "CONCEPT_NAME" : "Polymorphous light eruption", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238525001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4176424, + "CONCEPT_NAME" : "Polymorphous light eruption, diffuse erythematous type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51048002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4223992, + "CONCEPT_NAME" : "Polymorphous light eruption, eczematous type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84036008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4204365, + "CONCEPT_NAME" : "Polymorphous light eruption, papular type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "54116000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195589, + "CONCEPT_NAME" : "Polymorphous light eruption, papulovesicular type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79372000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4278846, + "CONCEPT_NAME" : "Polymorphous light eruption, plaque type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6618004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4297664, + "CONCEPT_NAME" : "Porphyria-induced phototoxic burn", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402480004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4296207, + "CONCEPT_NAME" : "Proliferative actinic keratosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403201009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4066838, + "CONCEPT_NAME" : "Pruritus estivalis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "201024003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4031625, + "CONCEPT_NAME" : "Solar comedone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238518008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4185267, + "CONCEPT_NAME" : "Solar degeneration", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43982006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4031162, + "CONCEPT_NAME" : "Solar lentiginosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238712007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4217502, + "CONCEPT_NAME" : "Solar lentigo", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "72100002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4296189, + "CONCEPT_NAME" : "Solar pruritus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402177006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4033831, + "CONCEPT_NAME" : "Solar pruritus of elbows", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "109251008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4031004, + "CONCEPT_NAME" : "Strimmer dermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238522003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4296206, + "CONCEPT_NAME" : "Sun-induced wrinkles", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "403197009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 90 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1003.json b/tests/cohorts/1003.json new file mode 100644 index 00000000..d5a829a7 --- /dev/null +++ b/tests/cohorts/1003.json @@ -0,0 +1,78 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Primary malignant neoplasm of kidney", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 198985, + "CONCEPT_NAME" : "Primary malignant neoplasm of kidney", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "93849006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4215373, + "CONCEPT_NAME" : "Renal cell carcinoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41607009", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Morph Abnormality" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1004.json b/tests/cohorts/1004.json new file mode 100644 index 00000000..36d9003a --- /dev/null +++ b/tests/cohorts/1004.json @@ -0,0 +1,61 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Neoplasm of thyroid gland", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4131909, + "CONCEPT_NAME" : "Neoplasm of thyroid gland", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "127018007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1005.json b/tests/cohorts/1005.json new file mode 100644 index 00000000..5aca7a2e --- /dev/null +++ b/tests/cohorts/1005.json @@ -0,0 +1,355 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 10, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 10, + "name" : "[LEGEND HTN] Venous thromboembolism (pulmonary embolism and deep vein thrombosis)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 435616, + "CONCEPT_NAME" : "Amniotic fluid embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17263003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435887, + "CONCEPT_NAME" : "Antepartum deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49956009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196715, + "CONCEPT_NAME" : "Budd-Chiari syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062269, + "CONCEPT_NAME" : "Cerebral venous thrombosis in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200259003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442055, + "CONCEPT_NAME" : "Obstetric air pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200286003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433832, + "CONCEPT_NAME" : "Obstetric blood-clot pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200299000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435026, + "CONCEPT_NAME" : "Obstetric pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200284000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440477, + "CONCEPT_NAME" : "Obstetric pyemic and septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267284008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 318137, + "CONCEPT_NAME" : "Phlebitis and thrombophlebitis of intracranial sinuses", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192753009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199837, + "CONCEPT_NAME" : "Portal vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17920008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438820, + "CONCEPT_NAME" : "Postpartum deep phlebothrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56272000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440417, + "CONCEPT_NAME" : "Pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59282003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 254662, + "CONCEPT_NAME" : "Pulmonary infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64662007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4235812, + "CONCEPT_NAME" : "Septic thrombophlebitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "439731006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195294, + "CONCEPT_NAME" : "Thrombosed hemorrhoids", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75955007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4187790, + "CONCEPT_NAME" : "Thrombosis of retinal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46085004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444247, + "CONCEPT_NAME" : "Venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111293003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44834756, + "CONCEPT_NAME" : "Acute venous embolism and thrombosis of other specified veins", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "453.8", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD9CM", + "CONCEPT_CLASS_ID" : "4-dig nonbill code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 180 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1006.json b/tests/cohorts/1006.json new file mode 100644 index 00000000..99c7f28b --- /dev/null +++ b/tests/cohorts/1006.json @@ -0,0 +1,117 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 6, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[LEGEND HTN] Vomiting", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40480290, + "CONCEPT_NAME" : "Hyperemesis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444673007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4216862, + "CONCEPT_NAME" : "Postoperative vomiting", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "72245005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441408, + "CONCEPT_NAME" : "Vomiting", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "422400008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440785, + "CONCEPT_NAME" : "Vomiting of pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90325002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 30 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1007.json b/tests/cohorts/1007.json new file mode 100644 index 00000000..2c3a0a3f --- /dev/null +++ b/tests/cohorts/1007.json @@ -0,0 +1,196 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Epilepsy Seizures excl Alcohol withdrawal-induced convulsion", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 435875, + "CONCEPT_NAME" : "Complication of pregnancy, childbirth and/or the puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198609003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 380533, + "CONCEPT_NAME" : "Convulsions in the newborn", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87476004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443700, + "CONCEPT_NAME" : "Eclampsia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15938005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4197485, + "CONCEPT_NAME" : "Epileptic seizure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "313307000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4029498, + "CONCEPT_NAME" : "Seizure disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128613002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4202330, + "CONCEPT_NAME" : "Alcohol withdrawal-induced convulsion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "308742005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109948, + "CONCEPT_NAME" : "Perceptual disturbances and seizures co-occurrent and due to alcohol withdrawal", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723926008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4176652, + "CONCEPT_NAME" : "Alcohol-induced epilepsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "361268000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4044227, + "CONCEPT_NAME" : "Myoclonic epilepsy with ragged red fibers", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230426003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1009.json b/tests/cohorts/1009.json new file mode 100644 index 00000000..2b5f112c --- /dev/null +++ b/tests/cohorts/1009.json @@ -0,0 +1,1856 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugEra" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "DrugEra" : { + "CodesetId" : 16 + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 11 + } + }, + { + "DrugEra" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "DrugEra" : { + "CodesetId" : 16 + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 3, + "IsDistinct" : true, + "CountColumn" : "DOMAIN_CONCEPT" + } + }, + { + "Criteria" : { + "DrugEra" : { + "CodesetId" : 16 + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 2, + "IsDistinct" : true, + "CountColumn" : "DOMAIN_CONCEPT" + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 16 + } + }, + { + "DrugEra" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "DoseEra" : { + "CodesetId" : 16 + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 2, + "IsDistinct" : true, + "CountColumn" : "DOMAIN_CONCEPT" + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 19 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 18, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 8, + "name" : "CB_376 Mania", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4333677, + "CONCEPT_NAME" : "Mania", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231494001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437249, + "CONCEPT_NAME" : "Recurrent manic episodes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191590005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 10, + "name" : "CB_376 Psychosis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 432590, + "CONCEPT_NAME" : "Delusional disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48500005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434900, + "CONCEPT_NAME" : "Drug-induced psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191483003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 375229, + "CONCEPT_NAME" : "Organic delusional disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5510009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4333667, + "CONCEPT_NAME" : "Presbyophrenic psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231438001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436073, + "CONCEPT_NAME" : "Psychotic disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69322001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441540, + "CONCEPT_NAME" : "Reactive confusion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191678001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435783, + "CONCEPT_NAME" : "Schizophrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58214004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 380986, + "CONCEPT_NAME" : "Senile dementia with delusion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371024007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 11, + "name" : "Atypical Antipsychotics", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 757688, + "CONCEPT_NAME" : "aripiprazole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89013", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 800878, + "CONCEPT_NAME" : "Clozapine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2626", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 755695, + "CONCEPT_NAME" : "Fluoxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4493", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 785788, + "CONCEPT_NAME" : "olanzapine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61381", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 703244, + "CONCEPT_NAME" : "paliperidone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "679314", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 766814, + "CONCEPT_NAME" : "quetiapine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51272", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 735979, + "CONCEPT_NAME" : "Risperidone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35636", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 712615, + "CONCEPT_NAME" : "ziprasidone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "115698", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 15, + "name" : "Dementia (validated: Taylor, 2009)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 372608, + "CONCEPT_NAME" : "Amnestic disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3298001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 375239, + "CONCEPT_NAME" : "Degenerative brain disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52522001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4182210, + "CONCEPT_NAME" : "Dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52448006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378726, + "CONCEPT_NAME" : "Dementia associated with alcoholism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "281004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 376095, + "CONCEPT_NAME" : "Drug-induced dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191493005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4043378, + "CONCEPT_NAME" : "Frontotemporal dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230270009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377788, + "CONCEPT_NAME" : "General paresis - neurosyphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51928006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436092, + "CONCEPT_NAME" : "Pick's disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13092008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 372610, + "CONCEPT_NAME" : "Postconcussion syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40425004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373179, + "CONCEPT_NAME" : "Senile degeneration of brain", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45864009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435088, + "CONCEPT_NAME" : "Senility", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "271873000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 16, + "name" : "First-line anti-Depressants therapy", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 36878783, + "CONCEPT_NAME" : "Agomelatine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP997499", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19032424, + "CONCEPT_NAME" : "amineptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17698", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 710062, + "CONCEPT_NAME" : "Amitriptyline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "704", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 713109, + "CONCEPT_NAME" : "Amoxapine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 750982, + "CONCEPT_NAME" : "Bupropion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42347", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19039883, + "CONCEPT_NAME" : "butriptyline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19895", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 797617, + "CONCEPT_NAME" : "Citalopram", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2556", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 798834, + "CONCEPT_NAME" : "Clomipramine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2597", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 716968, + "CONCEPT_NAME" : "Desipramine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3247", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 717607, + "CONCEPT_NAME" : "Desvenlafaxine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "734064", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19023846, + "CONCEPT_NAME" : "dibenzepin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3332", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19037989, + "CONCEPT_NAME" : "Dothiepin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3634", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 738156, + "CONCEPT_NAME" : "Doxepin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3638", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 715259, + "CONCEPT_NAME" : "duloxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "72625", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 715939, + "CONCEPT_NAME" : "Escitalopram", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "321988", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 755695, + "CONCEPT_NAME" : "Fluoxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4493", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 751412, + "CONCEPT_NAME" : "Fluvoxamine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42355", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 778268, + "CONCEPT_NAME" : "Imipramine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5691", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19122204, + "CONCEPT_NAME" : "Iprindole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5979", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 781705, + "CONCEPT_NAME" : "Isocarboxazid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6011", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19091830, + "CONCEPT_NAME" : "Lofepramine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6465", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 794147, + "CONCEPT_NAME" : "Maprotiline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6646", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19110751, + "CONCEPT_NAME" : "MELITRACEN", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "446248", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19007737, + "CONCEPT_NAME" : "Mianserin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6929", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19080226, + "CONCEPT_NAME" : "milnacipran", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "588250", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 725131, + "CONCEPT_NAME" : "Mirtazapine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15996", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 714684, + "CONCEPT_NAME" : "nefazodone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31565", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19127550, + "CONCEPT_NAME" : "Nialamide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7394", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 721724, + "CONCEPT_NAME" : "Nortriptyline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7531", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19129635, + "CONCEPT_NAME" : "Opipramol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7674", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36427294, + "CONCEPT_NAME" : "Oxitriptan", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "D", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "OMOP4757832", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "GRR", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 722031, + "CONCEPT_NAME" : "Paroxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "32937", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 733896, + "CONCEPT_NAME" : "Phenelzine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8123", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 754270, + "CONCEPT_NAME" : "Protriptyline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8886", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19098514, + "CONCEPT_NAME" : "quinupramine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35242", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19084693, + "CONCEPT_NAME" : "reboxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60842", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 766209, + "CONCEPT_NAME" : "Selegiline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9639", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 739138, + "CONCEPT_NAME" : "Sertraline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36437", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1398039, + "CONCEPT_NAME" : "ST. JOHN'S WORT EXTRACT", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "258326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19041910, + "CONCEPT_NAME" : "tianeptine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38252", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 703470, + "CONCEPT_NAME" : "Tranylcypromine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10734", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 703547, + "CONCEPT_NAME" : "Trazodone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10737", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 705755, + "CONCEPT_NAME" : "Trimipramine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10834", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19006186, + "CONCEPT_NAME" : "Tryptophan", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10898", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 743670, + "CONCEPT_NAME" : "venlafaxine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39786", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40234834, + "CONCEPT_NAME" : "vilazodone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1086769", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19008261, + "CONCEPT_NAME" : "Viloxazine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11196", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44507700, + "CONCEPT_NAME" : "vortioxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1455099", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 18, + "name" : "Depressive disorder prevalent", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 440383, + "CONCEPT_NAME" : "Depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35489007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438727, + "CONCEPT_NAME" : "Atypical depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191659001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481798, + "CONCEPT_NAME" : "Chronic depressive personality disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442057004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435520, + "CONCEPT_NAME" : "Reactive depressive psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191676002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224940, + "CONCEPT_NAME" : "Schizoaffective disorder, depressive type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84760002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 19, + "name" : "esketamine", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1366610, + "CONCEPT_NAME" : "esketamine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2119365", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "No prior mania", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior dementia", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 15, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior psychosis", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 10, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1010.json b/tests/cohorts/1010.json new file mode 100644 index 00000000..1db0616a --- /dev/null +++ b/tests/cohorts/1010.json @@ -0,0 +1,1297 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 2, + "First" : true, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "First" : true, + "ConditionTypeExclude" : false, + "ConditionSourceConcept" : 2 + } + }, + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ProcedureOccurrence" : { + "CodesetId" : 0, + "ProcedureTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 180, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "First" : true, + "ConditionTypeExclude" : false, + "ConditionSourceConcept" : 3 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Hematopoietic Stem Cell Transplantation (HSCT) ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4120445, + "CONCEPT_NAME" : "Hemopoietic stem cell transplant", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234336002", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2108458, + "CONCEPT_NAME" : "Allogeneic lymphocyte infusions", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38242", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43527933, + "CONCEPT_NAME" : "Hematopoietic progenitor cell (HPC); HPC boost", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38243", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789432, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Central Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30260G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789464, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Central Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30263G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788927, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Central Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788960, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Central Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789179, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Peripheral Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30250G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789211, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Peripheral Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30253G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788671, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Peripheral Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788704, + "CONCEPT_NAME" : "Transfusion of Autologous Bone Marrow into Peripheral Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233G0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789460, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Central Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30260X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2785921, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Central Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30263X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788955, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Central Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788988, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Central Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789207, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Peripheral Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30250X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789428, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Peripheral Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30253X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788699, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Peripheral Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788732, + "CONCEPT_NAME" : "Transfusion of Autologous Cord Blood Stem Cells into Peripheral Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233X0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789462, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Central Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30260Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2785923, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Central Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30263Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788957, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Central Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789177, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Central Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789209, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Peripheral Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30250Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789430, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Peripheral Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30253Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788701, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Peripheral Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788734, + "CONCEPT_NAME" : "Transfusion of Autologous Hematopoietic Stem Cells into Peripheral Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233Y0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788926, + "CONCEPT_NAME" : "Transfusion of Embryonic Stem Cells into Central Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240AZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788959, + "CONCEPT_NAME" : "Transfusion of Embryonic Stem Cells into Central Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243AZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788483, + "CONCEPT_NAME" : "Transfusion of Embryonic Stem Cells into Peripheral Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230AZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788703, + "CONCEPT_NAME" : "Transfusion of Embryonic Stem Cells into Peripheral Vein, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233AZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789433, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Central Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30260G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789465, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Central Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30263G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788928, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Central Vein, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788961, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Central Vein, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789180, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Peripheral Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30250G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789212, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Peripheral Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30253G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788672, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Peripheral Vein, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788705, + "CONCEPT_NAME" : "Transfusion of Nonautologous Bone Marrow into Peripheral Vein, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233G1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789461, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Central Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30260X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2785922, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Central Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30263X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788956, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Central Vein, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789176, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Central Vein, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789208, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Peripheral Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30250X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789429, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Peripheral Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30253X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788700, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Peripheral Vein, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788733, + "CONCEPT_NAME" : "Transfusion of Nonautologous Cord Blood Stem Cells into Peripheral Vein, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233X1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789463, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Central Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30260Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2785924, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Central Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30263Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788958, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Central Vein, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30240Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789178, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Central Vein, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30243Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789210, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Peripheral Artery, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30250Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2789431, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Peripheral Artery, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30253Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788702, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Peripheral Vein, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30230Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2788925, + "CONCEPT_NAME" : "Transfusion of Nonautologous Hematopoietic Stem Cells into Peripheral Vein, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30233Y1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2617352, + "CONCEPT_NAME" : "BONE MARROW OR PERIPHERAL STEM CELL HARVEST ELIMINATE CELL TYPE(S) (E.G. T-CELLS", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "G0267", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "HCPCS", + "CONCEPT_CLASS_ID" : "HCPCS" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2721123, + "CONCEPT_NAME" : "Cord blood harvesting for transplantation, allogeneic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "S2140", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "HCPCS", + "CONCEPT_CLASS_ID" : "HCPCS" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2108456, + "CONCEPT_NAME" : "Hematopoietic progenitor cell (HPC); allogeneic transplantation per donor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38240", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2108457, + "CONCEPT_NAME" : "Hematopoietic progenitor cell (HPC); autologous transplantation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38241", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46272967, + "CONCEPT_NAME" : "Transplantation of autologous progenitor cell", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "711429001", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537745, + "CONCEPT_NAME" : "Bone marrow transplant present", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "737300001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4121274, + "CONCEPT_NAME" : "Bone marrow transplant failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234520000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4125659, + "CONCEPT_NAME" : "Bone marrow transplant rejection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234519006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45566479, + "CONCEPT_NAME" : "Bone marrow transplant status", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "Z94.81", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "5-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45537646, + "CONCEPT_NAME" : "Encounter for aftercare following bone marrow transplant", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "Z48.290", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "6-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45585326, + "CONCEPT_NAME" : "Other complications of bone marrow transplant", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "T86.09", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "5-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Graft versus host disease included non standard", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 434314, + "CONCEPT_NAME" : "Chronic graft-versus-host disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402356004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45595782, + "CONCEPT_NAME" : "Acute on chronic graft-versus-host disease", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "D89.812", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "6-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 3, + "name" : "Unspecified graft vs host dx - non standard", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 44828814, + "CONCEPT_NAME" : "Graft-versus-host disease, unspecified", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "279.50", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD9CM", + "CONCEPT_CLASS_ID" : "5-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45537943, + "CONCEPT_NAME" : "Graft-versus-host disease, unspecified", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "D89.813", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "6-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1011.json b/tests/cohorts/1011.json new file mode 100644 index 00000000..59d2df1e --- /dev/null +++ b/tests/cohorts/1011.json @@ -0,0 +1,78 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Marginal zone lymphoma", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40490918, + "CONCEPT_NAME" : "Marginal zone lymphoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447100004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35622279, + "CONCEPT_NAME" : "Splenic marginal zone B-cell lymphoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "763666008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1012.json b/tests/cohorts/1012.json new file mode 100644 index 00000000..eb3f4f9d --- /dev/null +++ b/tests/cohorts/1012.json @@ -0,0 +1,112 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Waldenstrom macroglobulinemia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 435502, + "CONCEPT_NAME" : "Macroglobulinemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "190817009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4141255, + "CONCEPT_NAME" : "Malignant lymphoma - lymphoplasmacytic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "307623001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4029658, + "CONCEPT_NAME" : "Splenic marginal zone B-cell lymphoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128802003", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Morph Abnormality" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35622279, + "CONCEPT_NAME" : "Splenic marginal zone B-cell lymphoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "763666008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1013.json b/tests/cohorts/1013.json new file mode 100644 index 00000000..aae1712d --- /dev/null +++ b/tests/cohorts/1013.json @@ -0,0 +1,112 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Ankylosing Spondylitis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 437082, + "CONCEPT_NAME" : "Ankylosing spondylitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9631008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4083681, + "CONCEPT_NAME" : "Juvenile ankylosing spondylitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239805001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4079735, + "CONCEPT_NAME" : "Juvenile spondyloarthropathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239806000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37017494, + "CONCEPT_NAME" : "Non-radiographic axial spondyloarthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "713777005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1016.json b/tests/cohorts/1016.json new file mode 100644 index 00000000..3a3b2334 --- /dev/null +++ b/tests/cohorts/1016.json @@ -0,0 +1,154 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "OccurrenceStartDate" : { + "Value" : "2016-01-01", + "Op" : "gte" + }, + "ConditionTypeExclude" : false, + "Age" : { + "Value" : 16, + "Op" : "lte" + } + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Polyarticular juvenile idiopathic arthritis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4195770, + "CONCEPT_NAME" : "Idiopathic polyarthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44221002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4132809, + "CONCEPT_NAME" : "Juvenile seropositive polyarthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410796000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42535177, + "CONCEPT_NAME" : "Polyarticular juvenile idiopathic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16044751000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4132810, + "CONCEPT_NAME" : "Juvenile seronegative polyarthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410797009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 72714, + "CONCEPT_NAME" : "Chronic polyarticular juvenile rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1961000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4218311, + "CONCEPT_NAME" : "Undifferentiated inflammatory polyarthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416956002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1017.json b/tests/cohorts/1017.json new file mode 100644 index 00000000..9f777657 --- /dev/null +++ b/tests/cohorts/1017.json @@ -0,0 +1,151 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false, + "Age" : { + "Value" : 1, + "Op" : "lt", + "Extent" : 1 + } + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Neonatal Thrombocytopenia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 435076, + "CONCEPT_NAME" : "Transient neonatal thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23205009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4133984, + "CONCEPT_NAME" : "Alloimmune thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128093000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4221109, + "CONCEPT_NAME" : "Neonatal thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82835005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195579, + "CONCEPT_NAME" : "Neonatal thrombocytopenia associated with maternal idiopathic thrombocytopenic purpura", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7933002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4172999, + "CONCEPT_NAME" : "Autoimmune neonatal thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276575001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4234257, + "CONCEPT_NAME" : "Neonatal thrombocytopenia due to exchange transfusion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89962000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1018.json b/tests/cohorts/1018.json new file mode 100644 index 00000000..d95fe842 --- /dev/null +++ b/tests/cohorts/1018.json @@ -0,0 +1,163 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Warm autoimmune hemolytic anemia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4160887, + "CONCEPT_NAME" : "Cold autoimmune hemolytic anemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "398937006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4146936, + "CONCEPT_NAME" : "Drug-induced autoimmune hemolytic anemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309742004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4098017, + "CONCEPT_NAME" : "Primary cold-type hemolytic anemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191210005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4131917, + "CONCEPT_NAME" : "Paroxysmal cold hemoglobinuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "127057004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4098754, + "CONCEPT_NAME" : "Secondary cold-type hemolytic anemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191212002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4219853, + "CONCEPT_NAME" : "Warm autoimmune hemolytic anemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3978000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436956, + "CONCEPT_NAME" : "Evans syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75331009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1019.json b/tests/cohorts/1019.json new file mode 100644 index 00000000..88c8e3fb --- /dev/null +++ b/tests/cohorts/1019.json @@ -0,0 +1,306 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionEra" : { + "CodesetId" : 1, + "OccurrenceCount" : { + "Value" : 0, + "Op" : "eq" + } + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 14, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "HDFN - Mother and child codes", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 433603, + "CONCEPT_NAME" : "Hemolytic disease of fetus OR newborn due to RhD isoimmunization", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86986002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199891, + "CONCEPT_NAME" : "Rhesus isoimmunization affecting pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44795003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4028774, + "CONCEPT_NAME" : "Kell isoimmunization in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "237302001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 1, + "name" : "Pregnancy Codes", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443213, + "CONCEPT_NAME" : "Stillbirth", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "237364002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437611, + "CONCEPT_NAME" : "Ectopic pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34801009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4067106, + "CONCEPT_NAME" : "Miscarriage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17369002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433260, + "CONCEPT_NAME" : "Mother delivered", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "289256000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Pregnancy End points", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443213, + "CONCEPT_NAME" : "Stillbirth", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "237364002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437611, + "CONCEPT_NAME" : "Ectopic pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34801009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4067106, + "CONCEPT_NAME" : "Miscarriage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17369002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433260, + "CONCEPT_NAME" : "Mother delivered", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "289256000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 270 + } + }, + "CensoringCriteria" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + } + ], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 90 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1020.json b/tests/cohorts/1020.json new file mode 100644 index 00000000..da38869a --- /dev/null +++ b/tests/cohorts/1020.json @@ -0,0 +1,969 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 6, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 9, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 10, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 11, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "Major depressive disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440383, + "CONCEPT_NAME" : "Depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35489007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4175329, + "CONCEPT_NAME" : "Organic mood disorder of depressed type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42594001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40546087, + "CONCEPT_NAME" : "Depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "366979004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4191716, + "CONCEPT_NAME" : "Symptoms of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "394924000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212469, + "CONCEPT_NAME" : "Patient given advice about management of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415044007", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442306, + "CONCEPT_NAME" : "Adjustment disorder with depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57194009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684319, + "CONCEPT_NAME" : "Adjustment disorder with mixed anxiety and depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "782501005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438727, + "CONCEPT_NAME" : "Atypical depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191659001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481798, + "CONCEPT_NAME" : "Chronic depressive personality disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442057004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443864, + "CONCEPT_NAME" : "Multi-infarct dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14070001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239471, + "CONCEPT_NAME" : "Postpartum depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58703003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377527, + "CONCEPT_NAME" : "Presenile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191455000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435520, + "CONCEPT_NAME" : "Reactive depressive psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191676002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224940, + "CONCEPT_NAME" : "Schizoaffective disorder, depressive type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84760002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 379784, + "CONCEPT_NAME" : "Senile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191459006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433440, + "CONCEPT_NAME" : "Dysthymia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78667006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "Bipolar disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 8, + "name" : "Schizoaffective disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4286201, + "CONCEPT_NAME" : "Schizoaffective disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68890003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 9, + "name" : "Schizophrenia not including Paraphenia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 433734, + "CONCEPT_NAME" : "Acute exacerbation of chronic latent schizophrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191564007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435235, + "CONCEPT_NAME" : "Chronic latent schizophrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191562006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433742, + "CONCEPT_NAME" : "Latent schizophrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191559008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434318, + "CONCEPT_NAME" : "Paraphrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26472000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435783, + "CONCEPT_NAME" : "Schizophrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58214004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440077, + "CONCEPT_NAME" : "Subchronic latent schizophrenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191561004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 10, + "name" : "Dementia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4182210, + "CONCEPT_NAME" : "Dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52448006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4152048, + "CONCEPT_NAME" : "Senile and presenile organic psychotic conditions", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268612007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 376095, + "CONCEPT_NAME" : "Drug-induced dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191493005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37116464, + "CONCEPT_NAME" : "Dementia caused by heavy metal exposure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "733184002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36717598, + "CONCEPT_NAME" : "Dementia caused by toxin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722978000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377788, + "CONCEPT_NAME" : "General paresis - neurosyphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51928006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42535731, + "CONCEPT_NAME" : "Dementia following injury caused by exposure to ionizing radiation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "733185001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37311999, + "CONCEPT_NAME" : "Dementia caused by volatile inhalant", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "788898005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 372610, + "CONCEPT_NAME" : "Postconcussion syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40425004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 372608, + "CONCEPT_NAME" : "Amnestic disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3298001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4043378, + "CONCEPT_NAME" : "Frontotemporal dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230270009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373179, + "CONCEPT_NAME" : "Senile degeneration of brain", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45864009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4104700, + "CONCEPT_NAME" : "Cerebral degeneration associated with another disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192794001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435088, + "CONCEPT_NAME" : "Senility", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "271873000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4168666, + "CONCEPT_NAME" : "Cerebral degeneration", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "418143002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 380701, + "CONCEPT_NAME" : "Diffuse Lewy body disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80098002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 374009, + "CONCEPT_NAME" : "Organic mental disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111479008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4009705, + "CONCEPT_NAME" : "Age-related cognitive decline", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102891000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 11, + "name" : "Psychotic disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436073, + "CONCEPT_NAME" : "Psychotic disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69322001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1021.json b/tests/cohorts/1021.json new file mode 100644 index 00000000..ef5aa3c5 --- /dev/null +++ b/tests/cohorts/1021.json @@ -0,0 +1,401 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Days" : 365, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 2, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "DrugExposure" : { + "CodesetId" : 1, + "DrugTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 60, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + { + "DrugExposure" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 60, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 1, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4046355, + "CONCEPT_NAME" : "Genetically determined myasthenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230669004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 76685, + "CONCEPT_NAME" : "Myasthenia gravis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91637004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4204694, + "CONCEPT_NAME" : "Myasthenia gravis, juvenile form", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55051001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046356, + "CONCEPT_NAME" : "Congenital myasthenic syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230672006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4101899, + "CONCEPT_NAME" : "Congenital and developmental myasthenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193216006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81400, + "CONCEPT_NAME" : "Neonatal myasthenia gravis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82178003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046357, + "CONCEPT_NAME" : "Putative defect in acetylcholine synthesis or packaging", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230676009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4045732, + "CONCEPT_NAME" : "Myopathy in myasthenia gravis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230687001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 1, + "name" : "Pyridostigmine", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 759740, + "CONCEPT_NAME" : "pyridostigmine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9000", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age >= 18 years ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1022.json b/tests/cohorts/1022.json new file mode 100644 index 00000000..821a1cdd --- /dev/null +++ b/tests/cohorts/1022.json @@ -0,0 +1,2158 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 5, + "First" : true, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 2, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "Sleep Disorders", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 44798390, + "CONCEPT_NAME" : "[V]Personal history of unhealthy sleep-wake schedule", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "D", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "441661000000100", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4287868, + "CONCEPT_NAME" : "Abnormal rapid eye movement sleep", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69020003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269699, + "CONCEPT_NAME" : "Acquired central alveolar hypoventilation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "105191000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 375794, + "CONCEPT_NAME" : "Alcohol-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41083005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4044240, + "CONCEPT_NAME" : "Alveolar sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230494007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4121694, + "CONCEPT_NAME" : "Amphetamine-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25753007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35623409, + "CONCEPT_NAME" : "Autoimmune encephalopathy with parasomnia and obstructive sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "765751002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36716323, + "CONCEPT_NAME" : "Autosomal dominant cerebellar ataxia, deafness and narcolepsy syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722293005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43021812, + "CONCEPT_NAME" : "Behavioral insomnia of childhood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90361000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43021860, + "CONCEPT_NAME" : "Behavioral insomnia of childhood, combined type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "288081000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43020464, + "CONCEPT_NAME" : "Behavioral insomnia of childhood, limit setting type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "288091000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43020467, + "CONCEPT_NAME" : "Behavioral insomnia of childhood, sleep onset association type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "288101000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110489, + "CONCEPT_NAME" : "Behaviorally induced hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724749007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4009650, + "CONCEPT_NAME" : "Breathing-related sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111489007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4210451, + "CONCEPT_NAME" : "Caffeine-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56194001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437854, + "CONCEPT_NAME" : "Cataplexy and narcolepsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193042000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4086499, + "CONCEPT_NAME" : "Central alveolar hypoventilation syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "24825006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37018652, + "CONCEPT_NAME" : "Central sleep apnea caused by high altitude", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91441000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110294, + "CONCEPT_NAME" : "Central sleep apnea caused by substance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724504007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110295, + "CONCEPT_NAME" : "Central sleep apnea co-occurrent with Cheyne Stokes respiration", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724506009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531585, + "CONCEPT_NAME" : "Central sleep apnea due to periodic breathing", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "85721000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439794, + "CONCEPT_NAME" : "Central sleep apnea syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27405005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110296, + "CONCEPT_NAME" : "Central sleep apnea without Cheyne-Stokes respiration", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724507000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37016175, + "CONCEPT_NAME" : "Circadian rhythm sleep disorder caused by alcohol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135331000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4331287, + "CONCEPT_NAME" : "Cocaine-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22574000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 319793, + "CONCEPT_NAME" : "Congenital central hypoventilation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399040002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530733, + "CONCEPT_NAME" : "Daytime hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31771000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4220636, + "CONCEPT_NAME" : "Delayed onset of sleep", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "401161007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42535241, + "CONCEPT_NAME" : "Dependence on biphasic positive airway pressure ventilation co-occurrent and due to central sleep apnea syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16419651000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4115402, + "CONCEPT_NAME" : "Difficulty sleeping", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "301345002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4204989, + "CONCEPT_NAME" : "Disturbance in sleep behavior", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "53888004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530616, + "CONCEPT_NAME" : "Drug induced central sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "104831000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44784627, + "CONCEPT_NAME" : "Drug-induced hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91471000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44784625, + "CONCEPT_NAME" : "Drug-induced insomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91411000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435792, + "CONCEPT_NAME" : "Drug-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "418475009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444300, + "CONCEPT_NAME" : "Fatal familial insomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83157008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36714658, + "CONCEPT_NAME" : "Glaucoma and sleep apnea syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "719976001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438134, + "CONCEPT_NAME" : "Hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "77692006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37016174, + "CONCEPT_NAME" : "Hypersomnia caused by alcohol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135321000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434891, + "CONCEPT_NAME" : "Hypersomnia disorder related to a known organic factor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44455001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436669, + "CONCEPT_NAME" : "Hypersomnia disorder related to another mental disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89415002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4143701, + "CONCEPT_NAME" : "Hypersomnia disorder related to menstruation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426943005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4047912, + "CONCEPT_NAME" : "Hypersomnia of non-organic origin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230488004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439150, + "CONCEPT_NAME" : "Hypersomnia with sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79280005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110490, + "CONCEPT_NAME" : "Hypersomnolence caused by substance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724750007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4180282, + "CONCEPT_NAME" : "Hypoventilation during sleep due to neuromuscular disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "429456008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531627, + "CONCEPT_NAME" : "Idiopathic hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3731000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40483183, + "CONCEPT_NAME" : "Idiopathic hypersomnia associated with long sleep time", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442416002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40482713, + "CONCEPT_NAME" : "Idiopathic hypersomnia without long sleep time", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442292004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481299, + "CONCEPT_NAME" : "Idiopathic sleep related non-obstructive alveolar hypoventilation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441910000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481897, + "CONCEPT_NAME" : "Inadequate sleep hygiene", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "443483005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37016173, + "CONCEPT_NAME" : "Insomnia caused by alcohol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135311000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434172, + "CONCEPT_NAME" : "Insomnia with sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41975002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4312903, + "CONCEPT_NAME" : "Insufficient rest/sleep for age", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "425202006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110297, + "CONCEPT_NAME" : "Late-onset central hypoventilation co-occurrent and due to hypothalamic dysfunction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724508005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4104980, + "CONCEPT_NAME" : "Light sleep", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29373008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4113205, + "CONCEPT_NAME" : "Menopausal sleeplessness", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198437004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4043564, + "CONCEPT_NAME" : "Mixed sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230493001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436100, + "CONCEPT_NAME" : "Narcolepsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60380001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42536721, + "CONCEPT_NAME" : "Narcolepsy type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "735676003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531721, + "CONCEPT_NAME" : "Narcolepsy without cataplexy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91521000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4137847, + "CONCEPT_NAME" : "Non-organic parasomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "425476007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42872389, + "CONCEPT_NAME" : "Obstructive sleep apnea of adult", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1101000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42872388, + "CONCEPT_NAME" : "Obstructive sleep apnea of child", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1091000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442588, + "CONCEPT_NAME" : "Obstructive sleep apnea syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78275009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44810442, + "CONCEPT_NAME" : "On melatonin for sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "887881000000101", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4230779, + "CONCEPT_NAME" : "Opioid-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88926005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481372, + "CONCEPT_NAME" : "Organic parasomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441976002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40482247, + "CONCEPT_NAME" : "Organic sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442164004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531594, + "CONCEPT_NAME" : "Organic sleep related movement disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90011000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440087, + "CONCEPT_NAME" : "Parasomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58690002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37016172, + "CONCEPT_NAME" : "Parasomnia caused by alcohol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135301000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110493, + "CONCEPT_NAME" : "Parasomnia disorder caused by substance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724754003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434904, + "CONCEPT_NAME" : "Persistent hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191999000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43022069, + "CONCEPT_NAME" : "Primary central sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9741000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4262584, + "CONCEPT_NAME" : "Primary hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36124002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4262580, + "CONCEPT_NAME" : "Primary sleep apnea of newborn", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "361208003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443528, + "CONCEPT_NAME" : "Recurrent hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426451004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40482198, + "CONCEPT_NAME" : "Recurrent isolated sleep paralysis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442120007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4045772, + "CONCEPT_NAME" : "Restless sleep", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12262002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762958, + "CONCEPT_NAME" : "Secondary narcolepsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "434241000124107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762960, + "CONCEPT_NAME" : "Secondary narcolepsy with cataplexy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "434261000124106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762959, + "CONCEPT_NAME" : "Secondary narcolepsy without cataplexy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "434251000124109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4181303, + "CONCEPT_NAME" : "Secondary parasomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "428708005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239812, + "CONCEPT_NAME" : "Sedative, hypnotic AND/OR anxiolytic-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57588009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109055, + "CONCEPT_NAME" : "Severe pediatric obstructive sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16275741000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4099949, + "CONCEPT_NAME" : "Short-sleeper", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192007009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 313459, + "CONCEPT_NAME" : "Sleep apnea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73430006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435524, + "CONCEPT_NAME" : "Sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39898005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37119151, + "CONCEPT_NAME" : "Sleep disorder caused by psychoactive substance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724732000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40483220, + "CONCEPT_NAME" : "Sleep hypoventilation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "443760008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4139210, + "CONCEPT_NAME" : "Sleep hypoventilation due to lower airway obstruction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426542005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435238, + "CONCEPT_NAME" : "Sleep paralysis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "277180005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4132137, + "CONCEPT_NAME" : "Sleep pattern disturbance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26677001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43021811, + "CONCEPT_NAME" : "Sleep related hypoventilation or hypoxemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89911000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4175644, + "CONCEPT_NAME" : "Sleep state misperception", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "427745001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37110298, + "CONCEPT_NAME" : "Sleep-related hypoventilation caused by substance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "724509002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443393, + "CONCEPT_NAME" : "Substance-induced sleep disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "363314000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437260, + "CONCEPT_NAME" : "Transient hypersomnia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268653004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Inpatient or ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "Major Depressive Disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440383, + "CONCEPT_NAME" : "Depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35489007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4175329, + "CONCEPT_NAME" : "Organic mood disorder of depressed type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42594001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40546087, + "CONCEPT_NAME" : "Depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "366979004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4191716, + "CONCEPT_NAME" : "Symptoms of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "394924000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212469, + "CONCEPT_NAME" : "Patient given advice about management of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415044007", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442306, + "CONCEPT_NAME" : "Adjustment disorder with depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57194009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684319, + "CONCEPT_NAME" : "Adjustment disorder with mixed anxiety and depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "782501005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438727, + "CONCEPT_NAME" : "Atypical depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191659001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481798, + "CONCEPT_NAME" : "Chronic depressive personality disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442057004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443864, + "CONCEPT_NAME" : "Multi-infarct dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14070001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239471, + "CONCEPT_NAME" : "Postpartum depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58703003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377527, + "CONCEPT_NAME" : "Presenile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191455000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435520, + "CONCEPT_NAME" : "Reactive depressive psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191676002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224940, + "CONCEPT_NAME" : "Schizoaffective disorder, depressive type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84760002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 379784, + "CONCEPT_NAME" : "Senile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191459006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433440, + "CONCEPT_NAME" : "Dysthymia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78667006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1023.json b/tests/cohorts/1023.json new file mode 100644 index 00000000..78717595 --- /dev/null +++ b/tests/cohorts/1023.json @@ -0,0 +1,781 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Observation" : { + "CodesetId" : 2, + "ObservationTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 5, + "First" : true, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 2, + "First" : true, + "ConditionTypeExclude" : false + } + }, + { + "Observation" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 2, + "First" : true, + "ObservationTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "Suicide and suicidal ideation, prevalent (informed by PHOEBE)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 439235, + "CONCEPT_NAME" : "Self inflicted injury", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276853009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4181216, + "CONCEPT_NAME" : "Self-administered poisoning", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "363293009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444362, + "CONCEPT_NAME" : "Suicidal deliberate poisoning", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86849004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273391, + "CONCEPT_NAME" : "Suicidal thoughts", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6471006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440925, + "CONCEPT_NAME" : "Suicide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44301001", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4303690, + "CONCEPT_NAME" : "Intentionally harming self", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "418420002", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Event" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4009713, + "CONCEPT_NAME" : "Thoughts of self harm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102911000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4219484, + "CONCEPT_NAME" : "Suicide attempt", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82313006", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435446, + "CONCEPT_NAME" : "Late effect of self inflicted injury", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "219174008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4058281, + "CONCEPT_NAME" : "H/O: attempted suicide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "161474000", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4021339, + "CONCEPT_NAME" : "Feeling suicidal", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "225457007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4216115, + "CONCEPT_NAME" : "Threatening suicide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41501003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4092411, + "CONCEPT_NAME" : "Self-injurious behavior", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "248062006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4152408, + "CONCEPT_NAME" : "H/O: deliberate self harm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314550003", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Inpatient or ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "Major Depressive Disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440383, + "CONCEPT_NAME" : "Depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35489007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4175329, + "CONCEPT_NAME" : "Organic mood disorder of depressed type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42594001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40546087, + "CONCEPT_NAME" : "Depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "366979004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4191716, + "CONCEPT_NAME" : "Symptoms of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "394924000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212469, + "CONCEPT_NAME" : "Patient given advice about management of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415044007", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442306, + "CONCEPT_NAME" : "Adjustment disorder with depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57194009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684319, + "CONCEPT_NAME" : "Adjustment disorder with mixed anxiety and depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "782501005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438727, + "CONCEPT_NAME" : "Atypical depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191659001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481798, + "CONCEPT_NAME" : "Chronic depressive personality disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442057004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443864, + "CONCEPT_NAME" : "Multi-infarct dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14070001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239471, + "CONCEPT_NAME" : "Postpartum depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58703003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377527, + "CONCEPT_NAME" : "Presenile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191455000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435520, + "CONCEPT_NAME" : "Reactive depressive psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191676002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224940, + "CONCEPT_NAME" : "Schizoaffective disorder, depressive type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84760002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 379784, + "CONCEPT_NAME" : "Senile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191459006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433440, + "CONCEPT_NAME" : "Dysthymia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78667006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1024.json b/tests/cohorts/1024.json new file mode 100644 index 00000000..316d6631 --- /dev/null +++ b/tests/cohorts/1024.json @@ -0,0 +1,492 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 5, + "First" : true, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 2, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "Anhedonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4102935, + "CONCEPT_NAME" : "Anhedonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28669007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Inpatient or ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "Major Depressive Disorder", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436665, + "CONCEPT_NAME" : "Bipolar disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13746004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440383, + "CONCEPT_NAME" : "Depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35489007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4175329, + "CONCEPT_NAME" : "Organic mood disorder of depressed type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42594001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40546087, + "CONCEPT_NAME" : "Depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "366979004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4191716, + "CONCEPT_NAME" : "Symptoms of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "394924000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212469, + "CONCEPT_NAME" : "Patient given advice about management of depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415044007", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442306, + "CONCEPT_NAME" : "Adjustment disorder with depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57194009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684319, + "CONCEPT_NAME" : "Adjustment disorder with mixed anxiety and depressed mood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "782501005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438727, + "CONCEPT_NAME" : "Atypical depressive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191659001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481798, + "CONCEPT_NAME" : "Chronic depressive personality disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442057004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443864, + "CONCEPT_NAME" : "Multi-infarct dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14070001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239471, + "CONCEPT_NAME" : "Postpartum depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58703003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377527, + "CONCEPT_NAME" : "Presenile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191455000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435520, + "CONCEPT_NAME" : "Reactive depressive psychosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191676002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224940, + "CONCEPT_NAME" : "Schizoaffective disorder, depressive type", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84760002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 379784, + "CONCEPT_NAME" : "Senile dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191459006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433440, + "CONCEPT_NAME" : "Dysthymia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78667006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1025.json b/tests/cohorts/1025.json new file mode 100644 index 00000000..9b9a5bb8 --- /dev/null +++ b/tests/cohorts/1025.json @@ -0,0 +1,464 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "CodesetId" : 0, + "ProcedureTypeExclude" : false + } + }, + { + "DrugExposure" : { + "CorrelatedCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 365, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ProcedureOccurrence" : { + "CodesetId" : 0, + "ProcedureTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 365, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 1, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "ADHD condition or procedure", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 44813054, + "CONCEPT_NAME" : "Attention deficit hyperactivity disorder annual review", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "710071000000106", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40480225, + "CONCEPT_NAME" : "Adult attention deficit hyperactivity disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444613000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4262921, + "CONCEPT_NAME" : "Hyperkinetic syndrome with developmental delay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46745001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45765570, + "CONCEPT_NAME" : "Drug therapy for attention deficit hyperactivity disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "702538008", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4047120, + "CONCEPT_NAME" : "Disorders of attention and motor control", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "229712006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4085043, + "CONCEPT_NAME" : "Reduced concentration span", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "247762003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 1, + "name" : "ADHD medications", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 714785, + "CONCEPT_NAME" : "amphetamine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "725", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 742185, + "CONCEPT_NAME" : "atomoxetine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38400", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 719311, + "CONCEPT_NAME" : "dextroamphetamine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3288", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 705944, + "CONCEPT_NAME" : "methylphenidate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6901", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 709567, + "CONCEPT_NAME" : "lisdexamfetamine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "700810", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19090984, + "CONCEPT_NAME" : "armodafinil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "641465", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1398937, + "CONCEPT_NAME" : "clonidine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2599", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 731533, + "CONCEPT_NAME" : "dexmethylphenidate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "352372", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19008261, + "CONCEPT_NAME" : "viloxazine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11196", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1344965, + "CONCEPT_NAME" : "guanfacine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40114", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 704053, + "CONCEPT_NAME" : "methamphetamine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6816", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 710650, + "CONCEPT_NAME" : "modafinil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30125", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37002370, + "CONCEPT_NAME" : "oxybate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2387302", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1537411, + "CONCEPT_NAME" : "serdexmethylphenidate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2562176", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1026.json b/tests/cohorts/1026.json new file mode 100644 index 00000000..151b283e --- /dev/null +++ b/tests/cohorts/1026.json @@ -0,0 +1,112 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 6, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "Multiple sclerosis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 374919, + "CONCEPT_NAME" : "Multiple sclerosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "24700007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44784474, + "CONCEPT_NAME" : "Dementia associated with multiple sclerosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "698626001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765565, + "CONCEPT_NAME" : "Functional quadriplegia due to multiple sclerosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "24800001000004103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761978, + "CONCEPT_NAME" : "Cognitive impairment due to multiple sclerosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25470001000004105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1027.json b/tests/cohorts/1027.json new file mode 100644 index 00000000..da2b1cdc --- /dev/null +++ b/tests/cohorts/1027.json @@ -0,0 +1,163 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 4, + "First" : true, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 4, + "name" : "Chronic Leukocytic Leukemia not including Hairy cell, prolymphocytic leukemia, T cell, reticuloendotheliosis + remission", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4002356, + "CONCEPT_NAME" : "Diffuse non-Hodgkin's lymphoma, small cell (clinical)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "109968002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 138379, + "CONCEPT_NAME" : "Chronic lymphoid leukemia, disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "92814006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4038845, + "CONCEPT_NAME" : "Hairy cell leukemia (clinical)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "118613001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4173974, + "CONCEPT_NAME" : "B-cell prolymphocytic leukemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "277619001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4001331, + "CONCEPT_NAME" : "Prolymphocytic leukemia (clinical)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "110006004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4079683, + "CONCEPT_NAME" : "T-cell prolymphocytic leukemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "277567002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783718, + "CONCEPT_NAME" : "T-cell large granular lymphocytic leukemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699818003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1028.json b/tests/cohorts/1028.json new file mode 100644 index 00000000..4feb94bb --- /dev/null +++ b/tests/cohorts/1028.json @@ -0,0 +1,383 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Primary or malignant urothelial bladder cancer", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 197508, + "CONCEPT_NAME" : "Malignant tumor of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399326009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4177230, + "CONCEPT_NAME" : "Malignant tumor of urethra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "363459007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4312149, + "CONCEPT_NAME" : "Secondary malignant neoplasm of anterior wall of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94171008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4312802, + "CONCEPT_NAME" : "Secondary malignant neoplasm of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94186002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4313210, + "CONCEPT_NAME" : "Secondary malignant neoplasm of lateral wall of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94374009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4314336, + "CONCEPT_NAME" : "Secondary malignant neoplasm of posterior wall of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94500000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4313925, + "CONCEPT_NAME" : "Secondary malignant neoplasm of rectovesical septum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94512001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4314491, + "CONCEPT_NAME" : "Secondary malignant neoplasm of trigone of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94647000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4313221, + "CONCEPT_NAME" : "Secondary malignant neoplasm of urachus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94658009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4313222, + "CONCEPT_NAME" : "Secondary malignant neoplasm of ureteric orifice of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94660006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4314494, + "CONCEPT_NAME" : "Secondary malignant neoplasm of urinary bladder neck", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94662003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37016119, + "CONCEPT_NAME" : "Primary squamous cell carcinoma of urethra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "107591000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4113112, + "CONCEPT_NAME" : "Squamous cell carcinoma of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "255111004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4111028, + "CONCEPT_NAME" : "Adenocarcinoma of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "255110003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37116429, + "CONCEPT_NAME" : "Primary adenocarcinoma of urethra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "733136006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36713671, + "CONCEPT_NAME" : "Small cell neuroendocrine carcinoma of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "718604008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4080733, + "CONCEPT_NAME" : "Rhabdomyosarcoma of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "278024000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4175529, + "CONCEPT_NAME" : "Sarcoma of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "278046008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4315813, + "CONCEPT_NAME" : "Secondary malignant neoplasm of urethra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94661005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192855, + "CONCEPT_NAME" : "Cancer in situ of urinary bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "92546004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1029.json b/tests/cohorts/1029.json new file mode 100644 index 00000000..3f793444 --- /dev/null +++ b/tests/cohorts/1029.json @@ -0,0 +1,210 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "ConditionTypeExclude" : false, + "ConditionSourceConcept" : 5 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 5, + "name" : "Mantle Cell Lymphoma (non-standard)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 45590943, + "CONCEPT_NAME" : "Mantle cell lymphoma, extranodal and solid organ sites", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "C83.19", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "5-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "Mantle Cell Lymphoma", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 440058, + "CONCEPT_NAME" : "Malignant lymphoma of extranodal AND/OR solid organ site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "93199007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481901, + "CONCEPT_NAME" : "Mantle cell lymphoma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "443487006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435758, + "CONCEPT_NAME" : "Burkitt's tumor of extranodal AND/OR solid organ site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "92516002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440058, + "CONCEPT_NAME" : "Malignant lymphoma of extranodal AND/OR solid organ site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "93199007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 135204, + "CONCEPT_NAME" : "Mycosis fungoides of extranodal AND/OR solid organ site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94715001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194878, + "CONCEPT_NAME" : "Nodular lymphoma of extranodal AND/OR solid organ site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95194004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40487528, + "CONCEPT_NAME" : "Non-Hodgkin's lymphoma of extranodal site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447989004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 135759, + "CONCEPT_NAME" : "Sézary's disease of extranodal AND/OR solid organ site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95264000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1030.json b/tests/cohorts/1030.json new file mode 100644 index 00000000..c5f33800 --- /dev/null +++ b/tests/cohorts/1030.json @@ -0,0 +1,78 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false, + "Age" : { + "Value" : 18, + "Op" : "gte" + }, + "Gender" : [ + { + "CONCEPT_ID" : 8507, + "CONCEPT_NAME" : "MALE", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "M", + "DOMAIN_ID" : "Gender", + "VOCABULARY_ID" : "Gender", + "CONCEPT_CLASS_ID" : null + } + ] + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Prostate cancer", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4163261, + "CONCEPT_NAME" : "Malignant tumor of prostate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399068003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1031.json b/tests/cohorts/1031.json new file mode 100644 index 00000000..6c4b5209 --- /dev/null +++ b/tests/cohorts/1031.json @@ -0,0 +1,425 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 2, + "First" : true, + "ConditionTypeExclude" : false + } + }, + { + "Observation" : { + "CodesetId" : 2, + "First" : true, + "ObservationTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "Coronary artery disease ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 43020660, + "CONCEPT_NAME" : "Ischemic dilated cardiomyopathy due to coronary artery disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "472100003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4185932, + "CONCEPT_NAME" : "Ischemic heart disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414545008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109911, + "CONCEPT_NAME" : "Pulmonary embolism due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723859005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4177223, + "CONCEPT_NAME" : "History of percutaneous transluminal coronary angioplasty", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "428308007", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127089, + "CONCEPT_NAME" : "Coronary artery spasm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23687008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109912, + "CONCEPT_NAME" : "Arrhythmia due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723860000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537729, + "CONCEPT_NAME" : "Aortocoronary bypass graft present", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "737276005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438172, + "CONCEPT_NAME" : "Atrial septal defect due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194863005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 316995, + "CONCEPT_NAME" : "Coronary occlusion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63739005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108678, + "CONCEPT_NAME" : "Hemopericardium due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194862000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124687, + "CONCEPT_NAME" : "Cardiac rupture due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233847009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45766165, + "CONCEPT_NAME" : "Heart failure with reduced ejection fraction due to coronary artery disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "703273002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108220, + "CONCEPT_NAME" : "Rupture of papillary muscle as current complication following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194867006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4058723, + "CONCEPT_NAME" : "H/O: angina pectoris", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "161504004", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783188, + "CONCEPT_NAME" : "Emergency hospital admission for ischemic heart disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699245006", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4080593, + "CONCEPT_NAME" : "Syphilitic coronary artery disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240567009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108680, + "CONCEPT_NAME" : "Thrombosis of atrium, auricular appendage, and ventricle due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194868001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109910, + "CONCEPT_NAME" : "Ventricular aneurysm due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723858002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 318443, + "CONCEPT_NAME" : "Arteriosclerotic vascular disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "72092001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44809539, + "CONCEPT_NAME" : "H/O acute coronary syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "837091000000100", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Context-dependent" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45766212, + "CONCEPT_NAME" : "Mitral valve regurgitation due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "703326006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37312532, + "CONCEPT_NAME" : "Coronary arteriosclerosis in artery of transplanted heart", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "792842004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1032.json b/tests/cohorts/1032.json new file mode 100644 index 00000000..8d5fb955 --- /dev/null +++ b/tests/cohorts/1032.json @@ -0,0 +1,666 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + { + "DrugExposure" : { + "CodesetId" : 4, + "DrugTypeExclude" : false + } + }, + { + "Measurement" : { + "CodesetId" : 3, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 6.5, + "Op" : "bt", + "Extent" : 30 + }, + "Unit" : [ + { + "CONCEPT_ID" : 8554, + "CONCEPT_NAME" : "percent", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "%", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + { + "Measurement" : { + "CodesetId" : 3, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 48, + "Op" : "bt", + "Extent" : 99 + }, + "Unit" : [ + { + "CONCEPT_ID" : 9579, + "CONCEPT_NAME" : "millimole per mole", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "mmol/mol", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + } + ] + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443238, + "CONCEPT_NAME" : "Diabetic - poor control", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268519009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201820, + "CONCEPT_NAME" : "Diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73211009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442793, + "CONCEPT_NAME" : "Complication due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74627003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4058243, + "CONCEPT_NAME" : "Diabetes mellitus during pregnancy, childbirth and the puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199223000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761051, + "CONCEPT_NAME" : "Complication due to secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138811000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Secondary diabetes mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 3, + "name" : "Hemoglobin A1c (HbA1c) measurements", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 37059902, + "CONCEPT_NAME" : "Hemoglobin A1c/Hemoglobin.total | Blood | Hematology and Cell counts", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP393563-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4184637, + "CONCEPT_NAME" : "Hemoglobin A1c measurement", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43396009", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Blood glucose lowering drugs, excluding insulin", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 21600744, + "CONCEPT_NAME" : "BLOOD GLUCOSE LOWERING DRUGS, EXCL. INSULINS", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "A10B", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "ATC", + "CONCEPT_CLASS_ID" : "ATC 3rd" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "Type 1 Diabetes Mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40484649, + "CONCEPT_NAME" : "Type 1 diabetes mellitus well controlled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444074000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42689695, + "CONCEPT_NAME" : "Eating disorder co-occurrent with diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1067201000000106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765533, + "CONCEPT_NAME" : "Glaucoma due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60981000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531006, + "CONCEPT_NAME" : "Maturity onset diabetes of the young, type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "609562003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765650, + "CONCEPT_NAME" : "Cranial nerve palsy due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82561000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770986, + "CONCEPT_NAME" : "Retinopathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706894000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45768456, + "CONCEPT_NAME" : "Neuropathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706891008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128019, + "CONCEPT_NAME" : "Brittle type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "290002008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "no Type 1 diabetes mellitus diagnosis on or prior to T2DM", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "no secondary diabetes diagnosis on or prior to T2DM", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "has at least one diagnosis of T2DM on or within 365d of index date", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 365, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1033.json b/tests/cohorts/1033.json new file mode 100644 index 00000000..56ff0cf5 --- /dev/null +++ b/tests/cohorts/1033.json @@ -0,0 +1,1119 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 13, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "AT_LEAST", + "Count" : 1, + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 13, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "DrugExposure" : { + "CodesetId" : 15, + "DrugTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 17, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 1, + "Op" : "gt", + "Extent" : 10 + } + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 13, + "name" : "HIV excluding HIV-II ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4276586, + "CONCEPT_NAME" : "Finding of HIV status", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "365866002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4013105, + "CONCEPT_NAME" : "HIV negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "165815009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783356, + "CONCEPT_NAME" : "Human immunodeficiency virus carrier", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699433000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432554, + "CONCEPT_NAME" : "Human immunodeficiency virus II infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79019005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439727, + "CONCEPT_NAME" : "Human immunodeficiency virus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86406008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 15, + "name" : "HIV drugs", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1736971, + "CONCEPT_NAME" : "abacavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "190521", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1789428, + "CONCEPT_NAME" : "Amprenavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "228656", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1727223, + "CONCEPT_NAME" : "Atazanavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "343047", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 964008, + "CONCEPT_NAME" : "bictegravir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1999660", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42874220, + "CONCEPT_NAME" : "cobicistat", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1306284", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1756831, + "CONCEPT_NAME" : "darunavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "460132", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747157, + "CONCEPT_NAME" : "Delavirdine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83816", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1724869, + "CONCEPT_NAME" : "Didanosine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3364", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43560385, + "CONCEPT_NAME" : "dolutegravir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1433868", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35200446, + "CONCEPT_NAME" : "DORAVIRINE", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2055755", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1738135, + "CONCEPT_NAME" : "efavirenz", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195085", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42874212, + "CONCEPT_NAME" : "elvitegravir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1306286", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1703069, + "CONCEPT_NAME" : "emtricitabine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276237", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1717002, + "CONCEPT_NAME" : "enfuvirtide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "139896", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1758536, + "CONCEPT_NAME" : "etravirine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "475969", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1736829, + "CONCEPT_NAME" : "fosamprenavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "358262", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42544019, + "CONCEPT_NAME" : "ibalizumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2043283", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1711523, + "CONCEPT_NAME" : "Indinavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "114289", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1704183, + "CONCEPT_NAME" : "Lamivudine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68244", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1738170, + "CONCEPT_NAME" : "lopinavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195088", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1787101, + "CONCEPT_NAME" : "maraviroc", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "620216", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1715472, + "CONCEPT_NAME" : "Nelfinavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "134527", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1769389, + "CONCEPT_NAME" : "Nevirapine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "53654", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1712889, + "CONCEPT_NAME" : "raltegravir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "719872", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40238930, + "CONCEPT_NAME" : "Rilpivirine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1102270", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1748921, + "CONCEPT_NAME" : "Ritonavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "85762", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1746244, + "CONCEPT_NAME" : "Saquinavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83395", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1781406, + "CONCEPT_NAME" : "Stavudine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59763", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1710281, + "CONCEPT_NAME" : "tenofovir disoproxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "300195", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1736999, + "CONCEPT_NAME" : "tipranavir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "190548", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1724827, + "CONCEPT_NAME" : "Zalcitabine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3363", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1710612, + "CONCEPT_NAME" : "Zidovudine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11413", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 17, + "name" : "HIV Screening Test", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2212882, + "CONCEPT_NAME" : "Antibody; HIV-1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86701", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2212884, + "CONCEPT_NAME" : "Antibody; HIV-1 and HIV-2, single result", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86703", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2212876, + "CONCEPT_NAME" : "Antibody; HTLV or HIV antibody, confirmatory test (eg, Western Blot)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86689", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40792567, + "CONCEPT_NAME" : "HIV", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP17126-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40792354, + "CONCEPT_NAME" : "HIV 1", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP14307-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42529218, + "CONCEPT_NAME" : "HIV 1+2 Ab and HIV1 p24 Ag panel - Serum or Plasma by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83101-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4038851, + "CONCEPT_NAME" : "HIV 1 DNA assay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "117748001", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40762145, + "CONCEPT_NAME" : "HIV 1+Hepatitis C virus RNA+Hepatitis B virus DNA [Presence] in Serum or Plasma by NAA with probe detection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59052-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21491519, + "CONCEPT_NAME" : "HIV 1 proviral DNA integrase gene mutations detected [Identifier] in Blood mononuclear cells by Sequencing", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80691-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21493662, + "CONCEPT_NAME" : "HIV 1 proviral DNA reverse transcriptase and protease and integrase gene mutations detected [Identifier] in Blood mononuclear cells by Sequencing", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80693-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21491520, + "CONCEPT_NAME" : "HIV 1 proviral DNA reverse transcriptase and protease gene mutations detected [Identifier] in Blood mononuclear cells by Sequencing", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80692-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21491518, + "CONCEPT_NAME" : "HIV 1 proviral DNA tropism [Identifier] in Blood mononuclear cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80690-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3030461, + "CONCEPT_NAME" : "HIV 1 RNA panel (viral load) in Cerebral spinal fluid by NAA with probe detection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50624-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21491517, + "CONCEPT_NAME" : "HIV 1 RNA reverse transcriptase and protease and integrase gene mutations detected [Identifier] in Plasma by Sequencing", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80689-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3044830, + "CONCEPT_NAME" : "HIV protease gene mutations detected [Identifier]", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "33630-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2213092, + "CONCEPT_NAME" : "Infectious agent antigen detection by immunoassay technique, (eg, enzyme immunoassay [EIA], enzyme-linked immunosorbent assay [ELISA], immunochemiluminometric assay [IMCA]) qualitative or semiquantitative, multiple-step method; HIV-1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87390", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42742380, + "CONCEPT_NAME" : "Infectious agent antigen detection by immunoassay technique, (eg, enzyme immunoassay [EIA], enzyme-linked immunosorbent assay [ELISA], immunochemiluminometric assay [IMCA]) qualitative or semiquantitative, multiple-step method; HIV-1 antigen(s), with HIV-", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87389", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2213141, + "CONCEPT_NAME" : "Infectious agent detection by nucleic acid (DNA or RNA); HIV-1, amplified probe technique, includes reverse transcription when performed", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87535", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2213140, + "CONCEPT_NAME" : "Infectious agent detection by nucleic acid (DNA or RNA); HIV-1, direct probe technique", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87534", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2213142, + "CONCEPT_NAME" : "Infectious agent detection by nucleic acid (DNA or RNA); HIV-1, quantification, includes reverse transcription when performed", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87536", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1034.json b/tests/cohorts/1034.json new file mode 100644 index 00000000..c4c3a314 --- /dev/null +++ b/tests/cohorts/1034.json @@ -0,0 +1,105 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Respiratory syncytial virus infection", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 437222, + "CONCEPT_NAME" : "Respiratory syncytial virus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55735004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "30 day clean window", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false, + "CountColumn" : "DOMAIN_CONCEPT" + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 30 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1035.json b/tests/cohorts/1035.json new file mode 100644 index 00000000..db27001a --- /dev/null +++ b/tests/cohorts/1035.json @@ -0,0 +1,119 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 0, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "[HowOften] Thiazide or thiazide-like diuretics", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1395058, + "CONCEPT_NAME" : "chlorthalidone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2409", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 974166, + "CONCEPT_NAME" : "hydrochlorothiazide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5487", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 978555, + "CONCEPT_NAME" : "indapamide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5764", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 907013, + "CONCEPT_NAME" : "metolazone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6916", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 0, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1036.json b/tests/cohorts/1036.json new file mode 100644 index 00000000..6e54b6a2 --- /dev/null +++ b/tests/cohorts/1036.json @@ -0,0 +1,255 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 2, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "[HowOften] Beta blockers", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1319998, + "CONCEPT_NAME" : "acebutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "149", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314002, + "CONCEPT_NAME" : "atenolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1322081, + "CONCEPT_NAME" : "betaxolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1520", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1338005, + "CONCEPT_NAME" : "bisoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19484", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1346823, + "CONCEPT_NAME" : "carvedilol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20352", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1386957, + "CONCEPT_NAME" : "labetalol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6185", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1307046, + "CONCEPT_NAME" : "metoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6918", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1313200, + "CONCEPT_NAME" : "nadolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7226", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314577, + "CONCEPT_NAME" : "nebivolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1327978, + "CONCEPT_NAME" : "penbutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7973", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1345858, + "CONCEPT_NAME" : "pindolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8332", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1353766, + "CONCEPT_NAME" : "propranolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8787", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 2, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1037.json b/tests/cohorts/1037.json new file mode 100644 index 00000000..7a0fd3b7 --- /dev/null +++ b/tests/cohorts/1037.json @@ -0,0 +1,119 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 3, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 3, + "name" : "[HowOften] SGLT2 inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 793293, + "CONCEPT_NAME" : "ertugliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1992672", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43526465, + "CONCEPT_NAME" : "canagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1373458", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44785829, + "CONCEPT_NAME" : "dapagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1488564", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45774751, + "CONCEPT_NAME" : "empagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1545653", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 3, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1038.json b/tests/cohorts/1038.json new file mode 100644 index 00000000..28043894 --- /dev/null +++ b/tests/cohorts/1038.json @@ -0,0 +1,153 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 4, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 4, + "name" : "[HowOften] GLP-1 receptor antagonists", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 45774435, + "CONCEPT_NAME" : "dulaglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1551291", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44816332, + "CONCEPT_NAME" : "albiglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1534763", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40170911, + "CONCEPT_NAME" : "liraglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "475968", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 793143, + "CONCEPT_NAME" : "semaglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1991302", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1583722, + "CONCEPT_NAME" : "exenatide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60548", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44506754, + "CONCEPT_NAME" : "lixisenatide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1440051", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 4, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1039.json b/tests/cohorts/1039.json new file mode 100644 index 00000000..fc7cf983 --- /dev/null +++ b/tests/cohorts/1039.json @@ -0,0 +1,136 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 5, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 5, + "name" : "[HowOften] DPP4 Inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40166035, + "CONCEPT_NAME" : "saxagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "857974", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40239216, + "CONCEPT_NAME" : "linagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1100699", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43013884, + "CONCEPT_NAME" : "alogliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1368001", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19122137, + "CONCEPT_NAME" : "vildagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "596554", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1580747, + "CONCEPT_NAME" : "sitagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "593411", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 5, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1040.json b/tests/cohorts/1040.json new file mode 100644 index 00000000..3390e147 --- /dev/null +++ b/tests/cohorts/1040.json @@ -0,0 +1,136 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 6, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[HowOften] TNF inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 19041065, + "CONCEPT_NAME" : "golimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819300", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 912263, + "CONCEPT_NAME" : "certolizumab pegol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "709271", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 937368, + "CONCEPT_NAME" : "infliximab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191831", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1151789, + "CONCEPT_NAME" : "etanercept", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "214555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1119119, + "CONCEPT_NAME" : "adalimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "327361", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 6, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1041.json b/tests/cohorts/1041.json new file mode 100644 index 00000000..b76661d7 --- /dev/null +++ b/tests/cohorts/1041.json @@ -0,0 +1,102 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 7, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 7, + "name" : "[HowOften] JAK inhibitor", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1510627, + "CONCEPT_NAME" : "baricitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2047232", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40244464, + "CONCEPT_NAME" : "ruxolitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1193326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42904205, + "CONCEPT_NAME" : "tofacitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1357536", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 7, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1042.json b/tests/cohorts/1042.json new file mode 100644 index 00000000..2d443ea2 --- /dev/null +++ b/tests/cohorts/1042.json @@ -0,0 +1,102 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 8, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 8, + "name" : "[HowOften] IL23 inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 35200139, + "CONCEPT_NAME" : "tildrakizumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2053436", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1511348, + "CONCEPT_NAME" : "risankizumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2166040", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1593700, + "CONCEPT_NAME" : "guselkumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1928588", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 8, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1043.json b/tests/cohorts/1043.json new file mode 100644 index 00000000..3481998d --- /dev/null +++ b/tests/cohorts/1043.json @@ -0,0 +1,1190 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 9, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 9, + "name" : "[HowOften] fluoroquinolone systemic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1721543, + "CONCEPT_NAME" : "norfloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7517", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198003, + "CONCEPT_NAME" : "pazufloxacin mesilate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819368", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747032, + "CONCEPT_NAME" : "grepafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83719", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19041153, + "CONCEPT_NAME" : "temafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "37771", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1592954, + "CONCEPT_NAME" : "delafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1927663", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1716721, + "CONCEPT_NAME" : "gemifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138099", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 923081, + "CONCEPT_NAME" : "ofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7623", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19050750, + "CONCEPT_NAME" : "fleroxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42322", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1712549, + "CONCEPT_NAME" : "trovafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "115552", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35197938, + "CONCEPT_NAME" : "garenoxacin mesilate hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819303", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36878831, + "CONCEPT_NAME" : "nadifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP1007304", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40161662, + "CONCEPT_NAME" : "besifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819911", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009030, + "CONCEPT_NAME" : "tosufloxacin tosylate hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700456", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1743222, + "CONCEPT_NAME" : "enoxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3925", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35834909, + "CONCEPT_NAME" : "lascufloxacin hydrochloride", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5040502", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198165, + "CONCEPT_NAME" : "sitafloxacin hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819530", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1789276, + "CONCEPT_NAME" : "gatifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "228476", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1797513, + "CONCEPT_NAME" : "ciprofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2551", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1742253, + "CONCEPT_NAME" : "levofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82122", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1716903, + "CONCEPT_NAME" : "moxifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "139462", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35197897, + "CONCEPT_NAME" : "prulifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819262", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19027679, + "CONCEPT_NAME" : "pefloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7960", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1733765, + "CONCEPT_NAME" : "sparfloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18469", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1707800, + "CONCEPT_NAME" : "lomefloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28872", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42613186, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5160363", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2909524, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5126291", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40161667, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "850304", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028718, + "CONCEPT_NAME" : "ciprofloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376483", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028720, + "CONCEPT_NAME" : "ciprofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860696, + "CONCEPT_NAME" : "enoxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017123", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35858962, + "CONCEPT_NAME" : "gatifloxacin Ophthalmic Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5015272", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40059607, + "CONCEPT_NAME" : "gatifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402433", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35861002, + "CONCEPT_NAME" : "levofloxacin Ophthalmic Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017598", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40001157, + "CONCEPT_NAME" : "levofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376884", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40059318, + "CONCEPT_NAME" : "lomefloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372629", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40057467, + "CONCEPT_NAME" : "moxifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406106", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40066892, + "CONCEPT_NAME" : "norfloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376519", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40066893, + "CONCEPT_NAME" : "norfloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377401", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43695029, + "CONCEPT_NAME" : "Ofloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP672324", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40069651, + "CONCEPT_NAME" : "ofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377402", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851732, + "CONCEPT_NAME" : "pazufloxacin mesilate Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5008335", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42961482, + "CONCEPT_NAME" : "tosufloxacin tosylate hydrate Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4687978", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42479725, + "CONCEPT_NAME" : "Ciprofloxacin / Dexamethasone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP419326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028359, + "CONCEPT_NAME" : "ciprofloxacin / dexamethasone Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "405942", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42629035, + "CONCEPT_NAME" : "ciprofloxacin / fluocinolone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1792384", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43258666, + "CONCEPT_NAME" : "Ciprofloxacin / Hydrocortisone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP572540", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028361, + "CONCEPT_NAME" : "ciprofloxacin / hydrocortisone Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374589", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40160496, + "CONCEPT_NAME" : "ciprofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "848955", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35605255, + "CONCEPT_NAME" : "ciprofloxacin Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1739996", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860990, + "CONCEPT_NAME" : "levofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017586", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35144130, + "CONCEPT_NAME" : "lomefloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4801876", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40069655, + "CONCEPT_NAME" : "ofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377450", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42965658, + "CONCEPT_NAME" : "Ciprofloxacin / fluocinolone Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4692126", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36269500, + "CONCEPT_NAME" : "Ciprofloxacin Mucous Membrane Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP3120375", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35857832, + "CONCEPT_NAME" : "ciprofloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5014782", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35857838, + "CONCEPT_NAME" : "ciprofloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5014788", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860698, + "CONCEPT_NAME" : "enoxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017125", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35862078, + "CONCEPT_NAME" : "lomefloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018791", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35862084, + "CONCEPT_NAME" : "lomefloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018797", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2052955, + "CONCEPT_NAME" : "lomefloxacin Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4953477", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43678347, + "CONCEPT_NAME" : "nadifloxacin Topical Cream", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP692663", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35154779, + "CONCEPT_NAME" : "nadifloxacin Topical Lotion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4811800", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35141912, + "CONCEPT_NAME" : "nadifloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4799033", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35861725, + "CONCEPT_NAME" : "norfloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018416", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851383, + "CONCEPT_NAME" : "ofloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5007927", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851392, + "CONCEPT_NAME" : "ofloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5007936", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35856292, + "CONCEPT_NAME" : "pefloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5012825", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 9, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1044.json b/tests/cohorts/1044.json new file mode 100644 index 00000000..eed4b2f4 --- /dev/null +++ b/tests/cohorts/1044.json @@ -0,0 +1,884 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 10, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 10, + "name" : "[HowOften] cephalosporin systematic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40798709, + "CONCEPT_NAME" : "Cefacetrile", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721059", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1796435, + "CONCEPT_NAME" : "cefixime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25033", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40798704, + "CONCEPT_NAME" : "Cefmenoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721061", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19072255, + "CONCEPT_NAME" : "cefmetazole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2182", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43008993, + "CONCEPT_NAME" : "cefminox sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700419", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028286, + "CONCEPT_NAME" : "cefodizime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20485", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19072857, + "CONCEPT_NAME" : "cefonicid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2183", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1773402, + "CONCEPT_NAME" : "cefoperazone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2184", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028288, + "CONCEPT_NAME" : "ceforanide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20486", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1774470, + "CONCEPT_NAME" : "cefotaxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2186", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1774932, + "CONCEPT_NAME" : "cefotetan", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2187", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19051271, + "CONCEPT_NAME" : "cefotiam", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2188", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1775741, + "CONCEPT_NAME" : "cefoxitin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2189", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009045, + "CONCEPT_NAME" : "cefpiramide sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700471", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1749008, + "CONCEPT_NAME" : "cefpodoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20489", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1738366, + "CONCEPT_NAME" : "cefprozil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19552", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009083, + "CONCEPT_NAME" : "cefroxadine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700509", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19051345, + "CONCEPT_NAME" : "cefsulodin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2190", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1776684, + "CONCEPT_NAME" : "ceftazidime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2191", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198137, + "CONCEPT_NAME" : "cefteram pivoxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819502", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43008994, + "CONCEPT_NAME" : "ceftezole sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700420", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1749083, + "CONCEPT_NAME" : "ceftibuten", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20492", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1777254, + "CONCEPT_NAME" : "ceftizoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2192", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1777806, + "CONCEPT_NAME" : "ceftriaxone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2193", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1778162, + "CONCEPT_NAME" : "cefuroxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2194", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1786621, + "CONCEPT_NAME" : "cephalexin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2231", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19052683, + "CONCEPT_NAME" : "cephaloridine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2233", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19086759, + "CONCEPT_NAME" : "cephalothin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2236", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19086790, + "CONCEPT_NAME" : "cephapirin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2238", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1786842, + "CONCEPT_NAME" : "cephradine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2239", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009087, + "CONCEPT_NAME" : "flomoxef sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700513", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1708100, + "CONCEPT_NAME" : "loracarbef", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28981", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19126622, + "CONCEPT_NAME" : "moxalactam", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7069", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1768849, + "CONCEPT_NAME" : "cefaclor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2176", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1769535, + "CONCEPT_NAME" : "cefadroxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2177", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19070174, + "CONCEPT_NAME" : "cefamandole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2178", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19070680, + "CONCEPT_NAME" : "cefatrizine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2179", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40798700, + "CONCEPT_NAME" : "Cefazedone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721060", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1771162, + "CONCEPT_NAME" : "cefazolin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2180", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009082, + "CONCEPT_NAME" : "cefbuperazone sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700508", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009044, + "CONCEPT_NAME" : "cefcapene pivoxil hydrochloride hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700470", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1796458, + "CONCEPT_NAME" : "cefdinir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25037", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747005, + "CONCEPT_NAME" : "cefditoren", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83682", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028241, + "CONCEPT_NAME" : "cefetamet", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20482", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35129269, + "CONCEPT_NAME" : "Cefmenoxime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4786537", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35160132, + "CONCEPT_NAME" : "Cefmenoxime Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4817111", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2035392, + "CONCEPT_NAME" : "Cefmenoxime Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4934549", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21132307, + "CONCEPT_NAME" : "Ceftazidime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP388743", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40020954, + "CONCEPT_NAME" : "cefuroxime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377415", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 10, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1045.json b/tests/cohorts/1045.json new file mode 100644 index 00000000..1940c5d1 --- /dev/null +++ b/tests/cohorts/1045.json @@ -0,0 +1,238 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 11, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 11, + "name" : "[HowOften] Trimethoprim systemetic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40081374, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Injectable Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377117", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36882762, + "CONCEPT_NAME" : "Sulfamethoxazole / Trimethoprim Injectable Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP994039", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40220482, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Injection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1809082", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35153537, + "CONCEPT_NAME" : "Sulfamethoxazole / Trimethoprim Oral Granules", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4810565", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40147374, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "757319", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40081379, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374233", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40081388, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Tablet", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374234", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1705674, + "CONCEPT_NAME" : "trimethoprim", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10829", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40073114, + "CONCEPT_NAME" : "polymyxin B / trimethoprim Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376523", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40073115, + "CONCEPT_NAME" : "polymyxin B / trimethoprim Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "379128", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40180925, + "CONCEPT_NAME" : "sulfamethazine / trimethoprim Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "991879", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 11, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1046.json b/tests/cohorts/1046.json new file mode 100644 index 00000000..9697c9a3 --- /dev/null +++ b/tests/cohorts/1046.json @@ -0,0 +1,198 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 0, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "[HowOften] Thiazide or thiazide-like diuretics", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1395058, + "CONCEPT_NAME" : "chlorthalidone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2409", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 974166, + "CONCEPT_NAME" : "hydrochlorothiazide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5487", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 978555, + "CONCEPT_NAME" : "indapamide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5764", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 907013, + "CONCEPT_NAME" : "metolazone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6916", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 1, + "name" : "Essential hypertension", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 320128, + "CONCEPT_NAME" : "Essential hypertension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59621000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 316866, + "CONCEPT_NAME" : "Hypertensive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38341003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in essential hypertension", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 1, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 0, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1047.json b/tests/cohorts/1047.json new file mode 100644 index 00000000..0398d446 --- /dev/null +++ b/tests/cohorts/1047.json @@ -0,0 +1,232 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 1, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "[HowOften] Dihydropyridine calcium channel blockers (dCCB)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1332418, + "CONCEPT_NAME" : "amlodipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17767", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1353776, + "CONCEPT_NAME" : "felodipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4316", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1326012, + "CONCEPT_NAME" : "isradipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "33910", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1318137, + "CONCEPT_NAME" : "nicardipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7396", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1318853, + "CONCEPT_NAME" : "nifedipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7417", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1319880, + "CONCEPT_NAME" : "nisoldipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7435", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Essential hypertension", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 320128, + "CONCEPT_NAME" : "Essential hypertension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59621000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 316866, + "CONCEPT_NAME" : "Hypertensive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38341003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in essential hypertension", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 1, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1048.json b/tests/cohorts/1048.json new file mode 100644 index 00000000..7b6164e4 --- /dev/null +++ b/tests/cohorts/1048.json @@ -0,0 +1,153 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 1, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "[HowOften] Dihydropyridine calcium channel blockers (dCCB)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1332418, + "CONCEPT_NAME" : "amlodipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17767", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1353776, + "CONCEPT_NAME" : "felodipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4316", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1326012, + "CONCEPT_NAME" : "isradipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "33910", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1318137, + "CONCEPT_NAME" : "nicardipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7396", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1318853, + "CONCEPT_NAME" : "nifedipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7417", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1319880, + "CONCEPT_NAME" : "nisoldipine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7435", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 1, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1049.json b/tests/cohorts/1049.json new file mode 100644 index 00000000..14ed8591 --- /dev/null +++ b/tests/cohorts/1049.json @@ -0,0 +1,334 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 2, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "[HowOften] Beta blockers", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1319998, + "CONCEPT_NAME" : "acebutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "149", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314002, + "CONCEPT_NAME" : "atenolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1322081, + "CONCEPT_NAME" : "betaxolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1520", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1338005, + "CONCEPT_NAME" : "bisoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19484", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1346823, + "CONCEPT_NAME" : "carvedilol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20352", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1386957, + "CONCEPT_NAME" : "labetalol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6185", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1307046, + "CONCEPT_NAME" : "metoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6918", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1313200, + "CONCEPT_NAME" : "nadolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7226", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314577, + "CONCEPT_NAME" : "nebivolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1327978, + "CONCEPT_NAME" : "penbutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7973", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1345858, + "CONCEPT_NAME" : "pindolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8332", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1353766, + "CONCEPT_NAME" : "propranolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8787", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 3, + "name" : "Essential hypertension", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 320128, + "CONCEPT_NAME" : "Essential hypertension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59621000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 316866, + "CONCEPT_NAME" : "Hypertensive disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38341003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in essential hypertension", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 2, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1050.json b/tests/cohorts/1050.json new file mode 100644 index 00000000..8fdc9a35 --- /dev/null +++ b/tests/cohorts/1050.json @@ -0,0 +1,589 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 2, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "[HowOften] Beta blockers", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1319998, + "CONCEPT_NAME" : "acebutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "149", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314002, + "CONCEPT_NAME" : "atenolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1322081, + "CONCEPT_NAME" : "betaxolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1520", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1338005, + "CONCEPT_NAME" : "bisoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19484", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1346823, + "CONCEPT_NAME" : "carvedilol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20352", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1386957, + "CONCEPT_NAME" : "labetalol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6185", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1307046, + "CONCEPT_NAME" : "metoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6918", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1313200, + "CONCEPT_NAME" : "nadolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7226", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314577, + "CONCEPT_NAME" : "nebivolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1327978, + "CONCEPT_NAME" : "penbutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7973", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1345858, + "CONCEPT_NAME" : "pindolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8332", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1353766, + "CONCEPT_NAME" : "propranolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8787", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Left Heart Failure", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 442310, + "CONCEPT_NAME" : "Acute heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56675007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195785, + "CONCEPT_NAME" : "Right heart failure secondary to left heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44313006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444031, + "CONCEPT_NAME" : "Chronic heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48447003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443587, + "CONCEPT_NAME" : "Diastolic heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "418304008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439846, + "CONCEPT_NAME" : "Left heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "85232009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443580, + "CONCEPT_NAME" : "Systolic heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417996009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444101, + "CONCEPT_NAME" : "Hypertensive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46113002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 319835, + "CONCEPT_NAME" : "Congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42343007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43020910, + "CONCEPT_NAME" : "Pulmonary hypertension due to left heart disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "472790001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37309625, + "CONCEPT_NAME" : "Acute on chronic right-sided congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16838951000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4215446, + "CONCEPT_NAME" : "Acute right-sided congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80479009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4233424, + "CONCEPT_NAME" : "Acute right-sided heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359617009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4284562, + "CONCEPT_NAME" : "Chronic right-sided congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "66989003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4014159, + "CONCEPT_NAME" : "Chronic right-sided heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10335000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782713, + "CONCEPT_NAME" : "Congestive heart failure with right heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23341000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 312927, + "CONCEPT_NAME" : "Acute cor pulmonale", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49584005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 608954, + "CONCEPT_NAME" : "Acute cor pulmonale due to septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15964661000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Left Heart Failure", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 2, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1051.json b/tests/cohorts/1051.json new file mode 100644 index 00000000..58071717 --- /dev/null +++ b/tests/cohorts/1051.json @@ -0,0 +1,453 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 3, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 3, + "name" : "[HowOften] SGLT2 inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 793293, + "CONCEPT_NAME" : "ertugliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1992672", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43526465, + "CONCEPT_NAME" : "canagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1373458", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44785829, + "CONCEPT_NAME" : "dapagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1488564", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45774751, + "CONCEPT_NAME" : "empagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1545653", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Left Heart Failure", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 442310, + "CONCEPT_NAME" : "Acute heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56675007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195785, + "CONCEPT_NAME" : "Right heart failure secondary to left heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44313006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444031, + "CONCEPT_NAME" : "Chronic heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48447003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443587, + "CONCEPT_NAME" : "Diastolic heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "418304008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439846, + "CONCEPT_NAME" : "Left heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "85232009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443580, + "CONCEPT_NAME" : "Systolic heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417996009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444101, + "CONCEPT_NAME" : "Hypertensive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46113002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 319835, + "CONCEPT_NAME" : "Congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42343007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43020910, + "CONCEPT_NAME" : "Pulmonary hypertension due to left heart disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "472790001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37309625, + "CONCEPT_NAME" : "Acute on chronic right-sided congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16838951000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4215446, + "CONCEPT_NAME" : "Acute right-sided congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80479009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4233424, + "CONCEPT_NAME" : "Acute right-sided heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359617009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4284562, + "CONCEPT_NAME" : "Chronic right-sided congestive heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "66989003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4014159, + "CONCEPT_NAME" : "Chronic right-sided heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10335000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782713, + "CONCEPT_NAME" : "Congestive heart failure with right heart failure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23341000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 312927, + "CONCEPT_NAME" : "Acute cor pulmonale", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49584005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 608954, + "CONCEPT_NAME" : "Acute cor pulmonale due to septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15964661000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Left Heart Failure", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 3, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1052.json b/tests/cohorts/1052.json new file mode 100644 index 00000000..73f2c39b --- /dev/null +++ b/tests/cohorts/1052.json @@ -0,0 +1,438 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 2, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "[HowOften] Beta blockers", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1319998, + "CONCEPT_NAME" : "acebutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "149", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314002, + "CONCEPT_NAME" : "atenolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1322081, + "CONCEPT_NAME" : "betaxolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1520", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1338005, + "CONCEPT_NAME" : "bisoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19484", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1346823, + "CONCEPT_NAME" : "carvedilol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20352", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1386957, + "CONCEPT_NAME" : "labetalol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6185", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1307046, + "CONCEPT_NAME" : "metoprolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6918", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1313200, + "CONCEPT_NAME" : "nadolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7226", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1314577, + "CONCEPT_NAME" : "nebivolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1327978, + "CONCEPT_NAME" : "penbutolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7973", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1345858, + "CONCEPT_NAME" : "pindolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8332", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1353766, + "CONCEPT_NAME" : "propranolol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8787", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "[HowOften] Acute myocardial Infarction", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4329847, + "CONCEPT_NAME" : "Myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22298006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 314666, + "CONCEPT_NAME" : "Old myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1755008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 6, + "name" : "[HowOften] Inpatient or ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Acute myocardial infarction", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 6, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 2, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1053.json b/tests/cohorts/1053.json new file mode 100644 index 00000000..9bf1b2b1 --- /dev/null +++ b/tests/cohorts/1053.json @@ -0,0 +1,647 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 4, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 4, + "name" : "[HowOften] GLP-1 receptor antagonists", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 45774435, + "CONCEPT_NAME" : "dulaglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1551291", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44816332, + "CONCEPT_NAME" : "albiglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1534763", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40170911, + "CONCEPT_NAME" : "liraglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "475968", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 793143, + "CONCEPT_NAME" : "semaglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1991302", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1583722, + "CONCEPT_NAME" : "exenatide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60548", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44506754, + "CONCEPT_NAME" : "lixisenatide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1440051", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443238, + "CONCEPT_NAME" : "Diabetic - poor control", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268519009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201820, + "CONCEPT_NAME" : "Diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73211009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442793, + "CONCEPT_NAME" : "Complication due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74627003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4058243, + "CONCEPT_NAME" : "Diabetes mellitus during pregnancy, childbirth and the puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199223000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761051, + "CONCEPT_NAME" : "Complication due to secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138811000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 6, + "name" : "[PL] Type 1 Diabetes Mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40484649, + "CONCEPT_NAME" : "Type 1 diabetes mellitus well controlled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444074000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42689695, + "CONCEPT_NAME" : "Eating disorder co-occurrent with diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1067201000000106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765533, + "CONCEPT_NAME" : "Glaucoma due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60981000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531006, + "CONCEPT_NAME" : "Maturity onset diabetes of the young, type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "609562003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765650, + "CONCEPT_NAME" : "Cranial nerve palsy due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "82561000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770986, + "CONCEPT_NAME" : "Retinopathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706894000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45768456, + "CONCEPT_NAME" : "Neuropathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706891008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128019, + "CONCEPT_NAME" : "Brittle type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "290002008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "[PL] Secondary diabetes mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in type 2 diabetes mellitus", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 6, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 4, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1054.json b/tests/cohorts/1054.json new file mode 100644 index 00000000..3e802ab9 --- /dev/null +++ b/tests/cohorts/1054.json @@ -0,0 +1,613 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 3, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 3, + "name" : "[HowOften] SGLT2 inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 793293, + "CONCEPT_NAME" : "ertugliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1992672", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43526465, + "CONCEPT_NAME" : "canagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1373458", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44785829, + "CONCEPT_NAME" : "dapagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1488564", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45774751, + "CONCEPT_NAME" : "empagliflozin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1545653", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443238, + "CONCEPT_NAME" : "Diabetic - poor control", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268519009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201820, + "CONCEPT_NAME" : "Diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73211009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442793, + "CONCEPT_NAME" : "Complication due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74627003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4058243, + "CONCEPT_NAME" : "Diabetes mellitus during pregnancy, childbirth and the puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199223000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761051, + "CONCEPT_NAME" : "Complication due to secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138811000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "[PL] Type 1 Diabetes Mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40484649, + "CONCEPT_NAME" : "Type 1 diabetes mellitus well controlled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444074000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42689695, + "CONCEPT_NAME" : "Eating disorder co-occurrent with diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1067201000000106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765533, + "CONCEPT_NAME" : "Glaucoma due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60981000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531006, + "CONCEPT_NAME" : "Maturity onset diabetes of the young, type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "609562003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765650, + "CONCEPT_NAME" : "Cranial nerve palsy due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "82561000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770986, + "CONCEPT_NAME" : "Retinopathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706894000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45768456, + "CONCEPT_NAME" : "Neuropathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706891008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128019, + "CONCEPT_NAME" : "Brittle type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "290002008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 6, + "name" : "[PL] Secondary diabetes mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Type 2 diabetes mellitus", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 6, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 3, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1055.json b/tests/cohorts/1055.json new file mode 100644 index 00000000..a57ccd25 --- /dev/null +++ b/tests/cohorts/1055.json @@ -0,0 +1,630 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 5, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 5, + "name" : "[HowOften] DPP4 Inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40166035, + "CONCEPT_NAME" : "saxagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "857974", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40239216, + "CONCEPT_NAME" : "linagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1100699", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43013884, + "CONCEPT_NAME" : "alogliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1368001", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19122137, + "CONCEPT_NAME" : "vildagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "596554", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1580747, + "CONCEPT_NAME" : "sitagliptin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "593411", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 6, + "name" : "[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443238, + "CONCEPT_NAME" : "Diabetic - poor control", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268519009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201820, + "CONCEPT_NAME" : "Diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73211009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442793, + "CONCEPT_NAME" : "Complication due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74627003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4058243, + "CONCEPT_NAME" : "Diabetes mellitus during pregnancy, childbirth and the puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199223000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761051, + "CONCEPT_NAME" : "Complication due to secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138811000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "[PL] Type 1 Diabetes Mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40484649, + "CONCEPT_NAME" : "Type 1 diabetes mellitus well controlled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444074000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42689695, + "CONCEPT_NAME" : "Eating disorder co-occurrent with diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1067201000000106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765533, + "CONCEPT_NAME" : "Glaucoma due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60981000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43531006, + "CONCEPT_NAME" : "Maturity onset diabetes of the young, type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "609562003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 765650, + "CONCEPT_NAME" : "Cranial nerve palsy due to diabetes mellitus type 1", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "82561000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770986, + "CONCEPT_NAME" : "Retinopathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706894000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201254, + "CONCEPT_NAME" : "Type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46635009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45768456, + "CONCEPT_NAME" : "Neuropathy due to unstable diabetes mellitus type 1", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "706891008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484648, + "CONCEPT_NAME" : "Type 1 diabetes mellitus uncontrolled", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444073006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128019, + "CONCEPT_NAME" : "Brittle type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "290002008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435216, + "CONCEPT_NAME" : "Disorder due to type 1 diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420868002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 8, + "name" : "[PL] Secondary diabetes mellitus", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 195771, + "CONCEPT_NAME" : "Secondary diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8801005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in type 2 diabetes mellitus", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 6, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 5, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1056.json b/tests/cohorts/1056.json new file mode 100644 index 00000000..d42ef79d --- /dev/null +++ b/tests/cohorts/1056.json @@ -0,0 +1,536 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 4, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 4, + "name" : "[HowOften] GLP-1 receptor antagonists", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 45774435, + "CONCEPT_NAME" : "dulaglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1551291", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44816332, + "CONCEPT_NAME" : "albiglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1534763", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40170911, + "CONCEPT_NAME" : "liraglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "475968", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 793143, + "CONCEPT_NAME" : "semaglutide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1991302", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1583722, + "CONCEPT_NAME" : "exenatide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60548", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44506754, + "CONCEPT_NAME" : "lixisenatide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1440051", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "[PL] Obesity diagnoses", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4215968, + "CONCEPT_NAME" : "Obese", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414915002", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4176962, + "CONCEPT_NAME" : "Obesity associated disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "363247006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 6, + "name" : "[PL] BMI measurement", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 3038553, + "CONCEPT_NAME" : "Body mass index (BMI) [Ratio]", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39156-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36304833, + "CONCEPT_NAME" : "Body mass index (BMI) [Ratio] Estimated", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89270-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "[PL] Body weight", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 3025315, + "CONCEPT_NAME" : "Body weight", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29463-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4099154, + "CONCEPT_NAME" : "Body weight", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27113001", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Observable Entity" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3013762, + "CONCEPT_NAME" : "Body weight Measured", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3141-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3027492, + "CONCEPT_NAME" : "Dry body weight Measured", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8341-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3023166, + "CONCEPT_NAME" : "Body weight Stated", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3142-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4264825, + "CONCEPT_NAME" : "Birth weight", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "364589006", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Observable Entity" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in obesity", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 6, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 30, + "Op" : "bt", + "Extent" : 60 + } + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 7, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 265, + "Op" : "bt", + "Extent" : 440 + }, + "Unit" : [ + { + "CONCEPT_ID" : 8739, + "CONCEPT_NAME" : "pound (US)", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "[lb_us]", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 7, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 120, + "Op" : "bt", + "Extent" : 200 + }, + "Unit" : [ + { + "CONCEPT_ID" : 9529, + "CONCEPT_NAME" : "kilogram", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "kg", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Observation" : { + "CodesetId" : 5, + "ObservationTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 4, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1057.json b/tests/cohorts/1057.json new file mode 100644 index 00000000..6cba7394 --- /dev/null +++ b/tests/cohorts/1057.json @@ -0,0 +1,198 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 8, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 8, + "name" : "[HowOften] IL23 inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 35200139, + "CONCEPT_NAME" : "tildrakizumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2053436", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1511348, + "CONCEPT_NAME" : "risankizumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2166040", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1593700, + "CONCEPT_NAME" : "guselkumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1928588", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 9, + "name" : "Plaque psoriasis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 140168, + "CONCEPT_NAME" : "Psoriasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9014002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4307925, + "CONCEPT_NAME" : "Psoriasis vulgaris", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200975007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4063431, + "CONCEPT_NAME" : "Plaque psoriasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200965009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Plaque psoriasis", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 9, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 8, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1058.json b/tests/cohorts/1058.json new file mode 100644 index 00000000..ee53def0 --- /dev/null +++ b/tests/cohorts/1058.json @@ -0,0 +1,232 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 6, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[HowOften] TNF inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 19041065, + "CONCEPT_NAME" : "golimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819300", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 912263, + "CONCEPT_NAME" : "certolizumab pegol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "709271", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 937368, + "CONCEPT_NAME" : "infliximab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191831", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1151789, + "CONCEPT_NAME" : "etanercept", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "214555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1119119, + "CONCEPT_NAME" : "adalimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "327361", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "Plaque psoriasis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 140168, + "CONCEPT_NAME" : "Psoriasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9014002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4307925, + "CONCEPT_NAME" : "Psoriasis vulgaris", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200975007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4063431, + "CONCEPT_NAME" : "Plaque psoriasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200965009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Plaque psoriasis", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 6, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1059.json b/tests/cohorts/1059.json new file mode 100644 index 00000000..5f3c809c --- /dev/null +++ b/tests/cohorts/1059.json @@ -0,0 +1,495 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 6, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[HowOften] TNF inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 19041065, + "CONCEPT_NAME" : "golimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819300", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 912263, + "CONCEPT_NAME" : "certolizumab pegol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "709271", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 937368, + "CONCEPT_NAME" : "infliximab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191831", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1151789, + "CONCEPT_NAME" : "etanercept", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "214555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1119119, + "CONCEPT_NAME" : "adalimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "327361", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "Psoriatic arthritis (exclude mutilans)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 81931, + "CONCEPT_NAME" : "Psoriasis with arthropathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "33339001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40319772, + "CONCEPT_NAME" : "Psoriatic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "156370009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4025831, + "CONCEPT_NAME" : "Arthritis mutilans", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19514005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 8, + "name" : "Psoriasis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 140168, + "CONCEPT_NAME" : "Psoriasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9014002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 9, + "name" : "Arthropathy", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 80809, + "CONCEPT_NAME" : "Rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69896004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81097, + "CONCEPT_NAME" : "Felty's syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57160007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 72714, + "CONCEPT_NAME" : "Chronic polyarticular juvenile rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1961000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 75621, + "CONCEPT_NAME" : "Acute polyarticular juvenile rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75822003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 72705, + "CONCEPT_NAME" : "Pauciarticular juvenile rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74391003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 75622, + "CONCEPT_NAME" : "Monarticular juvenile rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "201799006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 75897, + "CONCEPT_NAME" : "Polyarthropathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36186002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 79903, + "CONCEPT_NAME" : "Effusion of joint", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "387637008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4153359, + "CONCEPT_NAME" : "Arthritis of spine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371082009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437082, + "CONCEPT_NAME" : "Ankylosing spondylitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9631008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Psoriatic Arthritis", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 60, + "Coeff" : -1 + }, + "End" : { + "Days" : 60, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 9, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 6, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1060.json b/tests/cohorts/1060.json new file mode 100644 index 00000000..cf2ea911 --- /dev/null +++ b/tests/cohorts/1060.json @@ -0,0 +1,1831 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 9, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 9, + "name" : "[HowOften] fluoroquinolone systemic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1721543, + "CONCEPT_NAME" : "norfloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7517", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198003, + "CONCEPT_NAME" : "pazufloxacin mesilate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819368", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747032, + "CONCEPT_NAME" : "grepafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83719", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19041153, + "CONCEPT_NAME" : "temafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "37771", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1592954, + "CONCEPT_NAME" : "delafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1927663", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1716721, + "CONCEPT_NAME" : "gemifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138099", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 923081, + "CONCEPT_NAME" : "ofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7623", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19050750, + "CONCEPT_NAME" : "fleroxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42322", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1712549, + "CONCEPT_NAME" : "trovafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "115552", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35197938, + "CONCEPT_NAME" : "garenoxacin mesilate hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819303", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36878831, + "CONCEPT_NAME" : "nadifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP1007304", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40161662, + "CONCEPT_NAME" : "besifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819911", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009030, + "CONCEPT_NAME" : "tosufloxacin tosylate hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700456", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1743222, + "CONCEPT_NAME" : "enoxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3925", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35834909, + "CONCEPT_NAME" : "lascufloxacin hydrochloride", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5040502", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198165, + "CONCEPT_NAME" : "sitafloxacin hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819530", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1789276, + "CONCEPT_NAME" : "gatifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "228476", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1797513, + "CONCEPT_NAME" : "ciprofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2551", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1742253, + "CONCEPT_NAME" : "levofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82122", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1716903, + "CONCEPT_NAME" : "moxifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "139462", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35197897, + "CONCEPT_NAME" : "prulifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819262", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19027679, + "CONCEPT_NAME" : "pefloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7960", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1733765, + "CONCEPT_NAME" : "sparfloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18469", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1707800, + "CONCEPT_NAME" : "lomefloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28872", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42613186, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5160363", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2909524, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5126291", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40161667, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "850304", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028718, + "CONCEPT_NAME" : "ciprofloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376483", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028720, + "CONCEPT_NAME" : "ciprofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860696, + "CONCEPT_NAME" : "enoxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017123", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35858962, + "CONCEPT_NAME" : "gatifloxacin Ophthalmic Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5015272", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40059607, + "CONCEPT_NAME" : "gatifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402433", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35861002, + "CONCEPT_NAME" : "levofloxacin Ophthalmic Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017598", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40001157, + "CONCEPT_NAME" : "levofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376884", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40059318, + "CONCEPT_NAME" : "lomefloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372629", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40057467, + "CONCEPT_NAME" : "moxifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406106", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40066892, + "CONCEPT_NAME" : "norfloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376519", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40066893, + "CONCEPT_NAME" : "norfloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377401", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43695029, + "CONCEPT_NAME" : "Ofloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP672324", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40069651, + "CONCEPT_NAME" : "ofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377402", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851732, + "CONCEPT_NAME" : "pazufloxacin mesilate Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5008335", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42961482, + "CONCEPT_NAME" : "tosufloxacin tosylate hydrate Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4687978", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42479725, + "CONCEPT_NAME" : "Ciprofloxacin / Dexamethasone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP419326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028359, + "CONCEPT_NAME" : "ciprofloxacin / dexamethasone Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "405942", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42629035, + "CONCEPT_NAME" : "ciprofloxacin / fluocinolone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1792384", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43258666, + "CONCEPT_NAME" : "Ciprofloxacin / Hydrocortisone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP572540", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028361, + "CONCEPT_NAME" : "ciprofloxacin / hydrocortisone Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374589", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40160496, + "CONCEPT_NAME" : "ciprofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "848955", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35605255, + "CONCEPT_NAME" : "ciprofloxacin Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1739996", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860990, + "CONCEPT_NAME" : "levofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017586", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35144130, + "CONCEPT_NAME" : "lomefloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4801876", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40069655, + "CONCEPT_NAME" : "ofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377450", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42965658, + "CONCEPT_NAME" : "Ciprofloxacin / fluocinolone Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4692126", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36269500, + "CONCEPT_NAME" : "Ciprofloxacin Mucous Membrane Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP3120375", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35857832, + "CONCEPT_NAME" : "ciprofloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5014782", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35857838, + "CONCEPT_NAME" : "ciprofloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5014788", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860698, + "CONCEPT_NAME" : "enoxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017125", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35862078, + "CONCEPT_NAME" : "lomefloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018791", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35862084, + "CONCEPT_NAME" : "lomefloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018797", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2052955, + "CONCEPT_NAME" : "lomefloxacin Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4953477", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43678347, + "CONCEPT_NAME" : "nadifloxacin Topical Cream", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP692663", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35154779, + "CONCEPT_NAME" : "nadifloxacin Topical Lotion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4811800", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35141912, + "CONCEPT_NAME" : "nadifloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4799033", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35861725, + "CONCEPT_NAME" : "norfloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018416", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851383, + "CONCEPT_NAME" : "ofloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5007927", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851392, + "CONCEPT_NAME" : "ofloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5007936", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35856292, + "CONCEPT_NAME" : "pefloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5012825", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 10, + "name" : "Urinary tract infection", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 81902, + "CONCEPT_NAME" : "Urinary tract infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68566005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4167328, + "CONCEPT_NAME" : "Pyuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4800001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 77340, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267204006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4265485, + "CONCEPT_NAME" : "Bacteriuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61373006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126297, + "CONCEPT_NAME" : "Chronic obstructive pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236379002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195588, + "CONCEPT_NAME" : "Cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38822007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198806, + "CONCEPT_NAME" : "Abscess of prostate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8725005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126267, + "CONCEPT_NAME" : "Chronic radiation cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236629009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194997, + "CONCEPT_NAME" : "Prostatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9713002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4077499, + "CONCEPT_NAME" : "Sterile pyuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "275742001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442345, + "CONCEPT_NAME" : "Syphilis of kidney", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59530001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062493, + "CONCEPT_NAME" : "Mumps nephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17121006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757237, + "CONCEPT_NAME" : "Diphtheria tubulointerstitial nephropathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1086071000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36714969, + "CONCEPT_NAME" : "Asymptomatic bacteriuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "720406004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195743, + "CONCEPT_NAME" : "Diphtheritic cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48278001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201353, + "CONCEPT_NAME" : "Irradiation cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11251000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4047937, + "CONCEPT_NAME" : "Neonatal urinary tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12301009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201792, + "CONCEPT_NAME" : "Nongonococcal urethritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84619001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128384, + "CONCEPT_NAME" : "Non-infective cystitis", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "D", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "236623005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 78357, + "CONCEPT_NAME" : "Reactive arthritis triad", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67224007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195313, + "CONCEPT_NAME" : "Urethral abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67277002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 197919, + "CONCEPT_NAME" : "Urethral stricture due to infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80375002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439349, + "CONCEPT_NAME" : "Cystitis associated with another disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197845000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4227291, + "CONCEPT_NAME" : "Hemorrhagic cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87696004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4060312, + "CONCEPT_NAME" : "Infections of urethra in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199206009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127564, + "CONCEPT_NAME" : "Acute cystitis - culture-negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236624004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126141, + "CONCEPT_NAME" : "Chronic cystitis - culture negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236626002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127565, + "CONCEPT_NAME" : "Recurrent cystitis - culture-negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236625003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207186, + "CONCEPT_NAME" : "Viral infection by site", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "312130009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207190, + "CONCEPT_NAME" : "Fungal infection by site", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "312146001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434557, + "CONCEPT_NAME" : "Tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56717001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432251, + "CONCEPT_NAME" : "Disease caused by parasite", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17322007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36102152, + "CONCEPT_NAME" : "Protozoal infectious disorders", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10037072", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "MedDRA", + "CONCEPT_CLASS_ID" : "HLGT" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433417, + "CONCEPT_NAME" : "Gonorrhea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15628003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36102938, + "CONCEPT_NAME" : "Chlamydial infections", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10008561", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "MedDRA", + "CONCEPT_CLASS_ID" : "HLT" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Urinary Tract Infection", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 10, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 9, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1061.json b/tests/cohorts/1061.json new file mode 100644 index 00000000..15f0cbd5 --- /dev/null +++ b/tests/cohorts/1061.json @@ -0,0 +1,1525 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 10, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 10, + "name" : "[HowOften] cephalosporin systematic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40798709, + "CONCEPT_NAME" : "Cefacetrile", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721059", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1796435, + "CONCEPT_NAME" : "cefixime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25033", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40798704, + "CONCEPT_NAME" : "Cefmenoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721061", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19072255, + "CONCEPT_NAME" : "cefmetazole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2182", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43008993, + "CONCEPT_NAME" : "cefminox sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700419", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028286, + "CONCEPT_NAME" : "cefodizime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20485", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19072857, + "CONCEPT_NAME" : "cefonicid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2183", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1773402, + "CONCEPT_NAME" : "cefoperazone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2184", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028288, + "CONCEPT_NAME" : "ceforanide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20486", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1774470, + "CONCEPT_NAME" : "cefotaxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2186", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1774932, + "CONCEPT_NAME" : "cefotetan", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2187", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19051271, + "CONCEPT_NAME" : "cefotiam", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2188", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1775741, + "CONCEPT_NAME" : "cefoxitin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2189", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009045, + "CONCEPT_NAME" : "cefpiramide sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700471", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1749008, + "CONCEPT_NAME" : "cefpodoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20489", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1738366, + "CONCEPT_NAME" : "cefprozil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19552", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009083, + "CONCEPT_NAME" : "cefroxadine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700509", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19051345, + "CONCEPT_NAME" : "cefsulodin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2190", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1776684, + "CONCEPT_NAME" : "ceftazidime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2191", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198137, + "CONCEPT_NAME" : "cefteram pivoxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819502", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43008994, + "CONCEPT_NAME" : "ceftezole sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700420", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1749083, + "CONCEPT_NAME" : "ceftibuten", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20492", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1777254, + "CONCEPT_NAME" : "ceftizoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2192", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1777806, + "CONCEPT_NAME" : "ceftriaxone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2193", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1778162, + "CONCEPT_NAME" : "cefuroxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2194", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1786621, + "CONCEPT_NAME" : "cephalexin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2231", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19052683, + "CONCEPT_NAME" : "cephaloridine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2233", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19086759, + "CONCEPT_NAME" : "cephalothin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2236", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19086790, + "CONCEPT_NAME" : "cephapirin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2238", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1786842, + "CONCEPT_NAME" : "cephradine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2239", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009087, + "CONCEPT_NAME" : "flomoxef sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700513", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1708100, + "CONCEPT_NAME" : "loracarbef", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28981", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19126622, + "CONCEPT_NAME" : "moxalactam", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7069", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1768849, + "CONCEPT_NAME" : "cefaclor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2176", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1769535, + "CONCEPT_NAME" : "cefadroxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2177", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19070174, + "CONCEPT_NAME" : "cefamandole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2178", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19070680, + "CONCEPT_NAME" : "cefatrizine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2179", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40798700, + "CONCEPT_NAME" : "Cefazedone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721060", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1771162, + "CONCEPT_NAME" : "cefazolin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2180", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009082, + "CONCEPT_NAME" : "cefbuperazone sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700508", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009044, + "CONCEPT_NAME" : "cefcapene pivoxil hydrochloride hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700470", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1796458, + "CONCEPT_NAME" : "cefdinir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25037", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747005, + "CONCEPT_NAME" : "cefditoren", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83682", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028241, + "CONCEPT_NAME" : "cefetamet", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20482", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35129269, + "CONCEPT_NAME" : "Cefmenoxime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4786537", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35160132, + "CONCEPT_NAME" : "Cefmenoxime Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4817111", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2035392, + "CONCEPT_NAME" : "Cefmenoxime Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4934549", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21132307, + "CONCEPT_NAME" : "Ceftazidime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP388743", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40020954, + "CONCEPT_NAME" : "cefuroxime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377415", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 11, + "name" : "Urinary tract infection", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 81902, + "CONCEPT_NAME" : "Urinary tract infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68566005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4167328, + "CONCEPT_NAME" : "Pyuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4800001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 77340, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267204006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4265485, + "CONCEPT_NAME" : "Bacteriuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61373006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126297, + "CONCEPT_NAME" : "Chronic obstructive pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236379002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195588, + "CONCEPT_NAME" : "Cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38822007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198806, + "CONCEPT_NAME" : "Abscess of prostate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8725005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126267, + "CONCEPT_NAME" : "Chronic radiation cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236629009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194997, + "CONCEPT_NAME" : "Prostatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9713002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4077499, + "CONCEPT_NAME" : "Sterile pyuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "275742001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442345, + "CONCEPT_NAME" : "Syphilis of kidney", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59530001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062493, + "CONCEPT_NAME" : "Mumps nephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17121006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757237, + "CONCEPT_NAME" : "Diphtheria tubulointerstitial nephropathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1086071000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36714969, + "CONCEPT_NAME" : "Asymptomatic bacteriuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "720406004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195743, + "CONCEPT_NAME" : "Diphtheritic cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48278001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201353, + "CONCEPT_NAME" : "Irradiation cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11251000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4047937, + "CONCEPT_NAME" : "Neonatal urinary tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12301009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201792, + "CONCEPT_NAME" : "Nongonococcal urethritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84619001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128384, + "CONCEPT_NAME" : "Non-infective cystitis", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "D", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "236623005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 78357, + "CONCEPT_NAME" : "Reactive arthritis triad", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67224007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195313, + "CONCEPT_NAME" : "Urethral abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67277002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 197919, + "CONCEPT_NAME" : "Urethral stricture due to infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80375002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439349, + "CONCEPT_NAME" : "Cystitis associated with another disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197845000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4227291, + "CONCEPT_NAME" : "Hemorrhagic cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87696004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4060312, + "CONCEPT_NAME" : "Infections of urethra in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199206009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127564, + "CONCEPT_NAME" : "Acute cystitis - culture-negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236624004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126141, + "CONCEPT_NAME" : "Chronic cystitis - culture negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236626002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127565, + "CONCEPT_NAME" : "Recurrent cystitis - culture-negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236625003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207186, + "CONCEPT_NAME" : "Viral infection by site", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "312130009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207190, + "CONCEPT_NAME" : "Fungal infection by site", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "312146001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434557, + "CONCEPT_NAME" : "Tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56717001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432251, + "CONCEPT_NAME" : "Disease caused by parasite", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17322007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36102152, + "CONCEPT_NAME" : "Protozoal infectious disorders", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10037072", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "MedDRA", + "CONCEPT_CLASS_ID" : "HLGT" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433417, + "CONCEPT_NAME" : "Gonorrhea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15628003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36102938, + "CONCEPT_NAME" : "Chlamydial infections", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10008561", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "MedDRA", + "CONCEPT_CLASS_ID" : "HLT" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Urinary Tract Infection", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 11, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 10, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1062.json b/tests/cohorts/1062.json new file mode 100644 index 00000000..4f8f22d5 --- /dev/null +++ b/tests/cohorts/1062.json @@ -0,0 +1,879 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 11, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 11, + "name" : "[HowOften] Trimethoprim systemetic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40081374, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Injectable Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377117", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36882762, + "CONCEPT_NAME" : "Sulfamethoxazole / Trimethoprim Injectable Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP994039", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40220482, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Injection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1809082", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35153537, + "CONCEPT_NAME" : "Sulfamethoxazole / Trimethoprim Oral Granules", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4810565", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40147374, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "757319", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40081379, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374233", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40081388, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Tablet", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374234", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1705674, + "CONCEPT_NAME" : "trimethoprim", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10829", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40073114, + "CONCEPT_NAME" : "polymyxin B / trimethoprim Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376523", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40073115, + "CONCEPT_NAME" : "polymyxin B / trimethoprim Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "379128", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40180925, + "CONCEPT_NAME" : "sulfamethazine / trimethoprim Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "991879", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 12, + "name" : "Urinary tract infection", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 81902, + "CONCEPT_NAME" : "Urinary tract infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68566005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4167328, + "CONCEPT_NAME" : "Pyuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4800001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 77340, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267204006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4265485, + "CONCEPT_NAME" : "Bacteriuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61373006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126297, + "CONCEPT_NAME" : "Chronic obstructive pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236379002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195588, + "CONCEPT_NAME" : "Cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38822007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198806, + "CONCEPT_NAME" : "Abscess of prostate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8725005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126267, + "CONCEPT_NAME" : "Chronic radiation cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236629009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194997, + "CONCEPT_NAME" : "Prostatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9713002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4077499, + "CONCEPT_NAME" : "Sterile pyuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "275742001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442345, + "CONCEPT_NAME" : "Syphilis of kidney", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59530001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062493, + "CONCEPT_NAME" : "Mumps nephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17121006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757237, + "CONCEPT_NAME" : "Diphtheria tubulointerstitial nephropathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1086071000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36714969, + "CONCEPT_NAME" : "Asymptomatic bacteriuria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "720406004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195743, + "CONCEPT_NAME" : "Diphtheritic cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48278001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201353, + "CONCEPT_NAME" : "Irradiation cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11251000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4047937, + "CONCEPT_NAME" : "Neonatal urinary tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12301009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201792, + "CONCEPT_NAME" : "Nongonococcal urethritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84619001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4128384, + "CONCEPT_NAME" : "Non-infective cystitis", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "D", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "236623005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 78357, + "CONCEPT_NAME" : "Reactive arthritis triad", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67224007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195313, + "CONCEPT_NAME" : "Urethral abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67277002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 197919, + "CONCEPT_NAME" : "Urethral stricture due to infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80375002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439349, + "CONCEPT_NAME" : "Cystitis associated with another disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197845000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4227291, + "CONCEPT_NAME" : "Hemorrhagic cystitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87696004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4060312, + "CONCEPT_NAME" : "Infections of urethra in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199206009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127564, + "CONCEPT_NAME" : "Acute cystitis - culture-negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236624004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126141, + "CONCEPT_NAME" : "Chronic cystitis - culture negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236626002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127565, + "CONCEPT_NAME" : "Recurrent cystitis - culture-negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236625003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207186, + "CONCEPT_NAME" : "Viral infection by site", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "312130009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207190, + "CONCEPT_NAME" : "Fungal infection by site", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "U", + "INVALID_REASON_CAPTION" : "Invalid", + "CONCEPT_CODE" : "312146001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434557, + "CONCEPT_NAME" : "Tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56717001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432251, + "CONCEPT_NAME" : "Disease caused by parasite", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17322007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36102152, + "CONCEPT_NAME" : "Protozoal infectious disorders", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10037072", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "MedDRA", + "CONCEPT_CLASS_ID" : "HLGT" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433417, + "CONCEPT_NAME" : "Gonorrhea", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15628003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36102938, + "CONCEPT_NAME" : "Chlamydial infections", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10008561", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "MedDRA", + "CONCEPT_CLASS_ID" : "HLT" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Urinary Tract Infection", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 12, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 11, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1063.json b/tests/cohorts/1063.json new file mode 100644 index 00000000..7b503e1a --- /dev/null +++ b/tests/cohorts/1063.json @@ -0,0 +1,1458 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 9, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 9, + "name" : "[HowOften] fluoroquinolone systemic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1721543, + "CONCEPT_NAME" : "norfloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7517", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198003, + "CONCEPT_NAME" : "pazufloxacin mesilate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819368", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747032, + "CONCEPT_NAME" : "grepafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83719", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19041153, + "CONCEPT_NAME" : "temafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "37771", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1592954, + "CONCEPT_NAME" : "delafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1927663", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1716721, + "CONCEPT_NAME" : "gemifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "138099", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 923081, + "CONCEPT_NAME" : "ofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7623", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19050750, + "CONCEPT_NAME" : "fleroxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42322", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1712549, + "CONCEPT_NAME" : "trovafloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "115552", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35197938, + "CONCEPT_NAME" : "garenoxacin mesilate hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819303", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36878831, + "CONCEPT_NAME" : "nadifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP1007304", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40161662, + "CONCEPT_NAME" : "besifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819911", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009030, + "CONCEPT_NAME" : "tosufloxacin tosylate hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700456", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1743222, + "CONCEPT_NAME" : "enoxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3925", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35834909, + "CONCEPT_NAME" : "lascufloxacin hydrochloride", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5040502", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198165, + "CONCEPT_NAME" : "sitafloxacin hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819530", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1789276, + "CONCEPT_NAME" : "gatifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "228476", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1797513, + "CONCEPT_NAME" : "ciprofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2551", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1742253, + "CONCEPT_NAME" : "levofloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82122", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1716903, + "CONCEPT_NAME" : "moxifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "139462", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35197897, + "CONCEPT_NAME" : "prulifloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819262", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19027679, + "CONCEPT_NAME" : "pefloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7960", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1733765, + "CONCEPT_NAME" : "sparfloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18469", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1707800, + "CONCEPT_NAME" : "lomefloxacin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28872", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42613186, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5160363", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2909524, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5126291", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40161667, + "CONCEPT_NAME" : "besifloxacin Ophthalmic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "850304", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028718, + "CONCEPT_NAME" : "ciprofloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376483", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028720, + "CONCEPT_NAME" : "ciprofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376202", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860696, + "CONCEPT_NAME" : "enoxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017123", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35858962, + "CONCEPT_NAME" : "gatifloxacin Ophthalmic Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5015272", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40059607, + "CONCEPT_NAME" : "gatifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402433", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35861002, + "CONCEPT_NAME" : "levofloxacin Ophthalmic Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017598", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40001157, + "CONCEPT_NAME" : "levofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376884", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40059318, + "CONCEPT_NAME" : "lomefloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372629", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40057467, + "CONCEPT_NAME" : "moxifloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406106", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40066892, + "CONCEPT_NAME" : "norfloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376519", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40066893, + "CONCEPT_NAME" : "norfloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377401", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43695029, + "CONCEPT_NAME" : "Ofloxacin Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP672324", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40069651, + "CONCEPT_NAME" : "ofloxacin Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377402", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851732, + "CONCEPT_NAME" : "pazufloxacin mesilate Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5008335", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42961482, + "CONCEPT_NAME" : "tosufloxacin tosylate hydrate Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4687978", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42479725, + "CONCEPT_NAME" : "Ciprofloxacin / Dexamethasone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP419326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028359, + "CONCEPT_NAME" : "ciprofloxacin / dexamethasone Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "405942", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42629035, + "CONCEPT_NAME" : "ciprofloxacin / fluocinolone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1792384", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43258666, + "CONCEPT_NAME" : "Ciprofloxacin / Hydrocortisone Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP572540", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40028361, + "CONCEPT_NAME" : "ciprofloxacin / hydrocortisone Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374589", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40160496, + "CONCEPT_NAME" : "ciprofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "848955", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35605255, + "CONCEPT_NAME" : "ciprofloxacin Otic Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1739996", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860990, + "CONCEPT_NAME" : "levofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017586", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35144130, + "CONCEPT_NAME" : "lomefloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4801876", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40069655, + "CONCEPT_NAME" : "ofloxacin Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377450", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42965658, + "CONCEPT_NAME" : "Ciprofloxacin / fluocinolone Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4692126", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36269500, + "CONCEPT_NAME" : "Ciprofloxacin Mucous Membrane Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP3120375", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35857832, + "CONCEPT_NAME" : "ciprofloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5014782", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35857838, + "CONCEPT_NAME" : "ciprofloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5014788", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35860698, + "CONCEPT_NAME" : "enoxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5017125", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35862078, + "CONCEPT_NAME" : "lomefloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018791", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35862084, + "CONCEPT_NAME" : "lomefloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018797", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2052955, + "CONCEPT_NAME" : "lomefloxacin Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4953477", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43678347, + "CONCEPT_NAME" : "nadifloxacin Topical Cream", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP692663", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35154779, + "CONCEPT_NAME" : "nadifloxacin Topical Lotion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4811800", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35141912, + "CONCEPT_NAME" : "nadifloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4799033", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35861725, + "CONCEPT_NAME" : "norfloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5018416", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851383, + "CONCEPT_NAME" : "ofloxacin Topical Gel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5007927", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35851392, + "CONCEPT_NAME" : "ofloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5007936", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35856292, + "CONCEPT_NAME" : "pefloxacin Topical Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5012825", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 10, + "name" : "Acute Typical Pneumonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 46269693, + "CONCEPT_NAME" : "Chronic pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102361000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193174, + "CONCEPT_NAME" : "Fungal respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312149008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712839, + "CONCEPT_NAME" : "Idiopathic pneumonia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12381000132107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318404, + "CONCEPT_NAME" : "Lung consolidation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95436008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 11, + "name" : "Non Acute Typical Pneumonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 36712839, + "CONCEPT_NAME" : "Idiopathic pneumonia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12381000132107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193174, + "CONCEPT_NAME" : "Fungal respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312149008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269693, + "CONCEPT_NAME" : "Chronic pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102361000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Acute Typical Pneumonia", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 10, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 11, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 9, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1064.json b/tests/cohorts/1064.json new file mode 100644 index 00000000..8ca6bd35 --- /dev/null +++ b/tests/cohorts/1064.json @@ -0,0 +1,1152 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 10, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 10, + "name" : "[HowOften] cephalosporin systematic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40798709, + "CONCEPT_NAME" : "Cefacetrile", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721059", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1796435, + "CONCEPT_NAME" : "cefixime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25033", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40798704, + "CONCEPT_NAME" : "Cefmenoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721061", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19072255, + "CONCEPT_NAME" : "cefmetazole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2182", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43008993, + "CONCEPT_NAME" : "cefminox sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700419", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028286, + "CONCEPT_NAME" : "cefodizime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20485", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19072857, + "CONCEPT_NAME" : "cefonicid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2183", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1773402, + "CONCEPT_NAME" : "cefoperazone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2184", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028288, + "CONCEPT_NAME" : "ceforanide", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20486", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1774470, + "CONCEPT_NAME" : "cefotaxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2186", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1774932, + "CONCEPT_NAME" : "cefotetan", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2187", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19051271, + "CONCEPT_NAME" : "cefotiam", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2188", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1775741, + "CONCEPT_NAME" : "cefoxitin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2189", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009045, + "CONCEPT_NAME" : "cefpiramide sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700471", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1749008, + "CONCEPT_NAME" : "cefpodoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20489", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1738366, + "CONCEPT_NAME" : "cefprozil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19552", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009083, + "CONCEPT_NAME" : "cefroxadine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700509", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19051345, + "CONCEPT_NAME" : "cefsulodin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2190", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1776684, + "CONCEPT_NAME" : "ceftazidime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2191", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35198137, + "CONCEPT_NAME" : "cefteram pivoxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4819502", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43008994, + "CONCEPT_NAME" : "ceftezole sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700420", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1749083, + "CONCEPT_NAME" : "ceftibuten", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20492", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1777254, + "CONCEPT_NAME" : "ceftizoxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2192", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1777806, + "CONCEPT_NAME" : "ceftriaxone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2193", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1778162, + "CONCEPT_NAME" : "cefuroxime", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2194", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1786621, + "CONCEPT_NAME" : "cephalexin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2231", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19052683, + "CONCEPT_NAME" : "cephaloridine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2233", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19086759, + "CONCEPT_NAME" : "cephalothin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2236", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19086790, + "CONCEPT_NAME" : "cephapirin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2238", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1786842, + "CONCEPT_NAME" : "cephradine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2239", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009087, + "CONCEPT_NAME" : "flomoxef sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700513", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1708100, + "CONCEPT_NAME" : "loracarbef", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28981", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19126622, + "CONCEPT_NAME" : "moxalactam", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7069", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1768849, + "CONCEPT_NAME" : "cefaclor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2176", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1769535, + "CONCEPT_NAME" : "cefadroxil", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2177", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19070174, + "CONCEPT_NAME" : "cefamandole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2178", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19070680, + "CONCEPT_NAME" : "cefatrizine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2179", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40798700, + "CONCEPT_NAME" : "Cefazedone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP2721060", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1771162, + "CONCEPT_NAME" : "cefazolin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2180", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009082, + "CONCEPT_NAME" : "cefbuperazone sodium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700508", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43009044, + "CONCEPT_NAME" : "cefcapene pivoxil hydrochloride hydrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4700470", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1796458, + "CONCEPT_NAME" : "cefdinir", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25037", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1747005, + "CONCEPT_NAME" : "cefditoren", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83682", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 19028241, + "CONCEPT_NAME" : "cefetamet", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20482", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35129269, + "CONCEPT_NAME" : "Cefmenoxime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4786537", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35160132, + "CONCEPT_NAME" : "Cefmenoxime Otic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4817111", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2035392, + "CONCEPT_NAME" : "Cefmenoxime Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4934549", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21132307, + "CONCEPT_NAME" : "Ceftazidime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP388743", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40020954, + "CONCEPT_NAME" : "cefuroxime Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377415", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 11, + "name" : "Acute Typical Pneumonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 46269693, + "CONCEPT_NAME" : "Chronic pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102361000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193174, + "CONCEPT_NAME" : "Fungal respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312149008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712839, + "CONCEPT_NAME" : "Idiopathic pneumonia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12381000132107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318404, + "CONCEPT_NAME" : "Lung consolidation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95436008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 12, + "name" : "Non Acute Typical Pneumonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 36712839, + "CONCEPT_NAME" : "Idiopathic pneumonia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12381000132107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193174, + "CONCEPT_NAME" : "Fungal respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312149008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269693, + "CONCEPT_NAME" : "Chronic pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102361000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Acute Typical Pneumonia", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 11, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 12, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 10, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1065.json b/tests/cohorts/1065.json new file mode 100644 index 00000000..36195c49 --- /dev/null +++ b/tests/cohorts/1065.json @@ -0,0 +1,506 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 11, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 11, + "name" : "[HowOften] Trimethoprim systemetic", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 40081374, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Injectable Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "377117", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36882762, + "CONCEPT_NAME" : "Sulfamethoxazole / Trimethoprim Injectable Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP994039", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40220482, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Injection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1809082", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35153537, + "CONCEPT_NAME" : "Sulfamethoxazole / Trimethoprim Oral Granules", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP4810565", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm Extension", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40147374, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "757319", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40081379, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Suspension", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374233", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40081388, + "CONCEPT_NAME" : "sulfamethoxazole / trimethoprim Oral Tablet", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "374234", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1705674, + "CONCEPT_NAME" : "trimethoprim", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10829", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40073114, + "CONCEPT_NAME" : "polymyxin B / trimethoprim Ophthalmic Ointment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "376523", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40073115, + "CONCEPT_NAME" : "polymyxin B / trimethoprim Ophthalmic Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "379128", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40180925, + "CONCEPT_NAME" : "sulfamethazine / trimethoprim Topical Solution", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "991879", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Clinical Drug Form" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 12, + "name" : "Acute Typical Pneumonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 46269693, + "CONCEPT_NAME" : "Chronic pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102361000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193174, + "CONCEPT_NAME" : "Fungal respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312149008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712839, + "CONCEPT_NAME" : "Idiopathic pneumonia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12381000132107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318404, + "CONCEPT_NAME" : "Lung consolidation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95436008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 13, + "name" : "Non Acute Typical Pneumonia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 36712839, + "CONCEPT_NAME" : "Idiopathic pneumonia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12381000132107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193174, + "CONCEPT_NAME" : "Fungal respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312149008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269693, + "CONCEPT_NAME" : "Chronic pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "102361000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Acute Typical Pneumonia", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 12, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 13, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 11, + "GapDays" : 30, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1066.json b/tests/cohorts/1066.json new file mode 100644 index 00000000..ab44f5d4 --- /dev/null +++ b/tests/cohorts/1066.json @@ -0,0 +1,445 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 6, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[HowOften] TNF inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 19041065, + "CONCEPT_NAME" : "golimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819300", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 912263, + "CONCEPT_NAME" : "certolizumab pegol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "709271", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 937368, + "CONCEPT_NAME" : "infliximab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191831", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1151789, + "CONCEPT_NAME" : "etanercept", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "214555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1119119, + "CONCEPT_NAME" : "adalimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "327361", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "[PL] Rheumatoid arthritis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4297650, + "CONCEPT_NAME" : "Cutaneous atrophy due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402431009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4334806, + "CONCEPT_NAME" : "Deformity of foot due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "433228003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46273442, + "CONCEPT_NAME" : "Deformity of hand due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "96531000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107572, + "CONCEPT_NAME" : "Disease prognosis for rheumatoid arthritis assessed, good prognosis documented (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3476F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107561, + "CONCEPT_NAME" : "Disease prognosis for rheumatoid arthritis assessed, poor prognosis documented (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3475F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4107913, + "CONCEPT_NAME" : "Myopathy due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193250002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2108721, + "CONCEPT_NAME" : "Patient receiving first-time biologic disease modifying anti-rheumatic drug therapy for rheumatoid arthritis (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4195F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4102493, + "CONCEPT_NAME" : "Polyneuropathy in rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193180002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80809, + "CONCEPT_NAME" : "Rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69896004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107560, + "CONCEPT_NAME" : "Rheumatoid arthritis (RA) disease activity, high (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3472F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107558, + "CONCEPT_NAME" : "Rheumatoid arthritis (RA) disease activity, low (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3470F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107559, + "CONCEPT_NAME" : "Rheumatoid arthritis (RA) disease activity, moderate (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3471F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4083556, + "CONCEPT_NAME" : "Seronegative rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239792003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4035611, + "CONCEPT_NAME" : "Seropositive rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239791005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Rheumatoid arthritis", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Observation" : { + "CodesetId" : 7, + "ObservationTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 6, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1067.json b/tests/cohorts/1067.json new file mode 100644 index 00000000..a1af86a6 --- /dev/null +++ b/tests/cohorts/1067.json @@ -0,0 +1,249 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 7, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 7, + "name" : "[HowOften] JAK inhibitor", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1510627, + "CONCEPT_NAME" : "baricitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2047232", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40244464, + "CONCEPT_NAME" : "ruxolitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1193326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42904205, + "CONCEPT_NAME" : "tofacitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1357536", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 8, + "name" : "Ulcerative colitis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 46273477, + "CONCEPT_NAME" : "Complication due to ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1092851000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46273478, + "CONCEPT_NAME" : "Rectal hemorrhage due to ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1092881000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81893, + "CONCEPT_NAME" : "Ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64766004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 75580, + "CONCEPT_NAME" : "Chronic ulcerative proctitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52231000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269847, + "CONCEPT_NAME" : "Rectal hemorrhage due to chronic ulcerative proctitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1085221000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269843, + "CONCEPT_NAME" : "Complication due to chronic ulcerative proctitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1085191000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Ulcerative colitis", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 7, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1068.json b/tests/cohorts/1068.json new file mode 100644 index 00000000..88d746a5 --- /dev/null +++ b/tests/cohorts/1068.json @@ -0,0 +1,283 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 6, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[HowOften] TNF inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 19041065, + "CONCEPT_NAME" : "golimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819300", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 912263, + "CONCEPT_NAME" : "certolizumab pegol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "709271", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 937368, + "CONCEPT_NAME" : "infliximab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191831", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1151789, + "CONCEPT_NAME" : "etanercept", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "214555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1119119, + "CONCEPT_NAME" : "adalimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "327361", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "[PL] Ulcerative colitis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 46273477, + "CONCEPT_NAME" : "Complication due to ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1092851000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46273478, + "CONCEPT_NAME" : "Rectal hemorrhage due to ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1092881000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81893, + "CONCEPT_NAME" : "Ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64766004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 75580, + "CONCEPT_NAME" : "Chronic ulcerative proctitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52231000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269847, + "CONCEPT_NAME" : "Rectal hemorrhage due to chronic ulcerative proctitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1085221000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46269843, + "CONCEPT_NAME" : "Complication due to chronic ulcerative proctitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1085191000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Ulcerative colitis", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 6, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1069.json b/tests/cohorts/1069.json new file mode 100644 index 00000000..3a5053b5 --- /dev/null +++ b/tests/cohorts/1069.json @@ -0,0 +1,232 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 6, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 6, + "name" : "[HowOften] TNF inhibitors", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 19041065, + "CONCEPT_NAME" : "golimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "819300", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 912263, + "CONCEPT_NAME" : "certolizumab pegol", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "709271", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 937368, + "CONCEPT_NAME" : "infliximab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "191831", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1151789, + "CONCEPT_NAME" : "etanercept", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "214555", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1119119, + "CONCEPT_NAME" : "adalimumab", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "327361", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "Crohns disease", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 46269889, + "CONCEPT_NAME" : "Complication due to Crohn's disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1085911000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201606, + "CONCEPT_NAME" : "Crohn's disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34000006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4340812, + "CONCEPT_NAME" : "Perianal Crohn's disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235796008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Crohns disease", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 7, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 6, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1070.json b/tests/cohorts/1070.json new file mode 100644 index 00000000..46486bd6 --- /dev/null +++ b/tests/cohorts/1070.json @@ -0,0 +1,411 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "DrugExposure" : { + "CodesetId" : 7, + "First" : true, + "DrugTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 7, + "name" : "[HowOften] JAK inhibitor", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 1510627, + "CONCEPT_NAME" : "baricitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2047232", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40244464, + "CONCEPT_NAME" : "ruxolitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1193326", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42904205, + "CONCEPT_NAME" : "tofacitinib", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1357536", + "DOMAIN_ID" : "Drug", + "VOCABULARY_ID" : "RxNorm", + "CONCEPT_CLASS_ID" : "Ingredient" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 8, + "name" : "[PL] Rheumatoid arthritis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4297650, + "CONCEPT_NAME" : "Cutaneous atrophy due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402431009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4334806, + "CONCEPT_NAME" : "Deformity of foot due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "433228003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46273442, + "CONCEPT_NAME" : "Deformity of hand due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "96531000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107572, + "CONCEPT_NAME" : "Disease prognosis for rheumatoid arthritis assessed, good prognosis documented (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3476F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107561, + "CONCEPT_NAME" : "Disease prognosis for rheumatoid arthritis assessed, poor prognosis documented (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3475F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4107913, + "CONCEPT_NAME" : "Myopathy due to rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193250002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2108721, + "CONCEPT_NAME" : "Patient receiving first-time biologic disease modifying anti-rheumatic drug therapy for rheumatoid arthritis (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4195F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4102493, + "CONCEPT_NAME" : "Polyneuropathy in rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193180002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80809, + "CONCEPT_NAME" : "Rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69896004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107560, + "CONCEPT_NAME" : "Rheumatoid arthritis (RA) disease activity, high (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3472F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107558, + "CONCEPT_NAME" : "Rheumatoid arthritis (RA) disease activity, low (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3470F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2107559, + "CONCEPT_NAME" : "Rheumatoid arthritis (RA) disease activity, moderate (RA)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3471F", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "CPT4", + "CONCEPT_CLASS_ID" : "CPT4" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4083556, + "CONCEPT_NAME" : "Seronegative rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239792003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4035611, + "CONCEPT_NAME" : "Seropositive rheumatoid arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239791005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "nested in Rheumatoid arthritis", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Observation" : { + "CodesetId" : 8, + "ObservationTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "CustomEra" : { + "DrugCodesetId" : 7, + "GapDays" : 90, + "Offset" : 0 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1071.json b/tests/cohorts/1071.json new file mode 100644 index 00000000..d2c78265 --- /dev/null +++ b/tests/cohorts/1071.json @@ -0,0 +1,162 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2022-01-01", + "EndDate" : "2022-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2021-01-01", + "EndDate" : "2021-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2020-01-01", + "EndDate" : "2020-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2019-01-01", + "EndDate" : "2019-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2018-01-01", + "EndDate" : "2018-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2017-01-01", + "EndDate" : "2017-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2016-01-01", + "EndDate" : "2016-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2015-01-01", + "EndDate" : "2015-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2014-01-01", + "EndDate" : "2014-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2013-01-01", + "EndDate" : "2013-01-01" + } + } + }, + { + "ObservationPeriod" : { + "UserDefinedPeriod" : { + "StartDate" : "2012-01-01", + "EndDate" : "2012-01-01" + } + } + } + ], + "ObservationWindow" : { + "PriorDays" : 365, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 0, + "Op" : "bt", + "Extent" : 100 + }, + "Gender" : [ + { + "CONCEPT_ID" : 8532, + "CONCEPT_NAME" : "FEMALE", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "F", + "DOMAIN_ID" : "Gender", + "VOCABULARY_ID" : "Gender", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8507, + "CONCEPT_NAME" : "MALE", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "M", + "DOMAIN_ID" : "Gender", + "VOCABULARY_ID" : "Gender", + "CONCEPT_CLASS_ID" : null + } + ] + } + ], + "Groups" : [] + }, + "ConceptSets" : [], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1072.json b/tests/cohorts/1072.json new file mode 100644 index 00000000..cd739301 --- /dev/null +++ b/tests/cohorts/1072.json @@ -0,0 +1,7682 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + }, + { + "Measurement" : { + "CodesetId" : 4, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 0, + "Op" : "gt" + }, + "ValueAsConcept" : [ + { + "CONCEPT_ID" : 36309345, + "CONCEPT_NAME" : ">50 cells", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA24571-4", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 36310085, + "CONCEPT_NAME" : "21-50 cells", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA24616-7", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 36309475, + "CONCEPT_NAME" : "11-20 cells", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA24595-3", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 36310741, + "CONCEPT_NAME" : "5-10 cells", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA24619-1", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45878548, + "CONCEPT_NAME" : "1+", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA11841-6", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45881916, + "CONCEPT_NAME" : "2+", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA11842-4", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45876467, + "CONCEPT_NAME" : "3+", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA11843-2", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45881623, + "CONCEPT_NAME" : "4+", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA11844-0", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 3459354, + "CONCEPT_NAME" : "Present + out of ++++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260347006", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "Nebraska Lexicon", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 3474574, + "CONCEPT_NAME" : "Present ++ out of ++++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260348001", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "Nebraska Lexicon", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 3437429, + "CONCEPT_NAME" : "Present +++ out of ++++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260349009", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "Nebraska Lexicon", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 4126674, + "CONCEPT_NAME" : "++++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260350009", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 3470980, + "CONCEPT_NAME" : "Present ++++ out of ++++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260350009", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "Nebraska Lexicon", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 4125547, + "CONCEPT_NAME" : "+++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260349009", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 4126673, + "CONCEPT_NAME" : "++", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260348001", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 4123508, + "CONCEPT_NAME" : "+", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260347006", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9192, + "CONCEPT_NAME" : "Trace", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260405006", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 3472281, + "CONCEPT_NAME" : "Trace", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "260405006", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "Nebraska Lexicon", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45881796, + "CONCEPT_NAME" : "Trace", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA11832-5", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9191, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10828004", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45884084, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA6576-8", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + { + "Observation" : { + "CodesetId" : 4, + "ObservationTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 5, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 10, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "OMOPUveitis CMV AC PCR positive [measurements, observations, specimen]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 36309671, + "CONCEPT_NAME" : "PCR for Cytomegalovirus - Positive", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LA13966-9", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Answer" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4143091, + "CONCEPT_NAME" : "Aqueous humor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "425460003", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Substance" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4122252, + "CONCEPT_NAME" : "Aqueous humor sample", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "258444001", + "DOMAIN_ID" : "Specimen", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Specimen" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4140156, + "CONCEPT_NAME" : "Eye fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426513002", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Substance" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3049944, + "CONCEPT_NAME" : "XXX microorganism DNA [Identifier] in Specimen by NAA with probe detection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38347-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40764963, + "CONCEPT_NAME" : "XXX microorganism DNA [Identifier] in Isolate by NAA with probe detection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "62202-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37073281, + "CONCEPT_NAME" : "XXX microorganism DNA | Isolate | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP379858-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3035833, + "CONCEPT_NAME" : "XXX microorganism DNA [Presence] in Specimen by NAA with probe detection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35691-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4138900, + "CONCEPT_NAME" : "Vitreous humor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426101004", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Substance" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4146128, + "CONCEPT_NAME" : "Subretinal fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "427223001", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Substance" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 3, + "name" : "OMOPUveitis Anterior uveitis [conditions]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4132792, + "CONCEPT_NAME" : "Anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410692006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4176864, + "CONCEPT_NAME" : "Acute anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4927003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36713131, + "CONCEPT_NAME" : "Acute anterior uveitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "342151000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36713119, + "CONCEPT_NAME" : "Acute anterior uveitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "336541000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36713148, + "CONCEPT_NAME" : "Acute anterior uveitis of bilateral eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "347311000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 438961, + "CONCEPT_NAME" : "Herpes zoster iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10698009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 45770924, + "CONCEPT_NAME" : "Herpes zoster iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "331071000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36717362, + "CONCEPT_NAME" : "Acute iritis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "336531000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 441283, + "CONCEPT_NAME" : "Recurrent iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6869001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 440716, + "CONCEPT_NAME" : "Infectious secondary iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89114005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36713147, + "CONCEPT_NAME" : "Bilateral acute iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "347301000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36684732, + "CONCEPT_NAME" : "Chronic iridocyclitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "341581000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4274964, + "CONCEPT_NAME" : "Iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "65074000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36684666, + "CONCEPT_NAME" : "Chronic anterior uveitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "335971000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36684792, + "CONCEPT_NAME" : "Bilateral chronic anterior uveitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "346801000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4104039, + "CONCEPT_NAME" : "Acute iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29050005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36713130, + "CONCEPT_NAME" : "Acute iritis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "342141000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 433187, + "CONCEPT_NAME" : "Cyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17657000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 434926, + "CONCEPT_NAME" : "Iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "77971008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 434348, + "CONCEPT_NAME" : "Acute and subacute iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267618008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 434029, + "CONCEPT_NAME" : "Chronic anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "398155003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4273853, + "CONCEPT_NAME" : "Subacute anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64015001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 600624, + "CONCEPT_NAME" : "Subacute iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1144419002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 45757573, + "CONCEPT_NAME" : "Infectious secondary iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "220101000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4109415, + "CONCEPT_NAME" : "Secondary infected iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193487008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761192, + "CONCEPT_NAME" : "Iritis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15638491000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37207891, + "CONCEPT_NAME" : "Chronic iritis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "335961000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761191, + "CONCEPT_NAME" : "Iritis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15638451000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 765069, + "CONCEPT_NAME" : "Iridocyclitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679401000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 608799, + "CONCEPT_NAME" : "Bilateral herpes simplex iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678721000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 608800, + "CONCEPT_NAME" : "Bilateral herpes zoster iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678841000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4335981, + "CONCEPT_NAME" : "Idiopathic anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231947004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37312266, + "CONCEPT_NAME" : "Iritis co-occurrent with inflammatory bowel disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "788718000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37209447, + "CONCEPT_NAME" : "Iritis of right eye caused by herpes zoster virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15991711000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37209448, + "CONCEPT_NAME" : "Iritis of left eye caused by herpes zoster virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15991791000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4291313, + "CONCEPT_NAME" : "Subacute cyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "37565002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4032140, + "CONCEPT_NAME" : "Subacute iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14427009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37207951, + "CONCEPT_NAME" : "Chronic iritis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "341571000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3657102, + "CONCEPT_NAME" : "Subacute iridocyclitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "675381000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3657101, + "CONCEPT_NAME" : "Subacute iridocyclitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "675371000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4221343, + "CONCEPT_NAME" : "Herpetic iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420485005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761325, + "CONCEPT_NAME" : "Iridocyclitis of bilateral eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679441000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761324, + "CONCEPT_NAME" : "Iridocyclitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679361000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761318, + "CONCEPT_NAME" : "Iridocyclitis of right eye caused by human herpes simplex virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678641000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 439300, + "CONCEPT_NAME" : "Secondary non-infected iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193488003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 439299, + "CONCEPT_NAME" : "Chronic iridocyclitis due to another disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193493000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3656995, + "CONCEPT_NAME" : "Fuchs' heterochromic cyclitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "340671000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4091179, + "CONCEPT_NAME" : "Tuberculous chronic iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186266008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 444446, + "CONCEPT_NAME" : "Gonococcal iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9091006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 440634, + "CONCEPT_NAME" : "Herpes simplex iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13608004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 46269950, + "CONCEPT_NAME" : "Iridocyclitis due to tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1092761000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4166240, + "CONCEPT_NAME" : "Chronic iridocyclitis in young girls", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416449002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3657042, + "CONCEPT_NAME" : "Bilateral primary iridocyclitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "344301000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 765063, + "CONCEPT_NAME" : "Iritis of bilateral eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15638531000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 438422, + "CONCEPT_NAME" : "Primary iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12630008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 439731, + "CONCEPT_NAME" : "Secondary syphilitic iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30080002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 438751, + "CONCEPT_NAME" : "Lens-induced iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70461003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 45772123, + "CONCEPT_NAME" : "Sarcoid iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "352941000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761321, + "CONCEPT_NAME" : "Iridocyclitis of left eye due to herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678801000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761320, + "CONCEPT_NAME" : "Iridocyclitis of right eye due to herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678761000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761319, + "CONCEPT_NAME" : "Iridocyclitis of left eye caused by human herpes simplex virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678681000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 432632, + "CONCEPT_NAME" : "Noninfectious secondary iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46916006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 36686922, + "CONCEPT_NAME" : "Bilateral uveitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15630851000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4146105, + "CONCEPT_NAME" : "Non-infectious anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267619000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37207997, + "CONCEPT_NAME" : "Bilateral chronic iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "346791000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3656874, + "CONCEPT_NAME" : "Primary iridocyclitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "332921000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 45757732, + "CONCEPT_NAME" : "Noninfectious secondary iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35881000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 46273126, + "CONCEPT_NAME" : "Syphilitic iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "711617002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 603297, + "CONCEPT_NAME" : "Bilateral iritis of eyes caused by Human alphaherpesvirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679281000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4072340, + "CONCEPT_NAME" : "Herpes simplex iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20555001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 45757712, + "CONCEPT_NAME" : "Gonococcal iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "342381000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3657100, + "CONCEPT_NAME" : "Bilateral subacute iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "675361000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4173308, + "CONCEPT_NAME" : "Acute cyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42492000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3656958, + "CONCEPT_NAME" : "Primary iridocyclitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "338531000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 608988, + "CONCEPT_NAME" : "Bilateral iritis of eyes caused by Human alphaherpesvirus 3", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15991751000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761323, + "CONCEPT_NAME" : "Iritis of right eye caused by herpes simplex virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679321000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 761322, + "CONCEPT_NAME" : "Iritis of left eye caused by herpes simplex virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679241000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 606435, + "CONCEPT_NAME" : "Anterior uveitis due to sarcoidosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1144978007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 45770915, + "CONCEPT_NAME" : "Lens induced iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "336921000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4102176, + "CONCEPT_NAME" : "Iritis due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193489006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3662325, + "CONCEPT_NAME" : "Bilateral iritis of eyes caused by Treponema pallidum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679681000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3656908, + "CONCEPT_NAME" : "Fuchs' heterochromic cyclitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "335061000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3657140, + "CONCEPT_NAME" : "Bilateral Fuchs' heterochromic cyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "680291000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 35625724, + "CONCEPT_NAME" : "Bilateral iritis due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "768799003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 432908, + "CONCEPT_NAME" : "Glaucomatocyclitic crisis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29538005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 35625723, + "CONCEPT_NAME" : "Iritis of left eye due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "768798006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 35625722, + "CONCEPT_NAME" : "Iritis of right eye due to diabetes mellitus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "768797001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 434932, + "CONCEPT_NAME" : "Fuchs' heterochromic cyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11226001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37116567, + "CONCEPT_NAME" : "Primary anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "733317009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4211939, + "CONCEPT_NAME" : "Anterior uveitis due to juvenile idiopathic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416666007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4132495, + "CONCEPT_NAME" : "Iritis in psoriatic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410482007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 37203959, + "CONCEPT_NAME" : "Ankylosing spondylitis co-occurrent with anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "786077003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4182267, + "CONCEPT_NAME" : "Gouty iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43193009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4259504, + "CONCEPT_NAME" : "Iritis with ulcerative colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410484008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4253620, + "CONCEPT_NAME" : "Iritis with Crohn's disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410485009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4211649, + "CONCEPT_NAME" : "Cidofovir-induced anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "413851004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4256466, + "CONCEPT_NAME" : "Iritis in Behcet's syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410480004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3662324, + "CONCEPT_NAME" : "Iritis of left eye caused by Treponema pallidum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679561000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3662323, + "CONCEPT_NAME" : "Iritis of right eye caused by Treponema pallidum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15679481000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4190952, + "CONCEPT_NAME" : "Rifabutin-induced anterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415344002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 3343020, + "CONCEPT_NAME" : "Anterior chamber cells", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "246993000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "Nebraska Lexicon", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4081011, + "CONCEPT_NAME" : "Anterior chamber cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "246993000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 4218326, + "CONCEPT_NAME" : "Traumatic iritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417020006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + } + ] + } + }, + { + "id" : 4, + "name" : "OMOPUveitis Anterior chamber cell [conditions, measurements]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4081011, + "CONCEPT_NAME" : "Anterior chamber cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "246993000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21491750, + "CONCEPT_NAME" : "Right anterior chamber Cells Slit lamp biomicroscopy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79886-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 21491751, + "CONCEPT_NAME" : "Left anterior chamber Cells Slit lamp biomicroscopy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79887-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36309475, + "CONCEPT_NAME" : "11-20 cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LA24595-3", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Answer" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36310085, + "CONCEPT_NAME" : "21-50 cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LA24616-7", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Answer" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36310741, + "CONCEPT_NAME" : "5-10 cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LA24619-1", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Answer" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36309345, + "CONCEPT_NAME" : ">50 cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LA24571-4", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Answer" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3023610, + "CONCEPT_NAME" : "Physical findings of Right anterior chamber Narrative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29095-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019906, + "CONCEPT_NAME" : "Physical findings of Left anterior chamber Narrative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29096-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37022902, + "CONCEPT_NAME" : "Cells | Right anterior chamber | NEI eyeGENE slit lamp biomicroscopy", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP408792-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37053902, + "CONCEPT_NAME" : "Cells | Left anterior chamber | NEI eyeGENE slit lamp biomicroscopy", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP408791-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 5, + "name" : "OMOPUveitis Other anterior segment inflammation [conditions]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4080669, + "CONCEPT_NAME" : "Keratic precipitates", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "246998009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4081010, + "CONCEPT_NAME" : "Anterior chamber flare", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "246992005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4148212, + "CONCEPT_NAME" : "Sector shaped iris atrophy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35323005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657143, + "CONCEPT_NAME" : "Bilateral atrophy of iris of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "680781000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37208236, + "CONCEPT_NAME" : "Atrophy of iris of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "680801000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37208235, + "CONCEPT_NAME" : "Atrophy of iris of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "680791000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4160509, + "CONCEPT_NAME" : "Generalized iris atrophy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371756009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440104, + "CONCEPT_NAME" : "Atrophic iris", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95709007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439011, + "CONCEPT_NAME" : "Progressive iris atrophy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25913001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4334756, + "CONCEPT_NAME" : "Secondary iris atrophy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231949001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 6, + "name" : "OMOPUveitis Retinitis exclusion [conditions]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4161546, + "CONCEPT_NAME" : "Retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399463004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4183040, + "CONCEPT_NAME" : "Posterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43363007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439014, + "CONCEPT_NAME" : "Panuveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75614007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438411, + "CONCEPT_NAME" : "Endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1847009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761352, + "CONCEPT_NAME" : "Retinitis of left eye caused by cytomegalovirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685641000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4265035, + "CONCEPT_NAME" : "Disseminated retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61922005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761351, + "CONCEPT_NAME" : "Retinitis of bilateral eyes caused by cytomegalovirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685601000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761350, + "CONCEPT_NAME" : "Retinitis of right eye caused by cytomegalovirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685561000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761349, + "CONCEPT_NAME" : "Retinitis of right eye caused by Toxoplasma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685361000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761348, + "CONCEPT_NAME" : "Retinitis of left eye caused by Toxoplasma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685321000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657772, + "CONCEPT_NAME" : "Bilateral retinitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685881000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657771, + "CONCEPT_NAME" : "Retinitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685841000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657770, + "CONCEPT_NAME" : "Retinitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685801000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37312551, + "CONCEPT_NAME" : "Infectious panuveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "789116000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212319, + "CONCEPT_NAME" : "Multifocal choroiditis and panuveitis syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414784001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4104214, + "CONCEPT_NAME" : "Metastatic disseminated retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193445006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4104213, + "CONCEPT_NAME" : "Disseminated peripheral chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193443004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4211820, + "CONCEPT_NAME" : "Toxoplasma retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416589006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657843, + "CONCEPT_NAME" : "Bilateral retinitis of eyes caused by secondary syphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15993391000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657842, + "CONCEPT_NAME" : "Bilateral neuroretinitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15992711000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657841, + "CONCEPT_NAME" : "Neuroretinitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15992671000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4234762, + "CONCEPT_NAME" : "Parasitic chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359698000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4228115, + "CONCEPT_NAME" : "Retinopathy associated with AIDS", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "421460008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433757, + "CONCEPT_NAME" : "Peripheral disseminated choroiditis AND chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69811008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437850, + "CONCEPT_NAME" : "Focal chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15847003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4109410, + "CONCEPT_NAME" : "Disseminated posterior pole chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193442009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433765, + "CONCEPT_NAME" : "Acute endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1493002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433762, + "CONCEPT_NAME" : "Disseminated chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78769001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434274, + "CONCEPT_NAME" : "Secondary syphilitic chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "66281009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4152407, + "CONCEPT_NAME" : "Post-traumatic endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314547001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4152406, + "CONCEPT_NAME" : "Acute postoperative endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314545009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4322865, + "CONCEPT_NAME" : "Congenital syphilitic choroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9941009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657796, + "CONCEPT_NAME" : "Neuroretinitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15992631000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655858, + "CONCEPT_NAME" : "Panuveitis caused by Borrelia burgdorferi", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870335005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655856, + "CONCEPT_NAME" : "Panuveitis caused by Mycobacterium tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870333003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4338890, + "CONCEPT_NAME" : "Candida retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231990003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655855, + "CONCEPT_NAME" : "Panuveitis caused by Herpesvirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870332008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783667, + "CONCEPT_NAME" : "Macular focal retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699757001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655854, + "CONCEPT_NAME" : "Panuveitis caused by Treponema pallidum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870331001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655853, + "CONCEPT_NAME" : "Panuveitis caused by parasite", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870330000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783669, + "CONCEPT_NAME" : "Peripheral focal retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699759003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783668, + "CONCEPT_NAME" : "Paramacular focal retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699758006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4230371, + "CONCEPT_NAME" : "Fungal chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359707007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4042904, + "CONCEPT_NAME" : "Choroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16553002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4198123, + "CONCEPT_NAME" : "Acute toxoplasmosis chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314031009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4198124, + "CONCEPT_NAME" : "Inactive toxoplasmosis chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314032002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195053, + "CONCEPT_NAME" : "Sarcoid chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312930008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195054, + "CONCEPT_NAME" : "Syphilitic chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312934004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655301, + "CONCEPT_NAME" : "Endophthalmitis caused by Ascaris lumbricoides", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "860836003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655813, + "CONCEPT_NAME" : "Posterior uveitis due to late syphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870273007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224242, + "CONCEPT_NAME" : "Herpes zoster retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "421029004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4319477, + "CONCEPT_NAME" : "Granulomatous retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95685006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4319476, + "CONCEPT_NAME" : "Granulomatous chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95682009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4187784, + "CONCEPT_NAME" : "Bacterial endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "413626002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4186870, + "CONCEPT_NAME" : "Candida endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "413746000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373963, + "CONCEPT_NAME" : "Histoplasma duboisii with retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187049007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4219534, + "CONCEPT_NAME" : "Cryptococcal endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416296007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373972, + "CONCEPT_NAME" : "Histoplasmosis with retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187058000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4213393, + "CONCEPT_NAME" : "Rubeola retinopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417145006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 608987, + "CONCEPT_NAME" : "Right chorioretinitis caused by Mycobacterium tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15991511000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 608986, + "CONCEPT_NAME" : "Left chorioretinitis caused by Mycobacterium tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15991471000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4195992, + "CONCEPT_NAME" : "Idiopathic retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312932000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378078, + "CONCEPT_NAME" : "Histoplasma capsulatum with retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187039009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436967, + "CONCEPT_NAME" : "Juxtapapillary focal choroiditis AND chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6313001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4214437, + "CONCEPT_NAME" : "Infectious endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414491002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4330151, + "CONCEPT_NAME" : "Cytomegaloviral retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22455005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434927, + "CONCEPT_NAME" : "Disseminated choroiditis AND chorioretinitis, posterior pole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51579006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4259500, + "CONCEPT_NAME" : "Syphilitic retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410470003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4259502, + "CONCEPT_NAME" : "Bartonella henselae neuroretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410472006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439017, + "CONCEPT_NAME" : "Peripheral focal choroiditis AND chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56787009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36676800, + "CONCEPT_NAME" : "Idiopathic posterior uveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "773991005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40480902, + "CONCEPT_NAME" : "Reactivation of toxoplasmosis chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441854007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4233536, + "CONCEPT_NAME" : "Focal retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359668007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46273984, + "CONCEPT_NAME" : "Cytomegalovirus chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "711616006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37309749, + "CONCEPT_NAME" : "Bilateral endophthalmitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15681681000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212083, + "CONCEPT_NAME" : "Toxoplasma neuroretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416913007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 380721, + "CONCEPT_NAME" : "Focal retinitis AND retinochoroiditis of other posterior pole", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51930008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4335988, + "CONCEPT_NAME" : "Bacterial chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231988004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4215673, + "CONCEPT_NAME" : "Cryptococcal chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416877003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4213114, + "CONCEPT_NAME" : "Fungal endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414303007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4090114, + "CONCEPT_NAME" : "Toxoplasmosis chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187194004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4221187, + "CONCEPT_NAME" : "Cryptococcal retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417547006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35624273, + "CONCEPT_NAME" : "Idiopathic panuveitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "766933000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435541, + "CONCEPT_NAME" : "Generalized disseminated choroiditis AND chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14894002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657060, + "CONCEPT_NAME" : "Bilateral disseminated chorioretinitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "346251000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4334872, + "CONCEPT_NAME" : "Viral retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231984002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4334873, + "CONCEPT_NAME" : "Toxocara chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231994007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37207894, + "CONCEPT_NAME" : "Chorioretinitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "336091000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174680, + "CONCEPT_NAME" : "Tuberculous disseminated chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48225000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684637, + "CONCEPT_NAME" : "Panuveitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "333391000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434033, + "CONCEPT_NAME" : "Chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46627006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440715, + "CONCEPT_NAME" : "Parasitic endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57100005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4102049, + "CONCEPT_NAME" : "General disseminated chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193444005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4102047, + "CONCEPT_NAME" : "Juxtapapillary focal chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193436005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37207954, + "CONCEPT_NAME" : "Chorioretinitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "341701000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37311893, + "CONCEPT_NAME" : "Posterior uveitis due to infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "789008006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4167058, + "CONCEPT_NAME" : "Epstein-Barr virus infection of the retina", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416195002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3663239, + "CONCEPT_NAME" : "Panuveitis caused by virus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "870329005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684701, + "CONCEPT_NAME" : "Panuveitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "339001000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439736, + "CONCEPT_NAME" : "Focal chorioretinitis due to acquired toxoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88290000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4162559, + "CONCEPT_NAME" : "Posterior pole focal chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "373667006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4087293, + "CONCEPT_NAME" : "Tuberculous chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186263000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3662320, + "CONCEPT_NAME" : "Chorioretinitis of left eye caused by secondary syphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15677881000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434638, + "CONCEPT_NAME" : "Paramacular focal retinitis AND retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42031001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4213641, + "CONCEPT_NAME" : "Chorioretinitis with coccidioidmycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417405005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3662329, + "CONCEPT_NAME" : "Bilateral retinitis of eyes caused by Treponema pallidum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685441000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3662328, + "CONCEPT_NAME" : "Bilateral retinitis of eyes caused by Toxoplasma gondii", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15685401000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438740, + "CONCEPT_NAME" : "Peripheral focal retinitis AND retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36535003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761311, + "CONCEPT_NAME" : "Chorioretinitis of left eye caused by Toxoplasma gondii", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15677681000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3662319, + "CONCEPT_NAME" : "Bilateral chorioretinitis of eyes caused by secondary syphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15677841000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3662318, + "CONCEPT_NAME" : "Chorioretinitis of right eye caused by secondary syphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15677801000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3655660, + "CONCEPT_NAME" : "Infectious neuroretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "866133000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443867, + "CONCEPT_NAME" : "Chronic endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13978000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3657173, + "CONCEPT_NAME" : "Bilateral acute endophthalmitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1099241000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37208019, + "CONCEPT_NAME" : "Acute endophthalmitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "348831000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761315, + "CONCEPT_NAME" : "Chronic endophthalmitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678481000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761314, + "CONCEPT_NAME" : "Chronic endophthalmitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15678441000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761313, + "CONCEPT_NAME" : "Chorioretinitis of right eye caused by Toxoplasma gondii", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15677761000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783425, + "CONCEPT_NAME" : "Juxtapapillary focal retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699516005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432621, + "CONCEPT_NAME" : "Purulent endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41720003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761312, + "CONCEPT_NAME" : "Chorioretinitis of bilateral eyes caused by Toxoplasma gondii", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15677721000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783424, + "CONCEPT_NAME" : "Focal retinitis of posterior pole of eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699515009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4215212, + "CONCEPT_NAME" : "Toxocara endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415737009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432630, + "CONCEPT_NAME" : "Juxtapapillary focal retinitis AND retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46497009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36684767, + "CONCEPT_NAME" : "Bilateral panuveitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "344751000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432631, + "CONCEPT_NAME" : "Metastatic disseminated retinitis AND retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61517002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4253619, + "CONCEPT_NAME" : "Panuveitis in Behcet's syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410481000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761343, + "CONCEPT_NAME" : "Endophthalmitis of left eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15681721000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 761342, + "CONCEPT_NAME" : "Endophthalmitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15681561000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37208000, + "CONCEPT_NAME" : "Bilateral chorioretinitis of eyes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "346921000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37208014, + "CONCEPT_NAME" : "Acute endophthalmitis of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "348381000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4307553, + "CONCEPT_NAME" : "Herpes zoster acute retinal necrosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "422471006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4338889, + "CONCEPT_NAME" : "Acute retinal necrosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231986000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37310633, + "CONCEPT_NAME" : "Exudative retinopathy of right eye", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "335161000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44783671, + "CONCEPT_NAME" : "Paramacular focal retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "699761007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108960, + "CONCEPT_NAME" : "Pigmented epithelial disseminated retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193446007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4150996, + "CONCEPT_NAME" : "Endogenous endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314548006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4150995, + "CONCEPT_NAME" : "Chronic postoperative endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314546005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4196116, + "CONCEPT_NAME" : "Tertiary syphilitic chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312955002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1340301, + "CONCEPT_NAME" : "Exacerbation of cytomegaloviral retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "OMOP5165956", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "OMOP Extension", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4109407, + "CONCEPT_NAME" : "Peripheral focal retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193438006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4338888, + "CONCEPT_NAME" : "Rubella retinopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "231985001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438971, + "CONCEPT_NAME" : "Syphilitic disseminated retinochoroiditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "77939001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4259505, + "CONCEPT_NAME" : "Postoperative endophthalmitis due to Propionibacterium acnes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410495002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4079919, + "CONCEPT_NAME" : "Phacoanaphylactic endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1833005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4217692, + "CONCEPT_NAME" : "Sterile endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415584007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4152067, + "CONCEPT_NAME" : "Postoperative endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "314544008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4216286, + "CONCEPT_NAME" : "Punctate outer retinal toxoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415218004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4213657, + "CONCEPT_NAME" : "Propionibacterium acnes endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "415182001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4253622, + "CONCEPT_NAME" : "Postoperative infectious endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "410497005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 7, + "name" : "OMOPUveitis Syphilis exclusion [conditions, measurements]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 3016587, + "CONCEPT_NAME" : "Treponema sp Ab [Presence] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26658-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3022622, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Units/volume] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17728-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3039384, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Units/volume] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51839-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3041149, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Specimen", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41122-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3010487, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Serum by Latex agglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17725-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3009946, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17724-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40766194, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63464-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3018457, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Serum by Immobilization", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5392-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3015378, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11597-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3032397, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Cerebral spinal fluid by Hemagglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49800-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3030785, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Cerebral spinal fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51474-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3043653, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Body fluid by Hemagglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39015-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3049422, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Body fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47511-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3007258, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Blood by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13288-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3023161, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Blood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22585-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42869548, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Serum or Plasma by Agglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "71793-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3007932, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Serum by Latex agglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5394-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3045488, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34382-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019539, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Serum by Hemagglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26009-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3010055, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22590-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4305738, + "CONCEPT_NAME" : "Treponema pallidum ELISA positive", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "390880002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3044651, + "CONCEPT_NAME" : "Treponema pallidum IgG+IgM Ab [Presence] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34147-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3031591, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Cerebral spinal fluid by Hemagglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50695-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3021604, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Units/volume] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17727-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3042468, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Presence] in Serum by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40680-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019832, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22587-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3005626, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Units/volume] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22594-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3051954, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47238-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3011981, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6561-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37051410, + "CONCEPT_NAME" : "Treponema pallidum Ab | Serum or Plasma | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376027-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37024028, + "CONCEPT_NAME" : "Treponema pallidum Ab | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376026-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1617714, + "CONCEPT_NAME" : "Reagin Ab and Treponema pallidum IgG and IgM and total panel - Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98212-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37053343, + "CONCEPT_NAME" : "Treponema pallidum Ab | Body fluid | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376024-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3048453, + "CONCEPT_NAME" : "Treponema pallidum IgG+IgM Ab [Presence] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47236-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3024286, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum by Immobilization", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17723-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3014044, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Cerebral spinal fluid by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "9826-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40760151, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57032-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3040021, + "CONCEPT_NAME" : "Treponema pallidum DNA [Presence] in Blood by NAA with probe detection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "53605-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3050642, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Presence] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47237-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37069707, + "CONCEPT_NAME" : "Treponema sp Ab | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376068-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3029998, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Cerebral spinal fluid by Hemagglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50689-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3030893, + "CONCEPT_NAME" : "Treponema pallidum IgG and IgM panel - Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34954-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37046128, + "CONCEPT_NAME" : "Treponema pallidum IgM | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376038-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3040742, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Serum by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40679-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3004772, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5393-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1617619, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Cerebral spinal fluid by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98215-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3029371, + "CONCEPT_NAME" : "Treponema pallidum Ab [Titer] in Cerebral spinal fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51475-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1617345, + "CONCEPT_NAME" : "Treponema pallidum IgM bands [Identifier] in Serum by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98223-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37056367, + "CONCEPT_NAME" : "Treponema pallidum Ab | Blood | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376023-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3015923, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17726-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3004786, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum by Agglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "24312-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3005900, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Presence] in Serum by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17729-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3039946, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Units/volume] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51838-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3020488, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Units/volume] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22592-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3011520, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "24110-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37064901, + "CONCEPT_NAME" : "Treponema pallidum Ab | XXX | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376028-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3028061, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum by Hemagglutination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8041-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3017178, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Presence] in Serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6562-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37035328, + "CONCEPT_NAME" : "Treponema pallidum Ab | Cerebral spinal fluid | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376025-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1616997, + "CONCEPT_NAME" : "Treponema pallidum Ab [Units/volume] in Cerebral spinal fluid by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98216-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019603, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Cerebral spinal fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22586-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4247368, + "CONCEPT_NAME" : "Treponema pallidum hemagglutination test positive", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406116009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1617166, + "CONCEPT_NAME" : "Reagin Ab and Treponema pallidum IgG and IgM and total panel - Cerebral spinal fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98214-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1618180, + "CONCEPT_NAME" : "Reagin Ab and Treponema pallidum IgG and IgM and total panel | Serum | Microbiology Panels", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP428626-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37076241, + "CONCEPT_NAME" : "Treponema pallidum DNA | Blood | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376040-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37051934, + "CONCEPT_NAME" : "Treponema pallidum IgG+IgM | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376031-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3051627, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Serum from Donor by Immunoassay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47361-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43533776, + "CONCEPT_NAME" : "Reagin and Treponema pallidum IgG and IgM [Interpretation] in Serum or Plasma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73752-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40771087, + "CONCEPT_NAME" : "Treponema pallidum IgG and IgM panel - Serum Qualitative by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68502-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37050546, + "CONCEPT_NAME" : "Treponema pallidum IgG | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376033-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019428, + "CONCEPT_NAME" : "Reagin Ab [Presence] in Serum by VDRL", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5292-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3049377, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Serum from Donor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47513-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1616824, + "CONCEPT_NAME" : "Treponema pallidum IgG and IgM and bands panel - Serum by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98213-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1616562, + "CONCEPT_NAME" : "Treponema pallidum IgG bands [Identifier] in Serum by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98221-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3029634, + "CONCEPT_NAME" : "Reagin Ab [Titer] in Serum by VDRL", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50690-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37063672, + "CONCEPT_NAME" : "Treponema pallidum IgG and IgM panel | Serum | Microbiology Panels", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP380120-8", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1616440, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Cerebral spinal fluid by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98220-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3001356, + "CONCEPT_NAME" : "Reagin Ab [Units/volume] in Serum by VDRL", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5291-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37062153, + "CONCEPT_NAME" : "Reagin Ab and Treponema pallidum Ab IgG and IgM | Serum or Plasma | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376051-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1616967, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Titer] in Cerebral spinal fluid by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98217-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3002446, + "CONCEPT_NAME" : "Reagin Ab [Presence] in Cerebral spinal fluid by VDRL", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5290-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1617505, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Titer] in Cerebral spinal fluid by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98218-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1618534, + "CONCEPT_NAME" : "Treponema pallidum IgG and IgM and bands panel | Serum | Microbiology Panels", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP428629-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37044896, + "CONCEPT_NAME" : "Treponema pallidum IgG | Donor | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP376035-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3006157, + "CONCEPT_NAME" : "Reagin Ab [Titer] in Cerebral spinal fluid by VDRL", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31146-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1618170, + "CONCEPT_NAME" : "Reagin Ab and Treponema pallidum IgG and IgM and total panel | Cerebral spinal fluid | Microbiology Panels", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP428625-0", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 1991140, + "CONCEPT_NAME" : "Treponema pallidum Ab.IgG bands | Serum | Microbiology", + "STANDARD_CONCEPT" : "C", + "STANDARD_CONCEPT_CAPTION" : "Classification", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "LP431735-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "LOINC Hierarchy" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3052315, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Units/volume] in Cerebral spinal fluid by Immunofluorescence", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47063-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40761135, + "CONCEPT_NAME" : "Treponema pallidum IgG Ab [Presence] in Cerebral spinal fluid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58031-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3046248, + "CONCEPT_NAME" : "Treponema pallidum Ab [Presence] in Serum from Donor", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46206-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42868435, + "CONCEPT_NAME" : "Treponema pallidum IgM Ab [Presence] in Cerebral spinal fluid by Immunoblot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69946-2", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019960, + "CONCEPT_NAME" : "Reagin Ab [Units/volume] in Cerebral spinal fluid by VDRL", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5289-4", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 8, + "name" : "OMOPUveitis Sarcoidosis exclusion [conditions, observations]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4130903, + "CONCEPT_NAME" : "Bilateral hilar adenopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "264508001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4163983, + "CONCEPT_NAME" : "Granuloma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45647009", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Morph Abnormality" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4322821, + "CONCEPT_NAME" : "Non-necrotizing granulomatous inflammation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "71282004", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Morph Abnormality" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4281245, + "CONCEPT_NAME" : "Sarcoid type granuloma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "66146003", + "DOMAIN_ID" : "Observation", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Morph Abnormality" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4081069, + "CONCEPT_NAME" : "Lofgrens syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238676008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4338094, + "CONCEPT_NAME" : "Hilar lymphadenopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87500009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 10, + "name" : "OMOPUveitis Anterior vitreous cell [conditions, measurements]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4082268, + "CONCEPT_NAME" : "Vitreous cells", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "247086006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4317991, + "CONCEPT_NAME" : "Vitritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95802009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4082269, + "CONCEPT_NAME" : "Vitreous inflammatory infiltrate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "247087002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3019458, + "CONCEPT_NAME" : "Physical findings of Right vitreous body Narrative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29103-9", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3004523, + "CONCEPT_NAME" : "Physical findings of Left vitreous body Narrative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29104-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Clinical Observation" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 12, + "name" : "OMOPUveitis HSV AC PCR exclusion [measurements, specimen]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4122252, + "CONCEPT_NAME" : "Aqueous humor sample", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "258444001", + "DOMAIN_ID" : "Specimen", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Specimen" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37394108, + "CONCEPT_NAME" : "Herpes simplex polymerase chain reaction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1026651000000104", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Observable Entity" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4163737, + "CONCEPT_NAME" : "PCR test for Herpes simplex", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399191001", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 13, + "name" : "OMOPUveitis VZV AC PCR exclusion [measurements, specimen]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4122252, + "CONCEPT_NAME" : "Aqueous humor sample", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "258444001", + "DOMAIN_ID" : "Specimen", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Specimen" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44808404, + "CONCEPT_NAME" : "Detection of Varicella zoster virus using polymerase chain reaction technique", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "829501000000108", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046130, + "CONCEPT_NAME" : "Varicella virus DNA assay", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "122306004", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 15, + "name" : "OMOPUveitis CMV Diagnosis [conditions]", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 35205780, + "CONCEPT_NAME" : "Other cytomegaloviral diseases", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "B25.8", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "4-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 35205781, + "CONCEPT_NAME" : "Cytomegaloviral disease, unspecified", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "B25.9", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "ICD10CM", + "CONCEPT_CLASS_ID" : "4-char billing code" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + }, + { + "concept" : { + "CONCEPT_ID" : 440032, + "CONCEPT_NAME" : "Cytomegalovirus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28944009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : true + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Evidence of cytomegalovirus infection in the eye", + "description" : "a. Positive PCR for cytomegalovirus on aqueous specimen (observations, measurements)", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "Specimen" : { + "CorrelatedCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 1, + "MeasurementTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Observation" : { + "CodesetId" : 1, + "ObservationTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 1, + "SpecimenTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 15, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "no retinitis [conditions]", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 6, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "no syphilis [measurements]", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 7, + "MeasurementTypeExclude" : false, + "ValueAsConcept" : [ + { + "CONCEPT_ID" : 9191, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10828004", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45884084, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA6576-8", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "no sarcoidosis [conditions, observations]", + "expression" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 8, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Observation" : { + "CodesetId" : 8, + "ObservationTypeExclude" : false, + "ValueAsConcept" : [ + { + "CONCEPT_ID" : 4181412, + "CONCEPT_NAME" : "Present", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "52101004", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45879438, + "CONCEPT_NAME" : "Present", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA9633-4", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45884084, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA6576-8", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9191, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10828004", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "no HSV AC PCR [measurements]", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 12, + "MeasurementTypeExclude" : false, + "ValueAsConcept" : [ + { + "CONCEPT_ID" : 9191, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10828004", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45884084, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA6576-8", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Specimen" : { + "CodesetId" : 12, + "SpecimenTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "no VZV AC PCR [measurements]", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 13, + "MeasurementTypeExclude" : false, + "ValueAsConcept" : [ + { + "CONCEPT_ID" : 45884084, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "LA6576-8", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9191, + "CONCEPT_NAME" : "Positive", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10828004", + "DOMAIN_ID" : "Meas Value", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : true, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Specimen" : { + "CodesetId" : 13, + "SpecimenTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 1, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1073.json b/tests/cohorts/1073.json new file mode 100644 index 00000000..e925a991 --- /dev/null +++ b/tests/cohorts/1073.json @@ -0,0 +1,8247 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 8, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Death" : { + "DeathTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 12, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 13, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 14, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 8, + "name" : "Inpatient or ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 12, + "name" : "Serious Infections ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4326255, + "CONCEPT_NAME" : "Abdominal abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75100008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193522, + "CONCEPT_NAME" : "Acute prostatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79411002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4324289, + "CONCEPT_NAME" : "Allergic encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70884002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4176250, + "CONCEPT_NAME" : "Allergic encephalomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50776006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4094215, + "CONCEPT_NAME" : "Allergic gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26006005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192674, + "CONCEPT_NAME" : "Allergic gastroenteritis and colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266451002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4326601, + "CONCEPT_NAME" : "Anorectal abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75236001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4050869, + "CONCEPT_NAME" : "Atypical pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233606009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132736, + "CONCEPT_NAME" : "Bacteremia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5758002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436339, + "CONCEPT_NAME" : "Bacterial infection due to Klebsiella pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186435004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435613, + "CONCEPT_NAME" : "Cellulitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128045006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193814, + "CONCEPT_NAME" : "Chronic parametritis and pelvic cellulitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198159006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195453, + "CONCEPT_NAME" : "Colitis, enteritis and gastroenteritis presumed infectious", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266081001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435318, + "CONCEPT_NAME" : "Complete miscarriage with genital tract or pelvic infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198655001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4068969, + "CONCEPT_NAME" : "Congenital malformation of corpus callosum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "204042007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345447, + "CONCEPT_NAME" : "Cutaneous erysipeloid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240394009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378143, + "CONCEPT_NAME" : "Encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45170000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441589, + "CONCEPT_NAME" : "Endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56819008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443406, + "CONCEPT_NAME" : "Eosinophilic gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359804008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4098889, + "CONCEPT_NAME" : "Experimental allergic encephalomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27040004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195306, + "CONCEPT_NAME" : "Gastroduodenitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "196731005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4101468, + "CONCEPT_NAME" : "Gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25374005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256036, + "CONCEPT_NAME" : "Hemorrhagic varicella pneumonitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31920006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770836, + "CONCEPT_NAME" : "Herpes zoster myelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98541000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 76034, + "CONCEPT_NAME" : "Herpetic whitlow", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43891009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195317, + "CONCEPT_NAME" : "Incomplete miscarriage with genital tract or pelvic infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198644001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4231983, + "CONCEPT_NAME" : "Infection due to Mycoplasma pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406595002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4262720, + "CONCEPT_NAME" : "Ischiorectal abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36046008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434866, + "CONCEPT_NAME" : "Late effects of viral encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "110269000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4027461, + "CONCEPT_NAME" : "Leukoencephalopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22811006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435785, + "CONCEPT_NAME" : "Meningitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7180009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141663, + "CONCEPT_NAME" : "Osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60168000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373412, + "CONCEPT_NAME" : "Otitis externa due to Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36292003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438350, + "CONCEPT_NAME" : "Pneumocystosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88860002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 255848, + "CONCEPT_NAME" : "Pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233604007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444099, + "CONCEPT_NAME" : "Pneumonitis due to acquired toxoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46207001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712850, + "CONCEPT_NAME" : "Pneumonitis due to Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12571000132104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192670, + "CONCEPT_NAME" : "Portal pyemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67656006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42872891, + "CONCEPT_NAME" : "Posterior reversible encephalopathy syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "450886002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433957, + "CONCEPT_NAME" : "Progressive multifocal leukoencephalopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22255007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 253954, + "CONCEPT_NAME" : "Pulmonary tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "154283005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198199, + "CONCEPT_NAME" : "Pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45816000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4169568, + "CONCEPT_NAME" : "Rheumatic endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48872007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196328, + "CONCEPT_NAME" : "Salmonella gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42338000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132797, + "CONCEPT_NAME" : "Sepsis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91302008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196236, + "CONCEPT_NAME" : "Septic shock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "76571007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195461, + "CONCEPT_NAME" : "Staphylococcal enterocolitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "32527003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4091167, + "CONCEPT_NAME" : "Tuberculosis of lung, bacteriologically and histologically negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186203002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4206579, + "CONCEPT_NAME" : "Varicella-zoster virus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309465005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 13, + "name" : "Opportunistic Infections with tuberculosis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4087776, + "CONCEPT_NAME" : "Acute pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187027001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434281, + "CONCEPT_NAME" : "Aspergillosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "65553006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440330, + "CONCEPT_NAME" : "Bartonellosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266123003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433146, + "CONCEPT_NAME" : "Blastomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "69996000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433415, + "CONCEPT_NAME" : "Candidal endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63553008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260041, + "CONCEPT_NAME" : "Candidiasis of lung", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3487004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 28974, + "CONCEPT_NAME" : "Candidiasis of the esophagus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20639004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260034, + "CONCEPT_NAME" : "Chronic pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233615002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437217, + "CONCEPT_NAME" : "Coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60826002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440035, + "CONCEPT_NAME" : "Cryptococcosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42386007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4329093, + "CONCEPT_NAME" : "Disease due to BK polyomavirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "431258001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4029319, + "CONCEPT_NAME" : "Disseminated herpes simplex", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13710008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4205455, + "CONCEPT_NAME" : "Disseminated herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55560002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757252, + "CONCEPT_NAME" : "Herpes simplex hepatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1087101000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4051338, + "CONCEPT_NAME" : "Herpes simplex pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233624006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443943, + "CONCEPT_NAME" : "Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4740000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 138682, + "CONCEPT_NAME" : "Herpes zoster auricularis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21954000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4045976, + "CONCEPT_NAME" : "Herpes zoster encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230176008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770836, + "CONCEPT_NAME" : "Herpes zoster myelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98541000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437489, + "CONCEPT_NAME" : "Herpes zoster with complication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49183009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440323, + "CONCEPT_NAME" : "Herpes zoster with meningitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10491005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436336, + "CONCEPT_NAME" : "Herpes zoster with nervous system complication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111861003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440329, + "CONCEPT_NAME" : "Herpes zoster without complication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111859007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433134, + "CONCEPT_NAME" : "Histoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12962009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436040, + "CONCEPT_NAME" : "Infection by Strongyloides", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1214006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438077, + "CONCEPT_NAME" : "Invasive candidiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70572005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4097550, + "CONCEPT_NAME" : "Legionella infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26726000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438059, + "CONCEPT_NAME" : "Listeriosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4241002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440631, + "CONCEPT_NAME" : "Mycobacteriosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88415009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174281, + "CONCEPT_NAME" : "Non-tuberculous mycobacterial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "277869007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373412, + "CONCEPT_NAME" : "Otitis externa due to Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36292003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438350, + "CONCEPT_NAME" : "Pneumocystosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88860002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256909, + "CONCEPT_NAME" : "Primary pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88036000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433957, + "CONCEPT_NAME" : "Progressive multifocal leukoencephalopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22255007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443741, + "CONCEPT_NAME" : "Pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417018008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434859, + "CONCEPT_NAME" : "Sporotrichosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42094007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434557, + "CONCEPT_NAME" : "Tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56717001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4211951, + "CONCEPT_NAME" : "Varicella-zoster virus eyelid dermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416718008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 14, + "name" : "Other infections of interest", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 192549, + "CONCEPT_NAME" : "Abdominal actinomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43894001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530817, + "CONCEPT_NAME" : "Abrasion and/or friction burn of upper limb, infected", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "609338009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444249, + "CONCEPT_NAME" : "Abrasion and/or friction burn with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82117004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436020, + "CONCEPT_NAME" : "Actinomycotic infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11817007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437899, + "CONCEPT_NAME" : "Acute and subacute bacterial endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266237004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435563, + "CONCEPT_NAME" : "Acute and subacute infective endocarditis associated with another disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194926000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198978, + "CONCEPT_NAME" : "Acute gonorrhea of lower genitourinary tract", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "54825009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4001819, + "CONCEPT_NAME" : "Acute hematogenous osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203179003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 374947, + "CONCEPT_NAME" : "Acute infection of pinna", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56663002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4115044, + "CONCEPT_NAME" : "Acute infective exacerbation of chronic obstructive airways disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "285381006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 374925, + "CONCEPT_NAME" : "Acute infective polyneuritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "129131007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4307774, + "CONCEPT_NAME" : "Acute lower respiratory tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195742007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4051332, + "CONCEPT_NAME" : "Acute mycoplasmal bronchitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233599001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133002, + "CONCEPT_NAME" : "Acute osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "409780002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 135350, + "CONCEPT_NAME" : "Acute osteomyelitis of ankle and/or foot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268017000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4001282, + "CONCEPT_NAME" : "Acute osteomyelitis of femur", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203170004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141662, + "CONCEPT_NAME" : "Acute osteomyelitis of hand", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10188004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141944, + "CONCEPT_NAME" : "Acute osteomyelitis of humerus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203164005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141666, + "CONCEPT_NAME" : "Acute osteomyelitis of lower leg", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203153007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133570, + "CONCEPT_NAME" : "Acute osteomyelitis of pelvic region and/or thigh", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268016009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4087776, + "CONCEPT_NAME" : "Acute pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187027001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4280571, + "CONCEPT_NAME" : "Acute pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36689008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196735, + "CONCEPT_NAME" : "Acute pyelonephritis without medullary necrosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197768004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4158412, + "CONCEPT_NAME" : "Acute suppurative arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372940009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 257011, + "CONCEPT_NAME" : "Acute upper respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "54398005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 258453, + "CONCEPT_NAME" : "Acute upper respiratory infection of multiple sites", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78337007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4331815, + "CONCEPT_NAME" : "Acute urinary tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "431309003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194560, + "CONCEPT_NAME" : "Amebic liver abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75119003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 76022, + "CONCEPT_NAME" : "Amebic nondysenteric colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55023005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437936, + "CONCEPT_NAME" : "Amniotic cavity infection - delivered", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199677008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4188108, + "CONCEPT_NAME" : "Ancylostomiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63479002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37108588, + "CONCEPT_NAME" : "Arthritis of left knee caused by bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1073331000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192259, + "CONCEPT_NAME" : "Ascariasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2435008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434281, + "CONCEPT_NAME" : "Aspergillosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "65553006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439730, + "CONCEPT_NAME" : "Babesiosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21061004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4167984, + "CONCEPT_NAME" : "Bacterial arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48245008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4196020, + "CONCEPT_NAME" : "Bacterial arthritis of elbow", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "431263002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4197765, + "CONCEPT_NAME" : "Bacterial arthritis of hip", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "431606003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193402, + "CONCEPT_NAME" : "Bacterial enteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75375008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441500, + "CONCEPT_NAME" : "Bacterial food poisoning", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "66107000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436339, + "CONCEPT_NAME" : "Bacterial infection due to Klebsiella pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186435004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4094504, + "CONCEPT_NAME" : "Bacterial infection due to Proteus mirabilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26195002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438064, + "CONCEPT_NAME" : "Bacterial infection due to Pseudomonas", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63398001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432545, + "CONCEPT_NAME" : "Bacterial infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87628006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436091, + "CONCEPT_NAME" : "Bacterial meningitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95883001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 258458, + "CONCEPT_NAME" : "Bacterial pleurisy with effusion", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "85426002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 257315, + "CONCEPT_NAME" : "Bacterial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "53084003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442574, + "CONCEPT_NAME" : "Blister of foot with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78561001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4200680, + "CONCEPT_NAME" : "Bockhart impetigo", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "53396004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4150302, + "CONCEPT_NAME" : "Candida angular cheilitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "278521000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4084966, + "CONCEPT_NAME" : "Candida infection of genital region", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240706001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4199600, + "CONCEPT_NAME" : "Candidal balanitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52643007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 372247, + "CONCEPT_NAME" : "Candidal otitis externa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16681000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433968, + "CONCEPT_NAME" : "Candidiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78048006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260041, + "CONCEPT_NAME" : "Candidiasis of lung", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3487004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 29735, + "CONCEPT_NAME" : "Candidiasis of mouth", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79740000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133414, + "CONCEPT_NAME" : "Candidiasis of skin and nails", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187014000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 28974, + "CONCEPT_NAME" : "Candidiasis of the esophagus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20639004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80951, + "CONCEPT_NAME" : "Candidiasis of urogenital site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111904009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198363, + "CONCEPT_NAME" : "Candidiasis of vagina", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "72934000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212079, + "CONCEPT_NAME" : "Carbuncle", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416893007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4069115, + "CONCEPT_NAME" : "Carbuncle of chest wall", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17438000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444418, + "CONCEPT_NAME" : "Carbuncle of face", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91356001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 200171, + "CONCEPT_NAME" : "Carbuncle of skin and/or subcutaneous tissue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91374005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438066, + "CONCEPT_NAME" : "Chlamydial infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "105629000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 72245, + "CONCEPT_NAME" : "Chlamydial infection of lower genitourinary tract", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186729003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4126282, + "CONCEPT_NAME" : "Chlamydial urethritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "236683007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4127408, + "CONCEPT_NAME" : "Chlamydial vulvovaginitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "237097008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437221, + "CONCEPT_NAME" : "Chlamydia trachomatis infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240589008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4344638, + "CONCEPT_NAME" : "Cholera due to Vibrio cholerae O1 Classical biotype", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240349003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4021397, + "CONCEPT_NAME" : "Chorioamnionitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11612004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260730, + "CONCEPT_NAME" : "Chronic atticoantral suppurative otitis media", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41954005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201503, + "CONCEPT_NAME" : "Chronic gonococcal prostatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60893000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193132, + "CONCEPT_NAME" : "Chronic gonorrhea lower genitourinary tract", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186915005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 135722, + "CONCEPT_NAME" : "Chronic infection of amputation stump", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "213245002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 380407, + "CONCEPT_NAME" : "Chronic infective otitis externa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "232224009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198671, + "CONCEPT_NAME" : "Chronic intestinal amebiasis without abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111911008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4344376, + "CONCEPT_NAME" : "Chronic multifocal osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240151005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373200, + "CONCEPT_NAME" : "Chronic mycotic otitis externa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111898002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4110056, + "CONCEPT_NAME" : "Chronic obstructive pulmonary disease with acute lower respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "196001008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134735, + "CONCEPT_NAME" : "Chronic osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40970001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137077, + "CONCEPT_NAME" : "Chronic osteomyelitis of ankle and/or foot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268019002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46271951, + "CONCEPT_NAME" : "Chronic osteomyelitis of ankle and/or foot with draining sinus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "710231001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134454, + "CONCEPT_NAME" : "Chronic osteomyelitis of forearm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203186006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4122186, + "CONCEPT_NAME" : "Chronic osteomyelitis of hip", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "287055001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134141, + "CONCEPT_NAME" : "Chronic osteomyelitis of lower leg", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203189004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46270395, + "CONCEPT_NAME" : "Chronic osteomyelitis of lower leg with draining sinus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "295881000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137367, + "CONCEPT_NAME" : "Chronic osteomyelitis of pelvic region and/or thigh", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "268018005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260034, + "CONCEPT_NAME" : "Chronic pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233615002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4096917, + "CONCEPT_NAME" : "Chronic pulmonary histoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26427008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377886, + "CONCEPT_NAME" : "Chronic purulent otitis media", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38394007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4269363, + "CONCEPT_NAME" : "Chronic pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63302006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199872, + "CONCEPT_NAME" : "Chronic pyelonephritis without medullary necrosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197760006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 375290, + "CONCEPT_NAME" : "Chronic tubotympanic suppurative otitis media", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87665008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537043, + "CONCEPT_NAME" : "CLABSI - central line associated bloodstream infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "736152001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4307981, + "CONCEPT_NAME" : "Clostridium difficile colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "423590009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193688, + "CONCEPT_NAME" : "Clostridium difficile infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186431008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437217, + "CONCEPT_NAME" : "Coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60826002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433401, + "CONCEPT_NAME" : "Coccidiosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "62005008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4241576, + "CONCEPT_NAME" : "Congenital syphilitic osteochondritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58392004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 372241, + "CONCEPT_NAME" : "Creutzfeldt-Jakob disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "792004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260134, + "CONCEPT_NAME" : "Croup", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "71186008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432310, + "CONCEPT_NAME" : "Cryptococcal meningitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14232007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440035, + "CONCEPT_NAME" : "Cryptococcosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42386007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4276193, + "CONCEPT_NAME" : "Cutaneous nocardiosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64650008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 200017, + "CONCEPT_NAME" : "Cyclosporiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240372001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 140654, + "CONCEPT_NAME" : "Deep seated dermatophytosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266152000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137213, + "CONCEPT_NAME" : "Dermal mycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14560005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 135473, + "CONCEPT_NAME" : "Dermatophytosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47382004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137497, + "CONCEPT_NAME" : "Dermatophytosis of the body", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266151007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432251, + "CONCEPT_NAME" : "Disease caused by parasite", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17322007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435742, + "CONCEPT_NAME" : "Disease due to Gram-negative bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371583007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443739, + "CONCEPT_NAME" : "Disease due to Rickettsia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416829003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432250, + "CONCEPT_NAME" : "Disorder due to infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40733004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4347525, + "CONCEPT_NAME" : "Disseminated atypical mycobacterial infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240413000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4154415, + "CONCEPT_NAME" : "Disseminated infection due to Mycobacterium avium-intracellulare group", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371687002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434570, + "CONCEPT_NAME" : "Early congenital syphilis with symptoms", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266125005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4346971, + "CONCEPT_NAME" : "Elbow pyogenic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239779001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 374352, + "CONCEPT_NAME" : "Elephantiasis of eyelid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14100003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4238808, + "CONCEPT_NAME" : "Empyema of pleura", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58554001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 261883, + "CONCEPT_NAME" : "Empyema with fistula", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "271503005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198334, + "CONCEPT_NAME" : "Enteric campylobacteriosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18081009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443462, + "CONCEPT_NAME" : "Enteritis due to Candida", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426507006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199718, + "CONCEPT_NAME" : "Enteritis due to rotavirus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186150001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 197223, + "CONCEPT_NAME" : "Enterobiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266162007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345206, + "CONCEPT_NAME" : "Enteropathogenic Escherichia coli gastrointestinal tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240353001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345354, + "CONCEPT_NAME" : "Enterotoxigenic Escherichia coli gastrointestinal tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240352006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 138346, + "CONCEPT_NAME" : "Erysipelas", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "44653001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 135745, + "CONCEPT_NAME" : "Exanthema subitum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "54385001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199067, + "CONCEPT_NAME" : "Female pelvic inflammatory disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198130006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4161947, + "CONCEPT_NAME" : "Fournier's gangrene", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "398318005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4220002, + "CONCEPT_NAME" : "Furuncle", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "416675009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4238732, + "CONCEPT_NAME" : "Furuncle of abdominal wall", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91221002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4324705, + "CONCEPT_NAME" : "Furuncle of back, except buttock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "71694002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198822, + "CONCEPT_NAME" : "Furuncle of buttock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12430003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4106878, + "CONCEPT_NAME" : "Furuncle of chest wall", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29723007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132391, + "CONCEPT_NAME" : "Furuncle of face", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "37396007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4071026, + "CONCEPT_NAME" : "Furuncle of groin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21869003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 759835, + "CONCEPT_NAME" : "Furuncle of left lower limb", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10627191000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436188, + "CONCEPT_NAME" : "Furuncle of neck", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47763005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37396146, + "CONCEPT_NAME" : "Gastrointestinal infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "715852004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 79732, + "CONCEPT_NAME" : "Genitourinary chlamydia infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312099009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 77340, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267204006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81357, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy - delivered", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199106001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80778, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy - delivered with postnatal complication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199107005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 74415, + "CONCEPT_NAME" : "Genitourinary tract infection in pregnancy - not delivered", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199108000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437202, + "CONCEPT_NAME" : "Giardiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58265007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757250, + "CONCEPT_NAME" : "Gonococcal pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1087061000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199726, + "CONCEPT_NAME" : "Granuloma inguinale", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28867007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260754, + "CONCEPT_NAME" : "Haemophilus influenzae pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70036007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437538, + "CONCEPT_NAME" : "Haemophilus meningitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192643004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194087, + "CONCEPT_NAME" : "Hepatitis due to infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235862008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378078, + "CONCEPT_NAME" : "Histoplasma capsulatum with retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187039009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433134, + "CONCEPT_NAME" : "Histoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12962009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373972, + "CONCEPT_NAME" : "Histoplasmosis with retinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187058000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443204, + "CONCEPT_NAME" : "Human ehrlichiosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240626005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 140480, + "CONCEPT_NAME" : "Impetigo", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48277006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4160460, + "CONCEPT_NAME" : "Impetigo bullosa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399183005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4340497, + "CONCEPT_NAME" : "Infected pancreatic necrosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235960001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40480515, + "CONCEPT_NAME" : "Infected seroma after surgical procedure", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441795000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43021258, + "CONCEPT_NAME" : "Infection associated with implant", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "473048005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43021283, + "CONCEPT_NAME" : "Infection associated with vascular device", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "473083009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40478938, + "CONCEPT_NAME" : "Infection by Bacteroides fragilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444313007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481816, + "CONCEPT_NAME" : "Infection by methicillin sensitive Staphylococcus aureus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442073005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4200532, + "CONCEPT_NAME" : "Infection by site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "301810000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434872, + "CONCEPT_NAME" : "Infection by Trichomonas", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56335008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4309542, + "CONCEPT_NAME" : "Infection due to anaerobic bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "423451008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441786, + "CONCEPT_NAME" : "Infection due to Bordetella parapertussis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "77116006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443535, + "CONCEPT_NAME" : "Infection due to enterococcus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406574007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440320, + "CONCEPT_NAME" : "Infection due to Escherichia coli", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "71057007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4157605, + "CONCEPT_NAME" : "Infection due to resistant organism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372292006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432249, + "CONCEPT_NAME" : "Infection due to Toxocara", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406619001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4050438, + "CONCEPT_NAME" : "Infection following infusion, injection, transfusion AND/OR vaccination", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23301003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436180, + "CONCEPT_NAME" : "Infection of amniotic cavity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10573002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4176170, + "CONCEPT_NAME" : "Infection of amputation stump", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "427769002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 72410, + "CONCEPT_NAME" : "Infection of bone", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111253001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40483549, + "CONCEPT_NAME" : "Infection of bone of ankle and/or foot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442449006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481969, + "CONCEPT_NAME" : "Infection of bone of hand", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "445012003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481970, + "CONCEPT_NAME" : "Infection of bone of pelvic region and/or femur", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "445013008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40480731, + "CONCEPT_NAME" : "Infection of bone of shoulder girdle", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444785006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40485376, + "CONCEPT_NAME" : "Infection of gastrostomy site", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "442858008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4067312, + "CONCEPT_NAME" : "Infection of intervertebral disc - pyogenic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "202756004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201093, + "CONCEPT_NAME" : "Infection of skin and/or subcutaneous tissue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19824006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4159147, + "CONCEPT_NAME" : "Infection resistant to penicillin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371095004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4063038, + "CONCEPT_NAME" : "Infections of bladder in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199205008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4060295, + "CONCEPT_NAME" : "Infections of kidney in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199110003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4060296, + "CONCEPT_NAME" : "Infections of the genital tract in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199112006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198337, + "CONCEPT_NAME" : "Infectious diarrheal disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19213003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4180167, + "CONCEPT_NAME" : "Infectious disorder of joint", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "363162000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192964, + "CONCEPT_NAME" : "Infectious disorder of kidney", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "129128006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4214438, + "CONCEPT_NAME" : "Infectious eczematoid dermatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414492009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440716, + "CONCEPT_NAME" : "Infectious secondary iridocyclitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "89114005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4262590, + "CONCEPT_NAME" : "Infective arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "396234004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481620, + "CONCEPT_NAME" : "Infective arthritis of ankle and/or foot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444999002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40483813, + "CONCEPT_NAME" : "Infective arthritis of elbow", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "445495007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4177365, + "CONCEPT_NAME" : "Infective arthritis of joint of hand", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "428385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481619, + "CONCEPT_NAME" : "Infective arthritis of pelvis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444998005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37117135, + "CONCEPT_NAME" : "Infective arthritis of right knee", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1073511000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4180873, + "CONCEPT_NAME" : "Infective arthritis of shoulder region", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "428437005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40483847, + "CONCEPT_NAME" : "Infective arthritis of wrist", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "445525001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4119460, + "CONCEPT_NAME" : "Infective endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233850007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 76508, + "CONCEPT_NAME" : "Infective myositis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "29689003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4001126, + "CONCEPT_NAME" : "Infective myositis of thigh", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203016003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4001124, + "CONCEPT_NAME" : "Infective myositis of upper arm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203012001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 381859, + "CONCEPT_NAME" : "Infective otitis externa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "86981007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443410, + "CONCEPT_NAME" : "Infective pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312342009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441799, + "CONCEPT_NAME" : "Infestation by fly larvae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60412004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260936, + "CONCEPT_NAME" : "Infiltrative lung tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186175002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134284, + "CONCEPT_NAME" : "Initial lesion of yaws", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49442000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137441, + "CONCEPT_NAME" : "Insect bite, nonvenomous, of foot and toe, infected", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "269206003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192815, + "CONCEPT_NAME" : "Intestinal infection due to E. coli", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111839008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195462, + "CONCEPT_NAME" : "Intestinal infection due to Pseudomonas", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82930004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198678, + "CONCEPT_NAME" : "Intestinal infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266071000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4214519, + "CONCEPT_NAME" : "Intestinal infectious disease due to anaerobic bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "414529006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438077, + "CONCEPT_NAME" : "Invasive candidiasis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70572005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4137770, + "CONCEPT_NAME" : "Invasive pulmonary aspergillosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3214003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4346970, + "CONCEPT_NAME" : "Knee pyogenic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239777004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4092828, + "CONCEPT_NAME" : "Latent early syphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186867005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4112820, + "CONCEPT_NAME" : "Legionella pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195889001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443600, + "CONCEPT_NAME" : "Localized infection of skin AND/OR subcutaneous tissue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "430348006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4141757, + "CONCEPT_NAME" : "Lyme arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "33937009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440638, + "CONCEPT_NAME" : "Lyme disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23502006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440473, + "CONCEPT_NAME" : "Major puerperal infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40125005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438067, + "CONCEPT_NAME" : "Malaria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61462000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437881, + "CONCEPT_NAME" : "Malignant otitis externa", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "94146005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443291, + "CONCEPT_NAME" : "Maternal syphilis during pregnancy, childbirth and the puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "199154009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436621, + "CONCEPT_NAME" : "Meningococcal infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23511006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440940, + "CONCEPT_NAME" : "Methicillin resistant Staphylococcus aureus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266096002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434559, + "CONCEPT_NAME" : "Miliary tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "47604008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 376422, + "CONCEPT_NAME" : "Mucopurulent conjunctivitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "243462001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440631, + "CONCEPT_NAME" : "Mycobacteriosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88415009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436900, + "CONCEPT_NAME" : "Mycoplasma infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186464008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440431, + "CONCEPT_NAME" : "Mycoplasma pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46970008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433701, + "CONCEPT_NAME" : "Mycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3218000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133566, + "CONCEPT_NAME" : "Necrotizing fasciitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52486002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4047937, + "CONCEPT_NAME" : "Neonatal urinary tract infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12301009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 375738, + "CONCEPT_NAME" : "Neurosyphilis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26039008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4030846, + "CONCEPT_NAME" : "Non-bullous impetigo", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238374001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201792, + "CONCEPT_NAME" : "Nongonococcal urethritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84619001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194685, + "CONCEPT_NAME" : "Non-obstructive reflux-associated chronic pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197764002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174281, + "CONCEPT_NAME" : "Non-tuberculous mycobacterial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "277869007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137425, + "CONCEPT_NAME" : "Nonvenomous insect bite of trunk with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "19108007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 136575, + "CONCEPT_NAME" : "Nonvenomous insect bite with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10461000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201136, + "CONCEPT_NAME" : "Omphalitis of the newborn", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42052009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 140648, + "CONCEPT_NAME" : "Onychomycosis due to dermatophyte", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "402134005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432248, + "CONCEPT_NAME" : "Opportunistic mycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78999002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141663, + "CONCEPT_NAME" : "Osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60168000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133853, + "CONCEPT_NAME" : "Osteomyelitis of ankle AND/OR foot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "28769004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 138847, + "CONCEPT_NAME" : "Osteomyelitis of forearm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17028003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137648, + "CONCEPT_NAME" : "Osteomyelitis of hand", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61585002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 140191, + "CONCEPT_NAME" : "Osteomyelitis of lower leg", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21120002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134137, + "CONCEPT_NAME" : "Osteomyelitis of multiple sites", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91538002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195901, + "CONCEPT_NAME" : "Osteomyelitis of pelvic region", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8872002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133003, + "CONCEPT_NAME" : "Osteomyelitis of shoulder region", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "53453008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133296, + "CONCEPT_NAME" : "Osteomyelitis of upper arm", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75286007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4001298, + "CONCEPT_NAME" : "Osteomyelitis of vertebra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "203241002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373412, + "CONCEPT_NAME" : "Otitis externa due to Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36292003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378753, + "CONCEPT_NAME" : "Parasitic conjunctivitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13816006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195460, + "CONCEPT_NAME" : "Paratyphoid A fever", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "76623002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137057, + "CONCEPT_NAME" : "Paronychia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "71906005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40480261, + "CONCEPT_NAME" : "Paronychia of finger", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444646006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436897, + "CONCEPT_NAME" : "Pasteurella infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83172007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132835, + "CONCEPT_NAME" : "Pediculosis capitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "81000006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 139737, + "CONCEPT_NAME" : "Pediculosis corporis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25188002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 257778, + "CONCEPT_NAME" : "Pertussis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27836007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440328, + "CONCEPT_NAME" : "Pneumococcal infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16814004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 258785, + "CONCEPT_NAME" : "Pneumococcal pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233607000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438350, + "CONCEPT_NAME" : "Pneumocystosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88860002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 254066, + "CONCEPT_NAME" : "Pneumonia caused by Chlamydiaceae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233609002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 257908, + "CONCEPT_NAME" : "Pneumonia due to anaerobic bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "409664000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260430, + "CONCEPT_NAME" : "Pneumonia due to Escherichia coli", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "51530003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 258180, + "CONCEPT_NAME" : "Pneumonia due to Gram negative bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "430395005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4299862, + "CONCEPT_NAME" : "Pneumonia due to Histoplasma capsulatum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38699009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 253790, + "CONCEPT_NAME" : "Pneumonia due to Klebsiella pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64479007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46270027, + "CONCEPT_NAME" : "Pneumonia due to methicillin resistant Staphylococcus aureus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "124691000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46274035, + "CONCEPT_NAME" : "Pneumonia due to methicillin susceptible Staphylococcus aureus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128711000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 252351, + "CONCEPT_NAME" : "Pneumonia due to Pseudomonas", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41381004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 261324, + "CONCEPT_NAME" : "Pneumonia due to Streptococcus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34020007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 261053, + "CONCEPT_NAME" : "Pneumonia in aspergillosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111900000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 259048, + "CONCEPT_NAME" : "Pneumonia in systemic mycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84753008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437474, + "CONCEPT_NAME" : "Postoperative infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "33910007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4308715, + "CONCEPT_NAME" : "Postoperative septic shock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "213256002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712821, + "CONCEPT_NAME" : "Postprocedural infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12246311000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4153877, + "CONCEPT_NAME" : "Post-traumatic wound infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "269406001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199863, + "CONCEPT_NAME" : "Primary bacterial peritonitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "11836002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435457, + "CONCEPT_NAME" : "Primary progressive tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111832004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256909, + "CONCEPT_NAME" : "Primary pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88036000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432541, + "CONCEPT_NAME" : "Primary tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63309002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433405, + "CONCEPT_NAME" : "Proteus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186437007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260026, + "CONCEPT_NAME" : "Pulmonary actinomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21846001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4245409, + "CONCEPT_NAME" : "Pulmonary aspergillosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6042001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443741, + "CONCEPT_NAME" : "Pulmonary coccidioidomycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417018008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 258684, + "CONCEPT_NAME" : "Pulmonary cryptococcosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "20953001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256622, + "CONCEPT_NAME" : "Pulmonary disease due to Mycobacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84353005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 253954, + "CONCEPT_NAME" : "Pulmonary tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "154283005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437943, + "CONCEPT_NAME" : "Pulp abscess of finger", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "32021005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432621, + "CONCEPT_NAME" : "Purulent endophthalmitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41720003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 376712, + "CONCEPT_NAME" : "Purulent otitis media", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39288006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198189, + "CONCEPT_NAME" : "Purulent peritonitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235983003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198199, + "CONCEPT_NAME" : "Pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45816000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133547, + "CONCEPT_NAME" : "Pyoderma", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70759006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 72988, + "CONCEPT_NAME" : "Pyogenic arthritis of hand", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61112000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4188413, + "CONCEPT_NAME" : "Pyogenic arthritis of hip", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372941008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 73838, + "CONCEPT_NAME" : "Pyogenic arthritis of multiple sites", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34934005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81099, + "CONCEPT_NAME" : "Pyogenic arthritis of shoulder region", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36678001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 78829, + "CONCEPT_NAME" : "Pyogenic arthritis of the ankle and/or foot", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267882003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80177, + "CONCEPT_NAME" : "Pyogenic arthritis of the pelvic region and thigh", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267880006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36715557, + "CONCEPT_NAME" : "Pyogenic infection of skin and subcutaneous tissues caused by bacterium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "721267000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174994, + "CONCEPT_NAME" : "Pyonephrosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48631008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4323342, + "CONCEPT_NAME" : "Recurrent bacterial infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "428875002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45771090, + "CONCEPT_NAME" : "Respiratory tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "700272008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 261774, + "CONCEPT_NAME" : "Respiratory tuberculosis, not confirmed bacteriologically or histologically", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186202007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196328, + "CONCEPT_NAME" : "Salmonella gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42338000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141213, + "CONCEPT_NAME" : "Scarlet fever", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30242009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4030847, + "CONCEPT_NAME" : "Secondary impetiginization", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "238377008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 312823, + "CONCEPT_NAME" : "Secondary syphilitic adenopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59934002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132797, + "CONCEPT_NAME" : "Sepsis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91302008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40486631, + "CONCEPT_NAME" : "Sepsis due to anaerobic bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447843005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40486629, + "CONCEPT_NAME" : "Sepsis due to Candida", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447841007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40487064, + "CONCEPT_NAME" : "Sepsis due to Escherichia coli", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447899008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40493038, + "CONCEPT_NAME" : "Sepsis due to Gram negative bacteria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "449082003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40486059, + "CONCEPT_NAME" : "Sepsis due to Haemophilus influenzae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447685007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40491960, + "CONCEPT_NAME" : "Sepsis due to methicillin resistant Staphylococcus aureus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "448812000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40491961, + "CONCEPT_NAME" : "Sepsis due to Pseudomonas", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "448813005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40493415, + "CONCEPT_NAME" : "Sepsis due to Serratia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "449084002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40487059, + "CONCEPT_NAME" : "Sepsis due to Staphylococcus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "447894003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40489907, + "CONCEPT_NAME" : "Sepsis due to Staphylococcus aureus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "448417001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40489908, + "CONCEPT_NAME" : "Sepsis due to Streptococcus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "448418006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40489910, + "CONCEPT_NAME" : "Sepsis due to Streptococcus group D", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "448420009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40489912, + "CONCEPT_NAME" : "Sepsis due to Streptococcus pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "448421008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40487616, + "CONCEPT_NAME" : "Sepsis due to Streptococcus pyogenes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "449504009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196236, + "CONCEPT_NAME" : "Septic shock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "76571007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37394658, + "CONCEPT_NAME" : "Severe sepsis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1036671000000106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440647, + "CONCEPT_NAME" : "Sexually transmitted infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "8098009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201780, + "CONCEPT_NAME" : "Shigellosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36188001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434575, + "CONCEPT_NAME" : "Spotted fevers", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186771002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4009329, + "CONCEPT_NAME" : "Staphylococcal arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111820003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195461, + "CONCEPT_NAME" : "Staphylococcal enterocolitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "32527003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435459, + "CONCEPT_NAME" : "Staphylococcal infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56038003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 259852, + "CONCEPT_NAME" : "Staphylococcal pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22754005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132392, + "CONCEPT_NAME" : "Staphylococcal scalded skin syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200946001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437779, + "CONCEPT_NAME" : "Streptococcal infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "85769006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 28060, + "CONCEPT_NAME" : "Streptococcal sore throat", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43878008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4212727, + "CONCEPT_NAME" : "Streptococcal tonsillitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41582007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4143698, + "CONCEPT_NAME" : "Streptococcus agalactiae infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "426933007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4120302, + "CONCEPT_NAME" : "Streptococcus pyogenes infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "302809008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4284844, + "CONCEPT_NAME" : "Subacute osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67322009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 73068, + "CONCEPT_NAME" : "Superficial foreign body of finger without major open wound but with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26363007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 77156, + "CONCEPT_NAME" : "Superficial foreign body of toe without major open wound but with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18589000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436285, + "CONCEPT_NAME" : "Superficial foreign body without major open wound but with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "87426001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441170, + "CONCEPT_NAME" : "Superficial injury with infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49897003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4077081, + "CONCEPT_NAME" : "Superficial mycosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276206000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80482, + "CONCEPT_NAME" : "Suppurative arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "372939007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 318689, + "CONCEPT_NAME" : "Syphilitic endocarditis of aortic valve", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "278480000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373962, + "CONCEPT_NAME" : "Tabes dorsalis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "316841006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4224968, + "CONCEPT_NAME" : "Tinea corporis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84849002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4160328, + "CONCEPT_NAME" : "Tinea cruris", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399029005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4084964, + "CONCEPT_NAME" : "Tinea imbricata", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240699006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 80946, + "CONCEPT_NAME" : "Tinea manus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48971001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134865, + "CONCEPT_NAME" : "Tinea nigra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186289000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4163280, + "CONCEPT_NAME" : "Tinea of perianal region", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "399172001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 133141, + "CONCEPT_NAME" : "Tinea pedis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "6020002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201214, + "CONCEPT_NAME" : "Toxic shock syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18504008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4090114, + "CONCEPT_NAME" : "Toxoplasmosis chorioretinitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187194004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 194871, + "CONCEPT_NAME" : "Trichomonal vulvovaginitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "81598001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434557, + "CONCEPT_NAME" : "Tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56717001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198674, + "CONCEPT_NAME" : "Tuberculosis of bladder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "32268008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 374267, + "CONCEPT_NAME" : "Tuberculosis of central nervous system", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10706006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 134851, + "CONCEPT_NAME" : "Tuberculosis of intrathoracic lymph nodes", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "78436002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260630, + "CONCEPT_NAME" : "Tuberculosis of lung, bacteriological and histological examination not done", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186204008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256018, + "CONCEPT_NAME" : "Tuberculosis of lung, confirmed histologically", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186195008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 260315, + "CONCEPT_NAME" : "Tuberculosis of lung with cavitation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186177005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4153291, + "CONCEPT_NAME" : "Tuberculosis of skin and subcutaneous tissue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "271423008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192819, + "CONCEPT_NAME" : "Typhoid fever", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "4834000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4181583, + "CONCEPT_NAME" : "Upper respiratory infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "54150009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 197919, + "CONCEPT_NAME" : "Urethral stricture due to infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80375002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4146482, + "CONCEPT_NAME" : "Urinary tract infection in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "307534009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 81902, + "CONCEPT_NAME" : "Urinary tract infectious disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "68566005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 78073, + "CONCEPT_NAME" : "Urogenital infection by Trichomonas vaginalis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35089004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440158, + "CONCEPT_NAME" : "Venereal disease in mother complicating pregnancy, childbirth AND/OR puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27075004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440029, + "CONCEPT_NAME" : "Viral disease", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34014006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433960, + "CONCEPT_NAME" : "Vivax malaria", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27052006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132834, + "CONCEPT_NAME" : "White piedra", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "35586003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4154776, + "CONCEPT_NAME" : "Whooping cough-like syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "271567008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4344398, + "CONCEPT_NAME" : "Wrist pyogenic arthritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "239778009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 30 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 90 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1074.json b/tests/cohorts/1074.json new file mode 100644 index 00000000..323974cd --- /dev/null +++ b/tests/cohorts/1074.json @@ -0,0 +1,1028 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 9, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 8, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Death" : { + "DeathTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Days" : 30, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 8, + "name" : "Inpatient or ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 9, + "name" : "Serious Infections ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4326255, + "CONCEPT_NAME" : "Abdominal abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75100008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193522, + "CONCEPT_NAME" : "Acute prostatitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79411002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4324289, + "CONCEPT_NAME" : "Allergic encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70884002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4176250, + "CONCEPT_NAME" : "Allergic encephalomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50776006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4094215, + "CONCEPT_NAME" : "Allergic gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26006005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192674, + "CONCEPT_NAME" : "Allergic gastroenteritis and colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266451002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4326601, + "CONCEPT_NAME" : "Anorectal abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75236001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4050869, + "CONCEPT_NAME" : "Atypical pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233606009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132736, + "CONCEPT_NAME" : "Bacteremia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5758002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436339, + "CONCEPT_NAME" : "Bacterial infection due to Klebsiella pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186435004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435613, + "CONCEPT_NAME" : "Cellulitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128045006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193814, + "CONCEPT_NAME" : "Chronic parametritis and pelvic cellulitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198159006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195453, + "CONCEPT_NAME" : "Colitis, enteritis and gastroenteritis presumed infectious", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266081001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435318, + "CONCEPT_NAME" : "Complete miscarriage with genital tract or pelvic infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198655001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4068969, + "CONCEPT_NAME" : "Congenital malformation of corpus callosum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "204042007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345447, + "CONCEPT_NAME" : "Cutaneous erysipeloid", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240394009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378143, + "CONCEPT_NAME" : "Encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45170000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441589, + "CONCEPT_NAME" : "Endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56819008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443406, + "CONCEPT_NAME" : "Eosinophilic gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "359804008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4098889, + "CONCEPT_NAME" : "Experimental allergic encephalomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "27040004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195306, + "CONCEPT_NAME" : "Gastroduodenitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "196731005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4101468, + "CONCEPT_NAME" : "Gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25374005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 256036, + "CONCEPT_NAME" : "Hemorrhagic varicella pneumonitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31920006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45770836, + "CONCEPT_NAME" : "Herpes zoster myelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "98541000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 76034, + "CONCEPT_NAME" : "Herpetic whitlow", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "43891009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195317, + "CONCEPT_NAME" : "Incomplete miscarriage with genital tract or pelvic infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "198644001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4231983, + "CONCEPT_NAME" : "Infection due to Mycoplasma pneumoniae", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "406595002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273378, + "CONCEPT_NAME" : "Interstitial pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64667001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4262720, + "CONCEPT_NAME" : "Ischiorectal abscess", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36046008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 434866, + "CONCEPT_NAME" : "Late effects of viral encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "110269000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4027461, + "CONCEPT_NAME" : "Leukoencephalopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22811006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435785, + "CONCEPT_NAME" : "Meningitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "7180009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 141663, + "CONCEPT_NAME" : "Osteomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60168000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373412, + "CONCEPT_NAME" : "Otitis externa due to Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36292003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438350, + "CONCEPT_NAME" : "Pneumocystosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "88860002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 255848, + "CONCEPT_NAME" : "Pneumonia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233604007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444099, + "CONCEPT_NAME" : "Pneumonitis due to acquired toxoplasmosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46207001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712850, + "CONCEPT_NAME" : "Pneumonitis due to Herpes zoster", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "12571000132104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192670, + "CONCEPT_NAME" : "Portal pyemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67656006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42872891, + "CONCEPT_NAME" : "Posterior reversible encephalopathy syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "450886002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433957, + "CONCEPT_NAME" : "Progressive multifocal leukoencephalopathy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22255007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 253954, + "CONCEPT_NAME" : "Pulmonary tuberculosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "154283005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 198199, + "CONCEPT_NAME" : "Pyelonephritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45816000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4169568, + "CONCEPT_NAME" : "Rheumatic endocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "48872007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196328, + "CONCEPT_NAME" : "Salmonella gastroenteritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42338000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 132797, + "CONCEPT_NAME" : "Sepsis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91302008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196236, + "CONCEPT_NAME" : "Septic shock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "76571007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195461, + "CONCEPT_NAME" : "Staphylococcal enterocolitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "32527003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4091167, + "CONCEPT_NAME" : "Tuberculosis of lung, bacteriologically and histologically negative", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "186203002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4206579, + "CONCEPT_NAME" : "Varicella-zoster virus infection", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309465005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 30 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 90 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1075.json b/tests/cohorts/1075.json new file mode 100644 index 00000000..363410bf --- /dev/null +++ b/tests/cohorts/1075.json @@ -0,0 +1,121 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Narcolepsy", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 437854, + "CONCEPT_NAME" : "Cataplexy and narcolepsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "193042000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436100, + "CONCEPT_NAME" : "Narcolepsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "60380001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1076.json b/tests/cohorts/1076.json new file mode 100644 index 00000000..6e718ce9 --- /dev/null +++ b/tests/cohorts/1076.json @@ -0,0 +1,121 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Anaphylaxis or Anaphylactic shock due to serum", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 441202, + "CONCEPT_NAME" : "Anaphylaxis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39579001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442038, + "CONCEPT_NAME" : "Anaphylactic shock due to serum", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "213320003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 30 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1077.json b/tests/cohorts/1077.json new file mode 100644 index 00000000..1e50415d --- /dev/null +++ b/tests/cohorts/1077.json @@ -0,0 +1,248 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Anaphylaxis broad", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4032658, + "CONCEPT_NAME" : "Localized anaphylaxis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14654002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4084639, + "CONCEPT_NAME" : "Idiopathic anaphylaxis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "241954008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4221182, + "CONCEPT_NAME" : "Anaphylaxis due to substance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "417516000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4193788, + "CONCEPT_NAME" : "Anaphylactic transfusion reaction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "79337003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 441202, + "CONCEPT_NAME" : "Anaphylaxis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39579001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42536383, + "CONCEPT_NAME" : "Anaphylactic shock", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "735173007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 1, + "name" : "Inpatient or Emergency Room visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 30 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 30, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1078.json b/tests/cohorts/1078.json new file mode 100644 index 00000000..60189b55 --- /dev/null +++ b/tests/cohorts/1078.json @@ -0,0 +1,138 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Bell's palsy", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4091559, + "CONCEPT_NAME" : "Facial palsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "280816001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4048018, + "CONCEPT_NAME" : "Congenital facial nerve palsy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230542008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36716396, + "CONCEPT_NAME" : "Congenital hereditary facial paralysis with variable hearing loss syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722389002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' 183 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 183, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1079.json b/tests/cohorts/1079.json new file mode 100644 index 00000000..a39f6897 --- /dev/null +++ b/tests/cohorts/1079.json @@ -0,0 +1,353 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 1, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Encephalomyelitis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 372615, + "CONCEPT_NAME" : "Post-infectious encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192727001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 378143, + "CONCEPT_NAME" : "Encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45170000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4147498, + "CONCEPT_NAME" : "Encephalitis, myelitis and encephalomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267576008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 373189, + "CONCEPT_NAME" : "Encephalomyelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "62950007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4190307, + "CONCEPT_NAME" : "Inflammatory disease of the central nervous system", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39367000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 379792, + "CONCEPT_NAME" : "Post-immunization encephalitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192704009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4330496, + "CONCEPT_NAME" : "Inflammation of spinal cord due to toxin", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "431520004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 138965, + "CONCEPT_NAME" : "Myelitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "41370002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' 183 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 1, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 183, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1080.json b/tests/cohorts/1080.json new file mode 100644 index 00000000..f58eaafe --- /dev/null +++ b/tests/cohorts/1080.json @@ -0,0 +1,268 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 1, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Guillian-Barre syndrome", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 374925, + "CONCEPT_NAME" : "Acute infective polyneuritis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "129131007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4164770, + "CONCEPT_NAME" : "Guillain-Barre syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40956001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4070552, + "CONCEPT_NAME" : "Fisher's syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1767005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 1, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window'", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 1, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1081.json b/tests/cohorts/1081.json new file mode 100644 index 00000000..336b1be3 --- /dev/null +++ b/tests/cohorts/1081.json @@ -0,0 +1,387 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 1, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Myocardial Infarction and complication", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4329847, + "CONCEPT_NAME" : "Myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22298006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 314666, + "CONCEPT_NAME" : "Old myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1755008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108680, + "CONCEPT_NAME" : "Thrombosis of atrium, auricular appendage, and ventricle due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194868001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108678, + "CONCEPT_NAME" : "Hemopericardium due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194862000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438172, + "CONCEPT_NAME" : "Atrial septal defect due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194863005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124687, + "CONCEPT_NAME" : "Cardiac rupture due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233847009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45766212, + "CONCEPT_NAME" : "Mitral valve regurgitation due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "703326006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109910, + "CONCEPT_NAME" : "Ventricular aneurysm due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723858002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109911, + "CONCEPT_NAME" : "Pulmonary embolism due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723859005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109912, + "CONCEPT_NAME" : "Arrhythmia due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723860000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 1, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1082.json b/tests/cohorts/1082.json new file mode 100644 index 00000000..7462bc6f --- /dev/null +++ b/tests/cohorts/1082.json @@ -0,0 +1,189 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Myocarditis Pericarditis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4289908, + "CONCEPT_NAME" : "Viral pericarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70189005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4138837, + "CONCEPT_NAME" : "Pericarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3238004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 314383, + "CONCEPT_NAME" : "Myocarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "50920009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4149913, + "CONCEPT_NAME" : "Systemic lupus erythematosus with pericarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309762007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 318072, + "CONCEPT_NAME" : "Histoplasmosis with pericarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "187059008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782774, + "CONCEPT_NAME" : "Chest pain due to pericarditis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "34791000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1083.json b/tests/cohorts/1083.json new file mode 100644 index 00000000..19f2e47c --- /dev/null +++ b/tests/cohorts/1083.json @@ -0,0 +1,138 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Idiopathic and Immune Thrombocytopenia", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4159749, + "CONCEPT_NAME" : "Idiopathic maternal thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "371106008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4103532, + "CONCEPT_NAME" : "Immune thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "2897005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4119134, + "CONCEPT_NAME" : "Thrombocytopenic purpura", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "302873008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 0, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1084.json b/tests/cohorts/1084.json new file mode 100644 index 00000000..b4fdc7f5 --- /dev/null +++ b/tests/cohorts/1084.json @@ -0,0 +1,146 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 3, + "name" : "Disseminated intravascular coagulation", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 436093, + "CONCEPT_NAME" : "Disseminated intravascular coagulation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "67406007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1085.json b/tests/cohorts/1085.json new file mode 100644 index 00000000..f9a1ce97 --- /dev/null +++ b/tests/cohorts/1085.json @@ -0,0 +1,146 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Appendicitis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 440448, + "CONCEPT_NAME" : "Appendicitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "74400008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 2, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1086.json b/tests/cohorts/1086.json new file mode 100644 index 00000000..77f2ca2d --- /dev/null +++ b/tests/cohorts/1086.json @@ -0,0 +1,104 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 4, + "name" : "Transverse Myelitis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443904, + "CONCEPT_NAME" : "Transverse myelopathy syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "16631009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1087.json b/tests/cohorts/1087.json new file mode 100644 index 00000000..8b0d2bc1 --- /dev/null +++ b/tests/cohorts/1087.json @@ -0,0 +1,421 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 2, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 4, + "name" : "Hemorrhagic stroke subarachnoid intracerebral subdural", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 439847, + "CONCEPT_NAME" : "Intracranial hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1386000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432923, + "CONCEPT_NAME" : "Subarachnoid hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21454007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 376713, + "CONCEPT_NAME" : "Cerebral hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "274100004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4148906, + "CONCEPT_NAME" : "Spontaneous subarachnoid hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "270907008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4144154, + "CONCEPT_NAME" : "Non-traumatic intracerebral ventricular hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "425957003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4111709, + "CONCEPT_NAME" : "Non-traumatic subdural hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195176009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42535426, + "CONCEPT_NAME" : "Acute nontraumatic subdural hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "291581000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530728, + "CONCEPT_NAME" : "Subacute non-traumatic intracranial subdural hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "291591000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174299, + "CONCEPT_NAME" : "Perinatal intracranial hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276647007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36716544, + "CONCEPT_NAME" : "Fetal or neonatal non-traumatic intraventricular hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722581000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345688, + "CONCEPT_NAME" : "Intracerebral hemorrhage in fetus or newborn", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240313004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530727, + "CONCEPT_NAME" : "Spontaneous cerebral hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "291571000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 2, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 4, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1088.json b/tests/cohorts/1088.json new file mode 100644 index 00000000..75bc58d3 --- /dev/null +++ b/tests/cohorts/1088.json @@ -0,0 +1,308 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 1, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "Deep Vein Thrombosis broad", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4133004, + "CONCEPT_NAME" : "Deep venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128053003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4149782, + "CONCEPT_NAME" : "Thrombosis of vein of lower limb", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309735004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444247, + "CONCEPT_NAME" : "Venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111293003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 77310, + "CONCEPT_NAME" : "Deep vein phlebitis and thrombophlebitis of the leg", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266267005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481089, + "CONCEPT_NAME" : "Embolism from thrombosis of vein of lower extremity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444816006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435565, + "CONCEPT_NAME" : "Embolism and thrombosis of the vena cava", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195437003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193512, + "CONCEPT_NAME" : "Embolism and thrombosis of the renal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195438008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712971, + "CONCEPT_NAME" : "Chronic deep venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15760351000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435887, + "CONCEPT_NAME" : "Antepartum deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49956009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438820, + "CONCEPT_NAME" : "Postpartum deep phlebothrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56272000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782752, + "CONCEPT_NAME" : "Acute deep venous thrombosis of internal jugular vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135001000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782751, + "CONCEPT_NAME" : "Acute deep venous thrombosis of axillary vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "134961000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4179911, + "CONCEPT_NAME" : "Axillary vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "297156001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 1, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1089.json b/tests/cohorts/1089.json new file mode 100644 index 00000000..f6b03d22 --- /dev/null +++ b/tests/cohorts/1089.json @@ -0,0 +1,268 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "AdditionalCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 2, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "ConceptSets" : [ + { + "id" : 2, + "name" : "Inpatient or Inpatient/ER visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 3, + "name" : "cerebral infarction FDA conceptset proxy", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443454, + "CONCEPT_NAME" : "Cerebral infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "432504007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40479572, + "CONCEPT_NAME" : "Infarct of cerebrum due to iatrogenic cerebrovascular accident", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441526008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046360, + "CONCEPT_NAME" : "Lacunar infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230698000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 2, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : -1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1090.json b/tests/cohorts/1090.json new file mode 100644 index 00000000..200f5592 --- /dev/null +++ b/tests/cohorts/1090.json @@ -0,0 +1,427 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 3, + "name" : "Pulmonary Embolism FDA concept proxy", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 254662, + "CONCEPT_NAME" : "Pulmonary infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64662007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36713113, + "CONCEPT_NAME" : "Saddle embolus of pulmonary artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "328511000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440417, + "CONCEPT_NAME" : "Pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59282003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435616, + "CONCEPT_NAME" : "Amniotic fluid embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17263003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435887, + "CONCEPT_NAME" : "Antepartum deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49956009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196715, + "CONCEPT_NAME" : "Budd-Chiari syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062269, + "CONCEPT_NAME" : "Cerebral venous thrombosis in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200259003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442055, + "CONCEPT_NAME" : "Obstetric air pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200286003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433832, + "CONCEPT_NAME" : "Obstetric blood-clot pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200299000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435026, + "CONCEPT_NAME" : "Obstetric pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200284000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440477, + "CONCEPT_NAME" : "Obstetric pyemic and septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267284008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 318137, + "CONCEPT_NAME" : "Phlebitis and thrombophlebitis of intracranial sinuses", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192753009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199837, + "CONCEPT_NAME" : "Portal vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17920008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438820, + "CONCEPT_NAME" : "Postpartum deep phlebothrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56272000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4235812, + "CONCEPT_NAME" : "Septic thrombophlebitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "439731006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195294, + "CONCEPT_NAME" : "Thrombosed hemorrhoids", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75955007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4187790, + "CONCEPT_NAME" : "Thrombosis of retinal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46085004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444247, + "CONCEPT_NAME" : "Venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111293003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782732, + "CONCEPT_NAME" : "Chronic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133971000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40479606, + "CONCEPT_NAME" : "Septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441557008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "has no events in prior 'clean window' - 365 days", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : true, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1091.json b/tests/cohorts/1091.json new file mode 100644 index 00000000..849c6a95 --- /dev/null +++ b/tests/cohorts/1091.json @@ -0,0 +1,5192 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 55, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 31, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 35, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 49, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 52, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 50, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 57, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 44, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 40, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 41, + "ConditionTypeExclude" : false + } + }, + { + "ConditionOccurrence" : { + "CodesetId" : 43, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 1, + "name" : "Thrombocytopenia (broad)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 37397537, + "CONCEPT_NAME" : "Beta thalassemia X-linked thrombocytopenia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "718196002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432870, + "CONCEPT_NAME" : "Thrombocytopenic disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "302215000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 2, + "name" : "Platelet measurement", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 3007461, + "CONCEPT_NAME" : "Platelets [#/volume] in Blood", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "26515-7", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3031586, + "CONCEPT_NAME" : "Platelets [#/volume] in Blood by Estimate", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49497-1", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3024929, + "CONCEPT_NAME" : "Platelets [#/volume] in Blood by Automated count", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "777-3", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3039827, + "CONCEPT_NAME" : "Platelets [#/volume] in Body fluid by Automated count", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "40574-6", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 3024386, + "CONCEPT_NAME" : "Platelet mean volume [Entitic volume] in Blood by Rees-Ecker", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "776-5", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "LOINC", + "CONCEPT_CLASS_ID" : "Lab Test" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4267147, + "CONCEPT_NAME" : "Platelet count", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "61928009", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Procedure" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37393863, + "CONCEPT_NAME" : "Platelet count", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1022651000000100", + "DOMAIN_ID" : "Measurement", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Observable Entity" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 31, + "name" : "Deep Vein Thrombosis (narrow)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 44782752, + "CONCEPT_NAME" : "Acute deep venous thrombosis of internal jugular vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135001000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435565, + "CONCEPT_NAME" : "Embolism and thrombosis of the vena cava", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195437003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481089, + "CONCEPT_NAME" : "Embolism from thrombosis of vein of lower extremity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444816006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193512, + "CONCEPT_NAME" : "Embolism and thrombosis of the renal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195438008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4133004, + "CONCEPT_NAME" : "Deep venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128053003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4149782, + "CONCEPT_NAME" : "Thrombosis of vein of lower limb", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309735004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712971, + "CONCEPT_NAME" : "Chronic deep venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15760351000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435887, + "CONCEPT_NAME" : "Antepartum deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49956009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4179911, + "CONCEPT_NAME" : "Axillary vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "297156001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435031, + "CONCEPT_NAME" : "Postnatal deep vein thrombosis - delivered with postnatal complication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200237000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062264, + "CONCEPT_NAME" : "Postnatal deep vein thrombosis with postnatal complication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200238005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438820, + "CONCEPT_NAME" : "Postpartum deep phlebothrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56272000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782762, + "CONCEPT_NAME" : "Acute thrombosis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "132611000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762049, + "CONCEPT_NAME" : "Acute thrombosis of right subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286431000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762048, + "CONCEPT_NAME" : "Acute thrombosis of left subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286421000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 46271900, + "CONCEPT_NAME" : "Recurrent deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "710167004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4317289, + "CONCEPT_NAME" : "Thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95446005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124856, + "CONCEPT_NAME" : "Inferior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234041004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318407, + "CONCEPT_NAME" : "Thrombophlebitis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95447001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4055089, + "CONCEPT_NAME" : "Superior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197001004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757410, + "CONCEPT_NAME" : "Acute thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133421000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757409, + "CONCEPT_NAME" : "Chronic thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133411000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4203836, + "CONCEPT_NAME" : "Thrombosis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "438647008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782759, + "CONCEPT_NAME" : "Chronic thrombosis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "132551000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4205652, + "CONCEPT_NAME" : "Thrombophlebitis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "438483005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762046, + "CONCEPT_NAME" : "Chronic thrombosis of right subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286381000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762051, + "CONCEPT_NAME" : "Chronic thrombosis of left subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286451000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44811347, + "CONCEPT_NAME" : "Thrombosis of internal jugular vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "864191000000104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4033521, + "CONCEPT_NAME" : "Splenic vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14534009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4089917, + "CONCEPT_NAME" : "Phlegmasia alba dolens - obstetric", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "280966008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45773536, + "CONCEPT_NAME" : "Deep venous thrombosis of femoropopliteal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "703277001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4203618, + "CONCEPT_NAME" : "Thrombophlebitis of femoropopliteal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52496006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762047, + "CONCEPT_NAME" : "Acute bilateral thrombosis of subclavian veins", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286411000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712892, + "CONCEPT_NAME" : "Acute thrombosis of splenic vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "143561000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4269051, + "CONCEPT_NAME" : "Puerperal phlegmasia alba dolens", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "62583006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4096099, + "CONCEPT_NAME" : "Phlebitis of deep veins of lower extremity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25114006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 34, + "name" : "Deep Vein Thrombosis (broad)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 320741, + "CONCEPT_NAME" : "Thrombophlebitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64156001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4096099, + "CONCEPT_NAME" : "Phlebitis of deep veins of lower extremity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25114006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782752, + "CONCEPT_NAME" : "Acute deep venous thrombosis of internal jugular vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "135001000119100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44811347, + "CONCEPT_NAME" : "Thrombosis of internal jugular vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "864191000000104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757409, + "CONCEPT_NAME" : "Chronic thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133411000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4203836, + "CONCEPT_NAME" : "Thrombosis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "438647008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4205652, + "CONCEPT_NAME" : "Thrombophlebitis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "438483005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124856, + "CONCEPT_NAME" : "Inferior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234041004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4203618, + "CONCEPT_NAME" : "Thrombophlebitis of femoropopliteal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52496006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318407, + "CONCEPT_NAME" : "Thrombophlebitis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95447001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762047, + "CONCEPT_NAME" : "Acute bilateral thrombosis of subclavian veins", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286411000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782762, + "CONCEPT_NAME" : "Acute thrombosis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "132611000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435565, + "CONCEPT_NAME" : "Embolism and thrombosis of the vena cava", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195437003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757410, + "CONCEPT_NAME" : "Acute thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133421000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4033521, + "CONCEPT_NAME" : "Splenic vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14534009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762049, + "CONCEPT_NAME" : "Acute thrombosis of right subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286431000119103", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4055089, + "CONCEPT_NAME" : "Superior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197001004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440738, + "CONCEPT_NAME" : "Phlebitis of the femoral vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195404000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444247, + "CONCEPT_NAME" : "Venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111293003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40481089, + "CONCEPT_NAME" : "Embolism from thrombosis of vein of lower extremity", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444816006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 193512, + "CONCEPT_NAME" : "Embolism and thrombosis of the renal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195438008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45773536, + "CONCEPT_NAME" : "Deep venous thrombosis of femoropopliteal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "703277001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712892, + "CONCEPT_NAME" : "Acute thrombosis of splenic vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "143561000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4234997, + "CONCEPT_NAME" : "Disorder of vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90507008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 439838, + "CONCEPT_NAME" : "Thrombophlebitis migrans", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "31268005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4133004, + "CONCEPT_NAME" : "Deep venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128053003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782759, + "CONCEPT_NAME" : "Chronic thrombosis of subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "132551000119104", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444097, + "CONCEPT_NAME" : "Thrombophlebitis of lower extremities", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46253008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4327889, + "CONCEPT_NAME" : "Thromboembolism of vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "429098002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4149782, + "CONCEPT_NAME" : "Thrombosis of vein of lower limb", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "309735004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 762048, + "CONCEPT_NAME" : "Acute thrombosis of left subclavian vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "286421000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4317289, + "CONCEPT_NAME" : "Thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95446005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712971, + "CONCEPT_NAME" : "Chronic deep venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15760351000119105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435887, + "CONCEPT_NAME" : "Antepartum deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49956009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438820, + "CONCEPT_NAME" : "Postpartum deep phlebothrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56272000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4179911, + "CONCEPT_NAME" : "Axillary vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "297156001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4089917, + "CONCEPT_NAME" : "Phlegmasia alba dolens - obstetric", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "280966008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 35, + "name" : "Pulmonary Embolism", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 254662, + "CONCEPT_NAME" : "Pulmonary infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64662007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36713113, + "CONCEPT_NAME" : "Saddle embolus of pulmonary artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "328511000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440417, + "CONCEPT_NAME" : "Pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "59282003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435616, + "CONCEPT_NAME" : "Amniotic fluid embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17263003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435887, + "CONCEPT_NAME" : "Antepartum deep vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49956009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196715, + "CONCEPT_NAME" : "Budd-Chiari syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4062269, + "CONCEPT_NAME" : "Cerebral venous thrombosis in pregnancy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200259003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 442055, + "CONCEPT_NAME" : "Obstetric air pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200286003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 433832, + "CONCEPT_NAME" : "Obstetric blood-clot pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200299000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435026, + "CONCEPT_NAME" : "Obstetric pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200284000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440477, + "CONCEPT_NAME" : "Obstetric pyemic and septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267284008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 318137, + "CONCEPT_NAME" : "Phlebitis and thrombophlebitis of intracranial sinuses", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192753009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199837, + "CONCEPT_NAME" : "Portal vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17920008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438820, + "CONCEPT_NAME" : "Postpartum deep phlebothrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56272000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4235812, + "CONCEPT_NAME" : "Septic thrombophlebitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "439731006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195294, + "CONCEPT_NAME" : "Thrombosed hemorrhoids", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75955007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4187790, + "CONCEPT_NAME" : "Thrombosis of retinal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46085004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444247, + "CONCEPT_NAME" : "Venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "111293003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782732, + "CONCEPT_NAME" : "Chronic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133971000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40479606, + "CONCEPT_NAME" : "Septic pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441557008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4240832, + "CONCEPT_NAME" : "Failed attempted termination of pregnancy with pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "58123006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4236271, + "CONCEPT_NAME" : "Recurrent pulmonary embolism", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "438773007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 40, + "name" : "Cerebral infarction", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 443454, + "CONCEPT_NAME" : "Cerebral infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "432504007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40479572, + "CONCEPT_NAME" : "Infarct of cerebrum due to iatrogenic cerebrovascular accident", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "441526008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046360, + "CONCEPT_NAME" : "Lacunar infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230698000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 372435, + "CONCEPT_NAME" : "Periventricular leukomalacia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230769007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 377254, + "CONCEPT_NAME" : "Multi-infarct dementia, uncomplicated", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "70936005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 379778, + "CONCEPT_NAME" : "Multi-infarct dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "56267009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443790, + "CONCEPT_NAME" : "Multi-infarct dementia with delusions", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "25772007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 443864, + "CONCEPT_NAME" : "Multi-infarct dementia with depression", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14070001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444091, + "CONCEPT_NAME" : "Multi-infarct dementia with delirium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "10349009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046089, + "CONCEPT_NAME" : "Vascular dementia of acute onset", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230285003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4046090, + "CONCEPT_NAME" : "Mixed cortical and subcortical vascular dementia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230287006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4129534, + "CONCEPT_NAME" : "Pituitary apoplexy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "237701005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 41, + "name" : "Hemorrhagic stroke", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 439847, + "CONCEPT_NAME" : "Intracranial hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1386000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432923, + "CONCEPT_NAME" : "Subarachnoid hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "21454007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 376713, + "CONCEPT_NAME" : "Cerebral hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "274100004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4148906, + "CONCEPT_NAME" : "Spontaneous subarachnoid hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "270907008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4144154, + "CONCEPT_NAME" : "Non-traumatic intracerebral ventricular hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "425957003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4111709, + "CONCEPT_NAME" : "Non-traumatic subdural hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195176009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42535426, + "CONCEPT_NAME" : "Acute nontraumatic subdural hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "291581000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530728, + "CONCEPT_NAME" : "Subacute non-traumatic intracranial subdural hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "291591000119107", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174299, + "CONCEPT_NAME" : "Perinatal intracranial hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276647007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36716544, + "CONCEPT_NAME" : "Fetal or neonatal non-traumatic intraventricular hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722581000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345688, + "CONCEPT_NAME" : "Intracerebral hemorrhage in fetus or newborn", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "240313004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43530727, + "CONCEPT_NAME" : "Spontaneous cerebral hemorrhage", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "291571000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108952, + "CONCEPT_NAME" : "Subarachnoid hemorrhage from carotid siphon and bifurcation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195155004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4111708, + "CONCEPT_NAME" : "Subarachnoid hemorrhage from vertebral artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195160000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35609033, + "CONCEPT_NAME" : "Haemorrhagic stroke", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1078001000000105", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Myocardial Infarction and complication", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4329847, + "CONCEPT_NAME" : "Myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22298006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108680, + "CONCEPT_NAME" : "Thrombosis of atrium, auricular appendage, and ventricle due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194868001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4108678, + "CONCEPT_NAME" : "Hemopericardium due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194862000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 438172, + "CONCEPT_NAME" : "Atrial septal defect due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "194863005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124687, + "CONCEPT_NAME" : "Cardiac rupture due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "233847009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45766212, + "CONCEPT_NAME" : "Mitral valve regurgitation due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "703326006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109910, + "CONCEPT_NAME" : "Ventricular aneurysm due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723858002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109911, + "CONCEPT_NAME" : "Pulmonary embolism due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723859005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37109912, + "CONCEPT_NAME" : "Arrhythmia due to and following acute myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "723860000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 314666, + "CONCEPT_NAME" : "Old myocardial infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "1755008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 44, + "name" : "Intestinal infarction", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4195665, + "CONCEPT_NAME" : "Gastrointestinal tract vascular insufficiency", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312607004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4148299, + "CONCEPT_NAME" : "Ischemic colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "30588004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4173167, + "CONCEPT_NAME" : "Mesenteric embolus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276500007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4317289, + "CONCEPT_NAME" : "Thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95446005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4319280, + "CONCEPT_NAME" : "Acute bowel infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22323009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4144032, + "CONCEPT_NAME" : "Mesenteric thrombus and/or embolus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "307420006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757410, + "CONCEPT_NAME" : "Acute thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133421000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757409, + "CONCEPT_NAME" : "Chronic thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133411000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44811741, + "CONCEPT_NAME" : "Acute ischaemia of large intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "906201000000100", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44811740, + "CONCEPT_NAME" : "Acute ischaemia of small intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "906191000000102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37117790, + "CONCEPT_NAME" : "Insufficiency of mesenteric artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "734041006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37016198, + "CONCEPT_NAME" : "Epiploic appendagitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14720231000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35622081, + "CONCEPT_NAME" : "Nongangrenous ischemic colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "763398006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35622080, + "CONCEPT_NAME" : "Gangrenous ischemic colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "763397001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4345926, + "CONCEPT_NAME" : "Abdominal angina", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "241154007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4342767, + "CONCEPT_NAME" : "Transient ischemic colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235845003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4341648, + "CONCEPT_NAME" : "Hemorrhagic infarction of intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235851008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4341646, + "CONCEPT_NAME" : "Occlusive mesenteric ischemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235842000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4340939, + "CONCEPT_NAME" : "Non-occlusive mesenteric ischemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235843005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4340378, + "CONCEPT_NAME" : "Transmural infarction of intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235852001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4340375, + "CONCEPT_NAME" : "Focal segmental ischemia of small intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "235844004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318537, + "CONCEPT_NAME" : "Large bowel gangrene", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95538007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318407, + "CONCEPT_NAME" : "Thrombophlebitis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95447001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4240850, + "CONCEPT_NAME" : "Acute ischemic enterocolitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5820008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239942, + "CONCEPT_NAME" : "Embolic mesenteric infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57658009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4237654, + "CONCEPT_NAME" : "Ischemic enterocolitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "90891007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4215949, + "CONCEPT_NAME" : "Nonocclusive intestinal infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "72150009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4214720, + "CONCEPT_NAME" : "Thrombotic mesenteric infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "80475003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4192856, + "CONCEPT_NAME" : "Acute ischemic colitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75700000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4188336, + "CONCEPT_NAME" : "Chronic ischemic enterocolitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "46882000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4174014, + "CONCEPT_NAME" : "Inferior mesenteric artery embolus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "297140006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4149013, + "CONCEPT_NAME" : "Mesenteric infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "3558002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4148257, + "CONCEPT_NAME" : "Chronic gastrointestinal tract vascular insufficiency", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266520007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4148256, + "CONCEPT_NAME" : "Acute GIT vascular insufficiency", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "266519001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124856, + "CONCEPT_NAME" : "Inferior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234041004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4055089, + "CONCEPT_NAME" : "Superior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197001004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4055025, + "CONCEPT_NAME" : "Superior mesenteric artery embolus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "196999001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4045408, + "CONCEPT_NAME" : "Ischemic stricture of intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "13026000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 201894, + "CONCEPT_NAME" : "Acute vascular insufficiency of intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "91489000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 192673, + "CONCEPT_NAME" : "Vascular insufficiency of intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82196007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 47, + "name" : "Thrombocytopenia (narrow)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 432870, + "CONCEPT_NAME" : "Thrombocytopenic disorder", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "302215000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37397537, + "CONCEPT_NAME" : "Beta thalassemia X-linked thrombocytopenia syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "718196002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36713112, + "CONCEPT_NAME" : "Pancytopenia due to antineoplastic chemotherapy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "328301000119102", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40321716, + "CONCEPT_NAME" : "Secondary thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "154826009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 435076, + "CONCEPT_NAME" : "Transient neonatal thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "23205009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4239484, + "CONCEPT_NAME" : "Acquired pancytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "5876000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 137829, + "CONCEPT_NAME" : "Aplastic anemia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "306058006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4133981, + "CONCEPT_NAME" : "Benign gestational thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "128090002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 436956, + "CONCEPT_NAME" : "Evans syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75331009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4316372, + "CONCEPT_NAME" : "HELLP syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95605009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42536958, + "CONCEPT_NAME" : "Pancytopenia caused by medication", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "736024007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4247776, + "CONCEPT_NAME" : "Posttransfusion purpura", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "73162004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 440982, + "CONCEPT_NAME" : "Wiskott-Aldrich syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "36070007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42537688, + "CONCEPT_NAME" : "Congenital thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "737221003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 437242, + "CONCEPT_NAME" : "Congenital thrombocytopenic purpura", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "267535004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4221109, + "CONCEPT_NAME" : "Neonatal thrombocytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82835005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 432881, + "CONCEPT_NAME" : "Pancytopenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "127034005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4119134, + "CONCEPT_NAME" : "Thrombocytopenic purpura", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "302873008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 49, + "name" : "Intraabdominal thrombosis - hepatic thrombosis ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4223098, + "CONCEPT_NAME" : "Hepatic artery thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "83940008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4301208, + "CONCEPT_NAME" : "Hepatic vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38739001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4111853, + "CONCEPT_NAME" : "Embolism and thrombosis of hepatic artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195343000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196715, + "CONCEPT_NAME" : "Budd-Chiari syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4277276, + "CONCEPT_NAME" : "Veno-occlusive disease of the liver", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "65617004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 50, + "name" : "Portal Vein thrombosis (include visceral, mesenteric)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 199837, + "CONCEPT_NAME" : "Portal vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17920008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37111372, + "CONCEPT_NAME" : "Visceral venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "726099002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4223670, + "CONCEPT_NAME" : "Thrombosis of abdominal aorta", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84272007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196715, + "CONCEPT_NAME" : "Budd-Chiari syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36717492, + "CONCEPT_NAME" : "Acute occlusion of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "721663007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757410, + "CONCEPT_NAME" : "Acute thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133421000119101", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45757409, + "CONCEPT_NAME" : "Chronic thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "133411000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4124856, + "CONCEPT_NAME" : "Inferior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "234041004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4173167, + "CONCEPT_NAME" : "Mesenteric embolus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "276500007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4144032, + "CONCEPT_NAME" : "Mesenteric thrombus and/or embolus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "307420006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4055089, + "CONCEPT_NAME" : "Superior mesenteric vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "197001004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4318407, + "CONCEPT_NAME" : "Thrombophlebitis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95447001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4317289, + "CONCEPT_NAME" : "Thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95446005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 52, + "name" : "Intraabdominal- splenic infacrtion and thrombosis ", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 36712891, + "CONCEPT_NAME" : "Chronic thrombosis of splenic vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "143551000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4033521, + "CONCEPT_NAME" : "Splenic vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14534009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 35615064, + "CONCEPT_NAME" : "Thrombosis of splenic artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15972701000119106", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36712892, + "CONCEPT_NAME" : "Acute thrombosis of splenic vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "143561000119108", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4044745, + "CONCEPT_NAME" : "Splenic infarction", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "22996003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4048527, + "CONCEPT_NAME" : "Fleckmilz", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "123617004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + }, + { + "id" : 55, + "name" : "cerebral venous sinus thrombosis (CVST narrow)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4111714, + "CONCEPT_NAME" : "Cerebral infarction due to cerebral venous thrombosis, non-pyogenic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195230003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4179912, + "CONCEPT_NAME" : "Intracranial venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "297157005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4061473, + "CONCEPT_NAME" : "Obstetric cerebral venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200258006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273550, + "CONCEPT_NAME" : "Thrombosis of intracranial venous sinus of pregnancy AND/OR puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63795001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45765438, + "CONCEPT_NAME" : "Neonatal noninfectious cerebral venous sinus thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "702374000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36717594, + "CONCEPT_NAME" : "Neonatal thrombosis of cerebral venous sinus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722930000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4223544, + "CONCEPT_NAME" : "Cerebral venous thrombosis of pregnancy AND/OR puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84216001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 56, + "name" : "cerebral venous sinus thrombosis (CVST broad)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 318137, + "CONCEPT_NAME" : "Phlebitis and thrombophlebitis of intracranial sinuses", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "192753009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4111714, + "CONCEPT_NAME" : "Cerebral infarction due to cerebral venous thrombosis, non-pyogenic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "195230003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4045733, + "CONCEPT_NAME" : "Cerebrovascular and spinal vascular disorders", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "230689003", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4179912, + "CONCEPT_NAME" : "Intracranial venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "297157005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4061473, + "CONCEPT_NAME" : "Obstetric cerebral venous thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "200258006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273550, + "CONCEPT_NAME" : "Thrombosis of intracranial venous sinus of pregnancy AND/OR puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "63795001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45765438, + "CONCEPT_NAME" : "Neonatal noninfectious cerebral venous sinus thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "702374000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 36717594, + "CONCEPT_NAME" : "Neonatal thrombosis of cerebral venous sinus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "722930000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4223544, + "CONCEPT_NAME" : "Cerebral venous thrombosis of pregnancy AND/OR puerperium", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84216001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 57, + "name" : "other Intraabdominal thrombosis", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4049318, + "CONCEPT_NAME" : "Thrombosis of renal vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "15842009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4223670, + "CONCEPT_NAME" : "Thrombosis of abdominal aorta", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84272007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 444264, + "CONCEPT_NAME" : "Thrombosis of iliac artery", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82453008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4207615, + "CONCEPT_NAME" : "Thrombosis of vein of trunk", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "312584000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4273526, + "CONCEPT_NAME" : "Vertebral artery thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "64775002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 196715, + "CONCEPT_NAME" : "Budd-Chiari syndrome", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82385007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 199837, + "CONCEPT_NAME" : "Portal vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17920008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4317289, + "CONCEPT_NAME" : "Thrombosis of mesenteric vein", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "95446005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 195294, + "CONCEPT_NAME" : "Thrombosed hemorrhoids", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "75955007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4033521, + "CONCEPT_NAME" : "Splenic vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "14534009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4301208, + "CONCEPT_NAME" : "Hepatic vein thrombosis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38739001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4092406, + "CONCEPT_NAME" : "Portal thrombophlebitis", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "24805007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "All" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [ + { + "name" : "Thrombocytopenia within 7 days of thrombosis with no such event in the past 90 days (clean window) ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [], + "Groups" : [ + { + "Type" : "ANY", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 2, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 10, + "Op" : "bt", + "Extent" : 150 + }, + "Unit" : [ + { + "CONCEPT_ID" : 8686, + "CONCEPT_NAME" : "cubic millimeter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "mm3", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8785, + "CONCEPT_NAME" : "per cubic millimeter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "/mm3", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8848, + "CONCEPT_NAME" : "thousand per microliter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*3/uL", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8961, + "CONCEPT_NAME" : "thousand per cubic millimeter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*3/mm3", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9444, + "CONCEPT_NAME" : "billion per liter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*9/L", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9254, + "CONCEPT_NAME" : "per liter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "/L", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8816, + "CONCEPT_NAME" : "million per milliliter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*6/mL", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 7, + "Coeff" : -1 + }, + "End" : { + "Days" : 7, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 2, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 10, + "Op" : "bt", + "Extent" : 150 + }, + "RangeLow" : { + "Value" : 130, + "Op" : "bt", + "Extent" : 170 + } + } + }, + "StartWindow" : { + "Start" : { + "Days" : 7, + "Coeff" : -1 + }, + "End" : { + "Days" : 7, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 47, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 7, + "Coeff" : -1 + }, + "End" : { + "Days" : 7, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 2, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 10, + "Op" : "bt", + "Extent" : 150 + }, + "Unit" : [ + { + "CONCEPT_ID" : 8686, + "CONCEPT_NAME" : "cubic millimeter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "mm3", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8785, + "CONCEPT_NAME" : "per cubic millimeter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "/mm3", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8848, + "CONCEPT_NAME" : "thousand per microliter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*3/uL", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 8961, + "CONCEPT_NAME" : "thousand per cubic millimeter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*3/mm3", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9444, + "CONCEPT_NAME" : "billion per liter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*9/L", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 9254, + "CONCEPT_NAME" : "per liter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "/L", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + }, + { + "CONCEPT_ID" : 45890995, + "CONCEPT_NAME" : "Million unit per milliliter", + "STANDARD_CONCEPT" : null, + "STANDARD_CONCEPT_CAPTION" : "Unknown", + "INVALID_REASON" : null, + "INVALID_REASON_CAPTION" : "Unknown", + "CONCEPT_CODE" : "10*6.[U]/mL", + "DOMAIN_ID" : "Unit", + "VOCABULARY_ID" : "UCUM", + "CONCEPT_CLASS_ID" : null + } + ] + } + }, + "StartWindow" : { + "Start" : { + "Days" : 90, + "Coeff" : -1 + }, + "End" : { + "Days" : 7, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "Measurement" : { + "CodesetId" : 2, + "MeasurementTypeExclude" : false, + "ValueAsNumber" : { + "Value" : 10, + "Op" : "bt", + "Extent" : 150 + }, + "RangeLow" : { + "Value" : 130, + "Op" : "bt", + "Extent" : 170 + } + } + }, + "StartWindow" : { + "Start" : { + "Days" : 90, + "Coeff" : -1 + }, + "End" : { + "Days" : 7, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 1, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 90, + "Coeff" : -1 + }, + "End" : { + "Days" : 7, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + ] + } + }, + { + "name" : "Thrombosis clean window period (-365 days)", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 56, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 34, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 35, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 49, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 52, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 50, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 57, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 44, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 40, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 41, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + }, + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 43, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 365, + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "StartDate", + "Offset" : 1 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1093.json b/tests/cohorts/1093.json new file mode 100644 index 00000000..ce4dff13 --- /dev/null +++ b/tests/cohorts/1093.json @@ -0,0 +1,704 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 84, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 84 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 84, + "name" : "AAA repair (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2002250, + "CONCEPT_NAME" : "Endovascular implantation of other graft in abdominal aorta", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39.71", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730049, + "CONCEPT_NAME" : "Excision of Abdominal Aorta, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04B00ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730053, + "CONCEPT_NAME" : "Excision of Abdominal Aorta, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04B04ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42894733, + "CONCEPT_NAME" : "Excision of Thoracic Aorta, Ascending/Arch, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "02BX0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42894737, + "CONCEPT_NAME" : "Excision of Thoracic Aorta, Ascending/Arch, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "02BX4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2725615, + "CONCEPT_NAME" : "Excision of Thoracic Aorta, Descending, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "02BW0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2725619, + "CONCEPT_NAME" : "Excision of Thoracic Aorta, Descending, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "02BW4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729915, + "CONCEPT_NAME" : "Replacement of Abdominal Aorta with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04R007Z", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730103, + "CONCEPT_NAME" : "Replacement of Abdominal Aorta with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04R047Z", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729917, + "CONCEPT_NAME" : "Replacement of Abdominal Aorta with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04R00KZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730105, + "CONCEPT_NAME" : "Replacement of Abdominal Aorta with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04R04KZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729916, + "CONCEPT_NAME" : "Replacement of Abdominal Aorta with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04R00JZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730104, + "CONCEPT_NAME" : "Replacement of Abdominal Aorta with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04R04JZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002063, + "CONCEPT_NAME" : "Resection of vessel with anastomosis, aorta", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38.34", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002084, + "CONCEPT_NAME" : "Resection of vessel with replacement, aorta, abdominal", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38.44", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736486, + "CONCEPT_NAME" : "Restriction of Abdominal Aorta with Intraluminal Device, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04V00DZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736490, + "CONCEPT_NAME" : "Restriction of Abdominal Aorta with Intraluminal Device, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04V03DZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736494, + "CONCEPT_NAME" : "Restriction of Abdominal Aorta with Intraluminal Device, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04V04DZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42897039, + "CONCEPT_NAME" : "Restriction of Abdominal Aorta, Bifurcation, with Intraluminal Device, Open Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04V00D6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42897078, + "CONCEPT_NAME" : "Restriction of Abdominal Aorta, Bifurcation, with Intraluminal Device, Percutaneous Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04V03D6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 42897085, + "CONCEPT_NAME" : "Restriction of Abdominal Aorta, Bifurcation, with Intraluminal Device, Percutaneous Endoscopic Approach (Deprecated)", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04V04D6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730884, + "CONCEPT_NAME" : "Supplement Abdominal Aorta with Synthetic Substitute, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04U03JZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730887, + "CONCEPT_NAME" : "Supplement Abdominal Aorta with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04U04JZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1094.json b/tests/cohorts/1094.json new file mode 100644 index 00000000..fb05c80b --- /dev/null +++ b/tests/cohorts/1094.json @@ -0,0 +1,27666 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 85, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 85 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 85, + "name" : "Lower Extremity Bypass (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2002187, + "CONCEPT_NAME" : "Aorta-iliac-femoral bypass", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39.25", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729943, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730416, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729923, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410098", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730209, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410498", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730169, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730456, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729963, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730436, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730189, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730476, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Common Iliac Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729949, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730422, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729929, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009G", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730215, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049G", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730175, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730462, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729969, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730442, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730195, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730668, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral External Iliac Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729952, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730425, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729932, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730218, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730178, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730465, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729972, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730445, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730198, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730671, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729946, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730419, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729926, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730212, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730172, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730459, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729966, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730439, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730192, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730665, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Bilateral Internal Iliac Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729942, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730415, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729922, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410097", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730208, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410497", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730168, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730455, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729962, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730435, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730188, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730475, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Common Iliac Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729948, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730421, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729928, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730214, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730174, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730461, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729968, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730441, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730194, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730667, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left External Iliac Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729951, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730424, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729931, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730217, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730177, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730464, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729971, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730444, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730197, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730670, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729945, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730418, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729925, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730211, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730171, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730458, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729965, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730438, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730191, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730664, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Left Internal Iliac Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729954, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730427, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729934, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009R", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730220, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049R", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730180, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730467, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729974, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730447, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730200, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730673, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZR", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729953, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730426, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729933, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730219, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730179, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730466, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729973, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730446, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730199, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730672, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729941, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730414, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729921, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410096", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730207, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410496", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730167, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730454, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729961, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730434, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730187, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730474, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Common Iliac Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729947, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730420, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729927, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730213, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730173, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730460, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729967, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730440, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730193, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730666, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right External Iliac Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729950, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730423, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729930, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041009H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730216, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041049H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730176, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730463, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729970, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730443, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730196, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730669, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729944, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730417, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729924, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410099", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730210, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0410499", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730170, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730457, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729964, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730437, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730190, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04100Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730663, + "CONCEPT_NAME" : "Bypass Abdominal Aorta to Right Internal Iliac Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "04104Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735223, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06130AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735420, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06134AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735221, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061307Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735227, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061347Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735222, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061309Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735228, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061349Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735225, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06130KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735422, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06134KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735224, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06130JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735421, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06134JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735226, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06130ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735423, + "CONCEPT_NAME" : "Bypass Esophageal Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "06134ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727323, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727307, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312095", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726917, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727339, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726933, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727329, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727313, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031209C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726923, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727345, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726939, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727320, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727304, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312092", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726914, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727336, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726930, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727326, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727310, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312098", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726920, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727342, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726936, + "CONCEPT_NAME" : "Bypass Innominate Artery to Bilateral Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727333, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727317, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031209K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726927, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727349, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726943, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727322, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727306, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726916, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727338, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726932, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727328, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727312, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031209B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726922, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727344, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726938, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727319, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727303, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312091", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726913, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727335, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726929, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727325, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727309, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312097", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726919, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727341, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726935, + "CONCEPT_NAME" : "Bypass Innominate Artery to Left Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727331, + "CONCEPT_NAME" : "Bypass Innominate Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727315, + "CONCEPT_NAME" : "Bypass Innominate Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031209F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726925, + "CONCEPT_NAME" : "Bypass Innominate Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727347, + "CONCEPT_NAME" : "Bypass Innominate Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726941, + "CONCEPT_NAME" : "Bypass Innominate Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727332, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727316, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031209J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726926, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727348, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726942, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727321, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727305, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726915, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727337, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726931, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727327, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727311, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312099", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726921, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727343, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726937, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727318, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727302, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312090", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726912, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727334, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726928, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727324, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727308, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0312096", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726918, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727340, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726934, + "CONCEPT_NAME" : "Bypass Innominate Artery to Right Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727330, + "CONCEPT_NAME" : "Bypass Innominate Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727314, + "CONCEPT_NAME" : "Bypass Innominate Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031209D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726924, + "CONCEPT_NAME" : "Bypass Innominate Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727346, + "CONCEPT_NAME" : "Bypass Innominate Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726940, + "CONCEPT_NAME" : "Bypass Innominate Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03120ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727618, + "CONCEPT_NAME" : "Bypass Intracranial Artery to Intracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031G0AG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727617, + "CONCEPT_NAME" : "Bypass Intracranial Artery to Intracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031G09G", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727620, + "CONCEPT_NAME" : "Bypass Intracranial Artery to Intracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031G0KG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727619, + "CONCEPT_NAME" : "Bypass Intracranial Artery to Intracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031G0JG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727621, + "CONCEPT_NAME" : "Bypass Intracranial Artery to Intracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031G0ZG", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734546, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734552, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734544, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734550, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734545, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734551, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734548, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734554, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734547, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734553, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734549, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734555, + "CONCEPT_NAME" : "Bypass Intracranial Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051L4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727352, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727836, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316095", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727384, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727368, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727400, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727358, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727842, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031609C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727390, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727374, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727406, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727849, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727833, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316092", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727381, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727365, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727397, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727355, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727839, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316098", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727387, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727371, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727403, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Bilateral Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727362, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727846, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031609K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727394, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727378, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727410, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727351, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727835, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727383, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727367, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727399, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727357, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727841, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031609B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727389, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727373, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727405, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727848, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727832, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316091", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727380, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727364, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727396, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727354, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727838, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316097", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727386, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727370, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727402, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Left Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727360, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727844, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031609F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727392, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727376, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727408, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727361, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727845, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031609J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727393, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727377, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727409, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727350, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727834, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727382, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727366, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727398, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727356, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727840, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316099", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727388, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727372, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727404, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727847, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727831, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316090", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727379, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727363, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727395, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727353, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727837, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0316096", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727385, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727369, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727401, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Right Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727359, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727843, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031609D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727391, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727375, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727407, + "CONCEPT_NAME" : "Bypass Left Axillary Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03160ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734060, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05180AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734066, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05184AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734058, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051807Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734064, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051847Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734059, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051809Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734065, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051849Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734062, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05180KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734068, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05184KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734061, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05180JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734067, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05184JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734063, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05180ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734069, + "CONCEPT_NAME" : "Bypass Left Axillary Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05184ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734295, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734301, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734293, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734299, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734294, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734300, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734297, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734303, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734296, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734302, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734298, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734304, + "CONCEPT_NAME" : "Bypass Left Basilic Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051C4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727436, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727432, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0318094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727444, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727440, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727448, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727435, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180A1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727431, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0318091", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727443, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180K1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727439, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180J1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727447, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Left Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180Z1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727438, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727434, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031809F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727446, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727442, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727450, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727437, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727433, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031809D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727445, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727441, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727449, + "CONCEPT_NAME" : "Bypass Left Brachial Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03180ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734084, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734090, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734082, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734088, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734083, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734089, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734086, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734092, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734085, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734091, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734087, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734093, + "CONCEPT_NAME" : "Bypass Left Brachial Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051A4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734319, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734325, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734317, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734323, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734318, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734324, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734321, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734327, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734320, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734326, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734322, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734328, + "CONCEPT_NAME" : "Bypass Left Cephalic Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051F4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727635, + "CONCEPT_NAME" : "Bypass Left Common Carotid Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031J0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727633, + "CONCEPT_NAME" : "Bypass Left Common Carotid Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031J09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727639, + "CONCEPT_NAME" : "Bypass Left Common Carotid Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031J0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727637, + "CONCEPT_NAME" : "Bypass Left Common Carotid Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031J0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727641, + "CONCEPT_NAME" : "Bypass Left Common Carotid Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031J0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731688, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732163, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731668, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731955, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731915, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732203, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731708, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732183, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731935, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732412, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731687, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732162, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731667, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731954, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731914, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732202, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731707, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732182, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731934, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732411, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731686, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732161, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731666, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731953, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731913, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732201, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731706, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732181, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731933, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732410, + "CONCEPT_NAME" : "Bypass Left Common Iliac Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041D4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735929, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735935, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735927, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735933, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735928, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735934, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735931, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735937, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735930, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735936, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735932, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735938, + "CONCEPT_NAME" : "Bypass Left Common Iliac Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061D4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727658, + "CONCEPT_NAME" : "Bypass Left External Carotid Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031N0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727657, + "CONCEPT_NAME" : "Bypass Left External Carotid Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031N09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727660, + "CONCEPT_NAME" : "Bypass Left External Carotid Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031N0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727659, + "CONCEPT_NAME" : "Bypass Left External Carotid Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031N0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727661, + "CONCEPT_NAME" : "Bypass Left External Carotid Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031N0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729777, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730019, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729766, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730008, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729986, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730229, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729788, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730030, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729997, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730240, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729776, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730018, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729765, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730007, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729985, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730228, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729787, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730029, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729996, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730239, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729775, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730017, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729764, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730006, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729984, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730227, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729786, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730028, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729995, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730238, + "CONCEPT_NAME" : "Bypass Left External Iliac Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041J4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735953, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735959, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735951, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735957, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735952, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735958, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735955, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735961, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735954, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735960, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735956, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735962, + "CONCEPT_NAME" : "Bypass Left External Iliac Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061G4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734594, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734789, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734592, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734787, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734593, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734788, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734596, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734791, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734595, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734790, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734597, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734792, + "CONCEPT_NAME" : "Bypass Left External Jugular Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051Q4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734831, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734837, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734829, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734835, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734830, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734836, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734833, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734839, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734832, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734838, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734834, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734840, + "CONCEPT_NAME" : "Bypass Left Face Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051V4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730531, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730763, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730522, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730754, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730736, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730781, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730727, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730772, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730745, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730977, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730535, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730767, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730526, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730758, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730740, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730785, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730731, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730776, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730749, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730981, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730530, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730762, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730521, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730753, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730735, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730780, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730726, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730771, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730744, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730976, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730536, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730768, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730527, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730759, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730741, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730786, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730732, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730777, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730750, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730982, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730537, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730769, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730528, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730760, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730742, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730787, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730733, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730778, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730751, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730983, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730533, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730765, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730524, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730756, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730738, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730783, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730729, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730774, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730747, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730979, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Peroneal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730532, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730764, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730523, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730755, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730737, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730782, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730728, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730773, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730746, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730978, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Popliteal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730534, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730766, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730525, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09N", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730757, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49N", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730739, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730784, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730730, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730775, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730748, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730980, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Posterior Tibial Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730529, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730761, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730520, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730752, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730734, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730779, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730538, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730770, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730743, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730788, + "CONCEPT_NAME" : "Bypass Left Femoral Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041L4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736186, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736192, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736184, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736190, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736185, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736191, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736188, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736194, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736187, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736193, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736189, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736195, + "CONCEPT_NAME" : "Bypass Left Femoral Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061N4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015480, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015495, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015477, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015492, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015486, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015501, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015483, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015498, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015489, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015504, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015481, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015496, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015478, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015493, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015487, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015502, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015484, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015499, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015490, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015505, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015482, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015497, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015479, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015494, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015488, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015503, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015485, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015500, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015491, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015506, + "CONCEPT_NAME" : "Bypass Left Foot Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041W4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736443, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736449, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736441, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736447, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736442, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736448, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736445, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736451, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736444, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736450, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736446, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736452, + "CONCEPT_NAME" : "Bypass Left Foot Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061V4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734343, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734540, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734341, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734538, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734342, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734539, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734536, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734542, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734344, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734541, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734537, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734543, + "CONCEPT_NAME" : "Bypass Left Hand Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051H4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727648, + "CONCEPT_NAME" : "Bypass Left Internal Carotid Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031L0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727647, + "CONCEPT_NAME" : "Bypass Left Internal Carotid Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031L09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727650, + "CONCEPT_NAME" : "Bypass Left Internal Carotid Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031L0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727649, + "CONCEPT_NAME" : "Bypass Left Internal Carotid Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031L0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727651, + "CONCEPT_NAME" : "Bypass Left Internal Carotid Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031L0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732922, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733166, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732911, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732966, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732944, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733188, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732933, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733177, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732955, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733199, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732921, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733165, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732910, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732965, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732943, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733187, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732932, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733176, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732954, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733198, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732920, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733164, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732909, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732964, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732942, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733186, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732931, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733175, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732953, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733197, + "CONCEPT_NAME" : "Bypass Left Internal Iliac Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041F4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734570, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734576, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734568, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734574, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734569, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734575, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734572, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734578, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734571, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734577, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734573, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734579, + "CONCEPT_NAME" : "Bypass Left Internal Jugular Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051N4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015420, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015435, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015417, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015432, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015426, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015441, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015423, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015438, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015429, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015444, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015421, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015436, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015418, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015433, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015427, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015442, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015424, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015439, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015430, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015445, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015422, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015437, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015419, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015434, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015428, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015443, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015425, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015440, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015431, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015446, + "CONCEPT_NAME" : "Bypass Left Peroneal Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041U4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731225, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731250, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731036, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731245, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731235, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731260, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731230, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731255, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731240, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731265, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731226, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731251, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731037, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731246, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731236, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731261, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731231, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731256, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731241, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731266, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731227, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731252, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731038, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731247, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731237, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731262, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731232, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731257, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731242, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731267, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731224, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731249, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731035, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N09M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731244, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N49M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731234, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731259, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731229, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731254, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731239, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731264, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Peroneal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731223, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731248, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731034, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N09L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731243, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N49L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731233, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731258, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731228, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731253, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731238, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N0ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731263, + "CONCEPT_NAME" : "Bypass Left Popliteal Artery to Popliteal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041N4ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727609, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727607, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727613, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727611, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727615, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727610, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727608, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C09F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727614, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727612, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727616, + "CONCEPT_NAME" : "Bypass Left Radial Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031C0ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736210, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736216, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736208, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736214, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736209, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736215, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736212, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736218, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736211, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736217, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736213, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736219, + "CONCEPT_NAME" : "Bypass Left Saphenous Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061Q4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727057, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727039, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314095", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727093, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727075, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727738, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727063, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727045, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031409C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727726, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727081, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727744, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727054, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727036, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314092", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727090, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727072, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727735, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727060, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727042, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314098", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727096, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727078, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727741, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Bilateral Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727067, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727049, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031409K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727730, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727085, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727748, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727056, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727038, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727092, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727074, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727737, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727062, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727044, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031409B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727098, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727080, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727743, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727053, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727035, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314091", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727089, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727071, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727734, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727059, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727041, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314097", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727095, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727077, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727740, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Left Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727065, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727047, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031409F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727728, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727083, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727746, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727066, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727048, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031409J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727729, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727084, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727747, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727055, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727037, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727091, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727073, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727736, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727061, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727043, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314099", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727097, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727079, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727742, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727052, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727034, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314090", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727088, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727070, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727733, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727058, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727040, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0314096", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727094, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727076, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727739, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Right Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727064, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727046, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031409D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727727, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727082, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727745, + "CONCEPT_NAME" : "Bypass Left Subclavian Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03140ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727463, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727461, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727467, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727465, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727469, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727464, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727462, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A09F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727468, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727466, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727470, + "CONCEPT_NAME" : "Bypass Left Ulnar Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031A0ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734807, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734813, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734805, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734811, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734806, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734812, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734809, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734815, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734808, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734814, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734810, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734816, + "CONCEPT_NAME" : "Bypass Left Vertebral Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051S4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727772, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727756, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315095", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727804, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727788, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727820, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727778, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727762, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031509C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727810, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727794, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727826, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727769, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727753, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315092", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727801, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727785, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727817, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727775, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727759, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315098", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727807, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727791, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727823, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Bilateral Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727782, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727766, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031509K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727814, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727798, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727830, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727771, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727755, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727803, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727787, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727819, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727777, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727761, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031509B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727809, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727793, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727825, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727768, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727752, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315091", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727800, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727784, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727816, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727774, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727758, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315097", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727806, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727790, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727822, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Left Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727780, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727764, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031509F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727812, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727796, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727828, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727781, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727765, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031509J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727813, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727797, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727829, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727770, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727754, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727802, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727786, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727818, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727776, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727760, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315099", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727808, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727792, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727824, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727767, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727751, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315090", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727799, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727783, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727815, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727773, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727757, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0315096", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727805, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727789, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727821, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Right Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727779, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727763, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031509D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727811, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727795, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727827, + "CONCEPT_NAME" : "Bypass Right Axillary Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03150ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734048, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05170AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734054, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05174AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734046, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051707Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734052, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051747Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734047, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051709Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734053, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051749Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734050, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05170KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734056, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05174KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734049, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05170JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734055, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05174JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734051, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05170ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734057, + "CONCEPT_NAME" : "Bypass Right Axillary Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05174ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734283, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734289, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734094, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734287, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734282, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734288, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734285, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734291, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734284, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734290, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734286, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734292, + "CONCEPT_NAME" : "Bypass Right Basilic Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051B4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727418, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727414, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031709F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727426, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727422, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727430, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727416, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727412, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0317093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727424, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727420, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727428, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727415, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170A0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727411, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0317090", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727423, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170K0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727419, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170J0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727427, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Right Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170Z0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727417, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727413, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031709D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727425, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727421, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727429, + "CONCEPT_NAME" : "Bypass Right Brachial Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03170ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734072, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05190AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734078, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05194AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734070, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051907Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734076, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051947Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734071, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051909Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734077, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051949Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734074, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05190KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734080, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05194KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734073, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05190JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734079, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05194JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734075, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05190ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734081, + "CONCEPT_NAME" : "Bypass Right Brachial Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "05194ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734307, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734313, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734305, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734311, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734306, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734312, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734309, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734315, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734308, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734314, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734310, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734316, + "CONCEPT_NAME" : "Bypass Right Cephalic Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051D4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727625, + "CONCEPT_NAME" : "Bypass Right Common Carotid Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031H0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727623, + "CONCEPT_NAME" : "Bypass Right Common Carotid Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031H09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727629, + "CONCEPT_NAME" : "Bypass Right Common Carotid Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031H0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727627, + "CONCEPT_NAME" : "Bypass Right Common Carotid Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031H0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727631, + "CONCEPT_NAME" : "Bypass Right Common Carotid Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031H0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730928, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731214, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730721, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731194, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730968, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731443, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730948, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731423, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731174, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731463, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730927, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731213, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730720, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731193, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730967, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731442, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730947, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731422, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731173, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731462, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730926, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731212, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730719, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731192, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730966, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731441, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730946, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731421, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731172, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731461, + "CONCEPT_NAME" : "Bypass Right Common Iliac Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041C4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735727, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735733, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735725, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735731, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735726, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735732, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735729, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735735, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735728, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735734, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735730, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735926, + "CONCEPT_NAME" : "Bypass Right Common Iliac Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061C4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727653, + "CONCEPT_NAME" : "Bypass Right External Carotid Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031M0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727652, + "CONCEPT_NAME" : "Bypass Right External Carotid Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031M09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727655, + "CONCEPT_NAME" : "Bypass Right External Carotid Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031M0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727654, + "CONCEPT_NAME" : "Bypass Right External Carotid Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031M0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727656, + "CONCEPT_NAME" : "Bypass Right External Carotid Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031M0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733410, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733465, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733210, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733454, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733432, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729744, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733421, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729733, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733443, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729755, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733220, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733464, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733209, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733453, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733431, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729743, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733420, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729732, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733442, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729754, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733219, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733463, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733208, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733452, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733430, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729742, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733419, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729731, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2733441, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2729753, + "CONCEPT_NAME" : "Bypass Right External Iliac Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041H4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735941, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735947, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735939, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735945, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735940, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735946, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735943, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735949, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735942, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735948, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735944, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735950, + "CONCEPT_NAME" : "Bypass Right External Iliac Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061F4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734582, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734588, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734580, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734586, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734581, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734587, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734584, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734590, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734583, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734589, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734585, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734591, + "CONCEPT_NAME" : "Bypass Right External Jugular Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051P4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734819, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734825, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734817, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734823, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734818, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734824, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734821, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734827, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734820, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734826, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734822, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734828, + "CONCEPT_NAME" : "Bypass Right Face Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051T4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730254, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730486, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730245, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730477, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730272, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730504, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730263, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730495, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730281, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730513, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730258, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730490, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730249, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730481, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730276, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730508, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730267, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730499, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730285, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730517, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730253, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730485, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730244, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730289, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730271, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730503, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730262, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730494, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730280, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730512, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730259, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730491, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730250, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730482, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730277, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730509, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730268, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730500, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730286, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730518, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730260, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730492, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730251, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730483, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730278, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730510, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730269, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730501, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730287, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730519, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730256, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730488, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730247, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730479, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730274, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730506, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730265, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730497, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730283, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730515, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Peroneal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730255, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730487, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730246, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730478, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730273, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730505, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730264, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730496, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730282, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730514, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Popliteal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730257, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730489, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730248, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09N", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730480, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49N", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730275, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730507, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730266, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730498, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730284, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730516, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Posterior Tibial Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZN", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730252, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730484, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730243, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730288, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730270, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730502, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730261, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730493, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730279, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730511, + "CONCEPT_NAME" : "Bypass Right Femoral Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041K4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736174, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736180, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735987, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736178, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736173, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736179, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736176, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736182, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736175, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736181, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736177, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736183, + "CONCEPT_NAME" : "Bypass Right Femoral Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061M4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015450, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015465, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015447, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015462, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015456, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015471, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015453, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015468, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015459, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015474, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015451, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015466, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015448, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015463, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015457, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015472, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015454, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015469, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015460, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015475, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015452, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015467, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015449, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015464, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015458, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015473, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015455, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015470, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015461, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015476, + "CONCEPT_NAME" : "Bypass Right Foot Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041V4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736431, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736437, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736429, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736435, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736430, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736436, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736433, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736439, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736432, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736438, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736434, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736440, + "CONCEPT_NAME" : "Bypass Right Foot Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061T4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734331, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734337, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734329, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734335, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734330, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734336, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734333, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734339, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734332, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734338, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734334, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734340, + "CONCEPT_NAME" : "Bypass Right Hand Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051G4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735965, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735971, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735963, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735969, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735964, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735970, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735967, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735973, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735966, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735972, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735968, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2735974, + "CONCEPT_NAME" : "Bypass Right Hypogastric Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061H4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727643, + "CONCEPT_NAME" : "Bypass Right Internal Carotid Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031K0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727642, + "CONCEPT_NAME" : "Bypass Right Internal Carotid Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031K09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727645, + "CONCEPT_NAME" : "Bypass Right Internal Carotid Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031K0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727644, + "CONCEPT_NAME" : "Bypass Right Internal Carotid Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031K0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727646, + "CONCEPT_NAME" : "Bypass Right Internal Carotid Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031K0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732434, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732678, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732423, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E09K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732667, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E49K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732456, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732700, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732445, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732689, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732467, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732711, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Bilateral Femoral Arteries, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732433, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732677, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732422, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E09J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732666, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E49J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732455, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732699, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732444, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732688, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732466, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732710, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Left Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732432, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732676, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4AH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732421, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E09H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732665, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E49H", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732454, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732698, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4KH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732443, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732687, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4JH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732465, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E0ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2732709, + "CONCEPT_NAME" : "Bypass Right Internal Iliac Artery to Right Femoral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041E4ZH", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734558, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734564, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734556, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734562, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734557, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734563, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734560, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734566, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734559, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734565, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734561, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734567, + "CONCEPT_NAME" : "Bypass Right Internal Jugular Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051M4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015390, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015405, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015387, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015402, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015396, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015411, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015393, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015408, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015399, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015414, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015391, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015406, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015388, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015403, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015397, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015412, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015394, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015409, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015400, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015415, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015392, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015407, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015389, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015404, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015398, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015413, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015395, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015410, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015401, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43015416, + "CONCEPT_NAME" : "Bypass Right Peroneal Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041T4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730991, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731016, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4AP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730986, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M09P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731011, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M49P", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731001, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731026, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4KP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730996, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731021, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4JP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731006, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731031, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Foot Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4ZP", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730992, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731017, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4AQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730987, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M09Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731012, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M49Q", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731002, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731027, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4KQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730997, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731022, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4JQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731007, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731032, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4ZQ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730993, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731018, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4AS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730988, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M09S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731013, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M49S", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731003, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731028, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4KS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730998, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731023, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4JS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731008, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731033, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Lower Extremity Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4ZS", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730990, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731015, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4AM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730985, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M09M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731010, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M49M", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731000, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731025, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4KM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730995, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731020, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4JM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731005, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731030, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Peroneal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4ZM", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730989, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731014, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4AL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730984, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M09L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731009, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M49L", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730999, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731024, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4KL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2730994, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731019, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4JL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731004, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M0ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2731029, + "CONCEPT_NAME" : "Bypass Right Popliteal Artery to Popliteal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "041M4ZL", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727474, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727472, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B09F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727604, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727602, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727606, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727473, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727471, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727603, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727601, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727605, + "CONCEPT_NAME" : "Bypass Right Radial Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031B0Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736198, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736204, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736196, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736202, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736197, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736203, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736200, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736206, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736199, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736205, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736201, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2736207, + "CONCEPT_NAME" : "Bypass Right Saphenous Vein to Lower Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "061P4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726967, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726949, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313095", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727003, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726985, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727021, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726973, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130AC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726955, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031309C", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727009, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130KC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726991, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130JC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727027, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130ZC", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726964, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726946, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313092", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727000, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726982, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727018, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z2", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726970, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726952, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313098", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727006, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726988, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727024, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Bilateral Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z8", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726977, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130AK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726959, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031309K", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727013, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130KK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726995, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130JK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727031, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130ZK", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726966, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726948, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313094", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727002, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726984, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727020, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726972, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130AB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726954, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031309B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727008, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726990, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727026, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726963, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726945, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313091", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726999, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726981, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727017, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z1", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726969, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726951, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313097", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727005, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726987, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727023, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Left Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726975, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726957, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031309F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727011, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726993, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727029, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726976, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Extracranial Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130AJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726958, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Extracranial Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031309J", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727012, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Extracranial Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130KJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726994, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Extracranial Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130JJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727030, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Extracranial Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130ZJ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726965, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726947, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727001, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726983, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727019, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726971, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726953, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313099", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727007, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726989, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727025, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Lower Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726962, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726944, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313090", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726998, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726980, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727016, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z0", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726968, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Leg Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130A6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726950, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Leg Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0313096", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727004, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Leg Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726986, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Leg Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727022, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Right Upper Leg Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726974, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Upper Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130AD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726956, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Upper Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031309D", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727010, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Upper Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130KD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2726992, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Upper Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130JD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727028, + "CONCEPT_NAME" : "Bypass Right Subclavian Artery to Upper Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03130ZD", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727454, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Lower Arm Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190AF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727452, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Lower Arm Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "031909F", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727458, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Lower Arm Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190KF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727456, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Lower Arm Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190JF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727460, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Lower Arm Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190ZF", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727453, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Right Lower Arm Artery with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190A3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727451, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Right Lower Arm Artery with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0319093", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727457, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Right Lower Arm Artery with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190K3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727455, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Right Lower Arm Artery with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190J3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2727459, + "CONCEPT_NAME" : "Bypass Right Ulnar Artery to Right Lower Arm Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03190Z3", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734795, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Autologous Arterial Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R0AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734801, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Autologous Arterial Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R4AY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734793, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R07Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734799, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R47Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734794, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Autologous Venous Tissue, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R09Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734800, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Autologous Venous Tissue, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R49Y", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734797, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R0KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734803, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R4KY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734796, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R0JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734802, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R4JY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734798, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R0ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2734804, + "CONCEPT_NAME" : "Bypass Right Vertebral Vein to Upper Vein, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "051R4ZY", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002191, + "CONCEPT_NAME" : "Other (peripheral) vascular shunt or bypass", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "39.29", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1095.json b/tests/cohorts/1095.json new file mode 100644 index 00000000..385df890 --- /dev/null +++ b/tests/cohorts/1095.json @@ -0,0 +1,874 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 86, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 86 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 86, + "name" : "Carotid Endarterectomy (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2002027, + "CONCEPT_NAME" : "Endarterectomy, other vessels of head and neck", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "38.12", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728555, + "CONCEPT_NAME" : "Extirpation of Matter from Face Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CR0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728556, + "CONCEPT_NAME" : "Extirpation of Matter from Face Artery, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CR3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728557, + "CONCEPT_NAME" : "Extirpation of Matter from Face Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CR4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728410, + "CONCEPT_NAME" : "Extirpation of Matter from Left Common Carotid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CJ0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728412, + "CONCEPT_NAME" : "Extirpation of Matter from Left Common Carotid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CJ4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728546, + "CONCEPT_NAME" : "Extirpation of Matter from Left External Carotid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CN0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728548, + "CONCEPT_NAME" : "Extirpation of Matter from Left External Carotid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CN4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728540, + "CONCEPT_NAME" : "Extirpation of Matter from Left Internal Carotid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CL0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728542, + "CONCEPT_NAME" : "Extirpation of Matter from Left Internal Carotid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CL4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728561, + "CONCEPT_NAME" : "Extirpation of Matter from Left Temporal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CT0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728562, + "CONCEPT_NAME" : "Extirpation of Matter from Left Temporal Artery, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CT3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728563, + "CONCEPT_NAME" : "Extirpation of Matter from Left Temporal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CT4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728567, + "CONCEPT_NAME" : "Extirpation of Matter from Left Thyroid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CV0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728568, + "CONCEPT_NAME" : "Extirpation of Matter from Left Thyroid Artery, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CV3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728569, + "CONCEPT_NAME" : "Extirpation of Matter from Left Thyroid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CV4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728552, + "CONCEPT_NAME" : "Extirpation of Matter from Left Vertebral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CQ0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728554, + "CONCEPT_NAME" : "Extirpation of Matter from Left Vertebral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CQ4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728407, + "CONCEPT_NAME" : "Extirpation of Matter from Right Common Carotid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CH0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728409, + "CONCEPT_NAME" : "Extirpation of Matter from Right Common Carotid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CH4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728543, + "CONCEPT_NAME" : "Extirpation of Matter from Right External Carotid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CM0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728545, + "CONCEPT_NAME" : "Extirpation of Matter from Right External Carotid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CM4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728413, + "CONCEPT_NAME" : "Extirpation of Matter from Right Internal Carotid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CK0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728539, + "CONCEPT_NAME" : "Extirpation of Matter from Right Internal Carotid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CK4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728558, + "CONCEPT_NAME" : "Extirpation of Matter from Right Temporal Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CS0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728559, + "CONCEPT_NAME" : "Extirpation of Matter from Right Temporal Artery, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CS3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728560, + "CONCEPT_NAME" : "Extirpation of Matter from Right Temporal Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CS4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728564, + "CONCEPT_NAME" : "Extirpation of Matter from Right Thyroid Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CU0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728565, + "CONCEPT_NAME" : "Extirpation of Matter from Right Thyroid Artery, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CU3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728566, + "CONCEPT_NAME" : "Extirpation of Matter from Right Thyroid Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CU4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728549, + "CONCEPT_NAME" : "Extirpation of Matter from Right Vertebral Artery, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CP0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2728551, + "CONCEPT_NAME" : "Extirpation of Matter from Right Vertebral Artery, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "03CP4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000061, + "CONCEPT_NAME" : "Percutaneous insertion of carotid artery stent(s)", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "00.63", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1097.json b/tests/cohorts/1097.json new file mode 100644 index 00000000..789008ec --- /dev/null +++ b/tests/cohorts/1097.json @@ -0,0 +1,1911 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 88, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 88 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 88, + "name" : "Esophagectomy (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2002489, + "CONCEPT_NAME" : "Antesternal esophageal anastomosis with interposition of colon", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.65", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002487, + "CONCEPT_NAME" : "Antesternal esophageal anastomosis with interposition of small bowel", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.63", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002485, + "CONCEPT_NAME" : "Antesternal esophagoesophagostomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.61", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002486, + "CONCEPT_NAME" : "Antesternal esophagogastrostomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.62", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748708, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15074", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748729, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15474", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748718, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748739, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154K4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748713, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748728, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Synthetic Substitute, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D153J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748734, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154J4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748723, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748744, + "CONCEPT_NAME" : "Bypass Esophagus to Cutaneous, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154Z4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748710, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15079", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748731, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15479", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748948, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Autologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15879", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748720, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748741, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748958, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Nonautologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158K9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748715, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748736, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748953, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum with Synthetic Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158J9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748725, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748943, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748963, + "CONCEPT_NAME" : "Bypass Esophagus to Duodenum, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158Z9", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748712, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D1507B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748733, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D1547B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748950, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Autologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D1587B", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748722, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748743, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748960, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Nonautologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158KB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748717, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748738, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748955, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum with Synthetic Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158JB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748727, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748945, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748965, + "CONCEPT_NAME" : "Bypass Esophagus to Ileum, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158ZB", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748711, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D1507A", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748732, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D1547A", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748949, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Autologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D1587A", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748721, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150KA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748742, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154KA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748959, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Nonautologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158KA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748716, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150JA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748737, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154JA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748954, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum with Synthetic Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158JA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748726, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150ZA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748944, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154ZA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748964, + "CONCEPT_NAME" : "Bypass Esophagus to Jejunum, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158ZA", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748709, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Autologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15076", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748730, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Autologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15476", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748947, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Autologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D15876", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748719, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Nonautologous Tissue Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748740, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Nonautologous Tissue Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748957, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Nonautologous Tissue Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158K6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748714, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Synthetic Substitute, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748735, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Synthetic Substitute, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748952, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach with Synthetic Substitute, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158J6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748724, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D150Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748942, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D154Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2748962, + "CONCEPT_NAME" : "Bypass Esophagus to Stomach, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0D158Z6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002462, + "CONCEPT_NAME" : "Esophagectomy, not otherwise specified", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.40", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746751, + "CONCEPT_NAME" : "Excision of Esophagus, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB50ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746753, + "CONCEPT_NAME" : "Excision of Esophagus, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB53ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746757, + "CONCEPT_NAME" : "Excision of Esophagus, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB57ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746786, + "CONCEPT_NAME" : "Excision of Small Intestine, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB80ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746788, + "CONCEPT_NAME" : "Excision of Small Intestine, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB83ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746790, + "CONCEPT_NAME" : "Excision of Small Intestine, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB84ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746792, + "CONCEPT_NAME" : "Excision of Small Intestine, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB87ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2746794, + "CONCEPT_NAME" : "Excision of Small Intestine, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DB88ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002470, + "CONCEPT_NAME" : "Intrathoracic esophageal anastomosis with interposition of colon", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.55", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002468, + "CONCEPT_NAME" : "Intrathoracic esophageal anastomosis with interposition of small bowel", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.53", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002482, + "CONCEPT_NAME" : "Intrathoracic esophageal anastomosis with other interposition", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.58", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002466, + "CONCEPT_NAME" : "Intrathoracic esophagoesophagostomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.51", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002467, + "CONCEPT_NAME" : "Intrathoracic esophagogastrostomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.52", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002502, + "CONCEPT_NAME" : "Other antesternal anastomosis of esophagus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.69", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002491, + "CONCEPT_NAME" : "Other antesternal esophageal anastomosis with interposition", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.68", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002490, + "CONCEPT_NAME" : "Other antesternal esophagocolostomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.66", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002488, + "CONCEPT_NAME" : "Other antesternal esophagoenterostomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.64", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002483, + "CONCEPT_NAME" : "Other intrathoracic anastomosis of esophagus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.59", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002471, + "CONCEPT_NAME" : "Other intrathoracic esophagocolostomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.56", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002469, + "CONCEPT_NAME" : "Other intrathoracic esophagoenterostomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.54", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002463, + "CONCEPT_NAME" : "Partial esophagectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.41", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753144, + "CONCEPT_NAME" : "Resection of Esophagus, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DT50ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753145, + "CONCEPT_NAME" : "Resection of Esophagus, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DT54ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753146, + "CONCEPT_NAME" : "Resection of Esophagus, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DT57ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753147, + "CONCEPT_NAME" : "Resection of Esophagus, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DT58ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002464, + "CONCEPT_NAME" : "Total esophagectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "42.42", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2752710, + "CONCEPT_NAME" : "Transfer Large Intestine to Esophagus, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DXE0Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2752711, + "CONCEPT_NAME" : "Transfer Large Intestine to Esophagus, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DXE4Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2752708, + "CONCEPT_NAME" : "Transfer Small Intestine to Esophagus, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DX80Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2752709, + "CONCEPT_NAME" : "Transfer Small Intestine to Esophagus, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DX84Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2752706, + "CONCEPT_NAME" : "Transfer Stomach to Esophagus, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DX60Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2752707, + "CONCEPT_NAME" : "Transfer Stomach to Esophagus, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DX64Z5", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1098.json b/tests/cohorts/1098.json new file mode 100644 index 00000000..7c101a08 --- /dev/null +++ b/tests/cohorts/1098.json @@ -0,0 +1,517 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 84, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 84 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 84, + "name" : "Pancreatectomy (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2003348, + "CONCEPT_NAME" : "Distal pancreatectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52.52", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2750943, + "CONCEPT_NAME" : "Excision of Pancreas, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0FBG0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2750945, + "CONCEPT_NAME" : "Excision of Pancreas, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0FBG3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2750947, + "CONCEPT_NAME" : "Excision of Pancreas, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0FBG4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43017182, + "CONCEPT_NAME" : "Excision of Pancreas, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0FBG8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003350, + "CONCEPT_NAME" : "Other partial pancreatectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52.59", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003347, + "CONCEPT_NAME" : "Proximal pancreatectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52.51", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003362, + "CONCEPT_NAME" : "Radical pancreaticoduodenectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52.7", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "3-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003349, + "CONCEPT_NAME" : "Radical subtotal pancreatectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52.53", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753534, + "CONCEPT_NAME" : "Resection of Pancreas, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0FTG0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753535, + "CONCEPT_NAME" : "Resection of Pancreas, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0FTG4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003351, + "CONCEPT_NAME" : "Total pancreatectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "52.6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "3-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1099.json b/tests/cohorts/1099.json new file mode 100644 index 00000000..43dfb3d2 --- /dev/null +++ b/tests/cohorts/1099.json @@ -0,0 +1,1248 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 83, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 83 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 83, + "name" : "Colectomy (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 43016394, + "CONCEPT_NAME" : "Excision of Descending Colon, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBMFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2747030, + "CONCEPT_NAME" : "Excision of Large Intestine, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBE0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2747032, + "CONCEPT_NAME" : "Excision of Large Intestine, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBE3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2747034, + "CONCEPT_NAME" : "Excision of Large Intestine, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBE4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2747036, + "CONCEPT_NAME" : "Excision of Large Intestine, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBE7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2747038, + "CONCEPT_NAME" : "Excision of Large Intestine, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBE8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43016392, + "CONCEPT_NAME" : "Excision of Left Large Intestine, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBGFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43016398, + "CONCEPT_NAME" : "Excision of Sigmoid Colon, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBNFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43016393, + "CONCEPT_NAME" : "Excision of Transverse Colon, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DBLFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000811, + "CONCEPT_NAME" : "Laparoscopic cecectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.32", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000834, + "CONCEPT_NAME" : "Laparoscopic left hemicolectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.35", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000810, + "CONCEPT_NAME" : "Laparoscopic multiple segmental resection of large intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.31", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000833, + "CONCEPT_NAME" : "Laparoscopic resection of transverse colon", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.34", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000832, + "CONCEPT_NAME" : "Laparoscopic right hemicolectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.33", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000835, + "CONCEPT_NAME" : "Laparoscopic sigmoidectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.36", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002768, + "CONCEPT_NAME" : "Laparoscopic total intra-abdominal colectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.81", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002751, + "CONCEPT_NAME" : "Open and other cecectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.72", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002764, + "CONCEPT_NAME" : "Open and other left hemicolectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.75", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002750, + "CONCEPT_NAME" : "Open and other multiple segmental resection of large intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.71", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002763, + "CONCEPT_NAME" : "Open and other resection of transverse colon", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.74", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002762, + "CONCEPT_NAME" : "Open and other right hemicolectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.73", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002765, + "CONCEPT_NAME" : "Open and other sigmoidectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.76", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002769, + "CONCEPT_NAME" : "Open total intra-abdominal colectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.82", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002766, + "CONCEPT_NAME" : "Other and unspecified partial excision of large intestine", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.79", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2002770, + "CONCEPT_NAME" : "Other and unspecified total intra-abdominal colectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "45.83", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2000836, + "CONCEPT_NAME" : "Other laparoscopic partial excision of large intestine", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "17.39", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753386, + "CONCEPT_NAME" : "Resection of Ascending Colon, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTK0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753378, + "CONCEPT_NAME" : "Resection of Cecum, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTH0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753379, + "CONCEPT_NAME" : "Resection of Cecum, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTH4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753380, + "CONCEPT_NAME" : "Resection of Cecum, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTH7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753381, + "CONCEPT_NAME" : "Resection of Cecum, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTH8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43017217, + "CONCEPT_NAME" : "Resection of Descending Colon, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTMFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753176, + "CONCEPT_NAME" : "Resection of Large Intestine, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTE0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753177, + "CONCEPT_NAME" : "Resection of Large Intestine, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTE4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753368, + "CONCEPT_NAME" : "Resection of Large Intestine, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTE7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753369, + "CONCEPT_NAME" : "Resection of Large Intestine, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTE8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753374, + "CONCEPT_NAME" : "Resection of Left Large Intestine, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTG0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753375, + "CONCEPT_NAME" : "Resection of Left Large Intestine, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTG4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753376, + "CONCEPT_NAME" : "Resection of Left Large Intestine, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTG7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753377, + "CONCEPT_NAME" : "Resection of Left Large Intestine, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTG8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43017215, + "CONCEPT_NAME" : "Resection of Left Large Intestine, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTGFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753370, + "CONCEPT_NAME" : "Resection of Right Large Intestine, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTF0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753371, + "CONCEPT_NAME" : "Resection of Right Large Intestine, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTF4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753372, + "CONCEPT_NAME" : "Resection of Right Large Intestine, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTF7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753373, + "CONCEPT_NAME" : "Resection of Right Large Intestine, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTF8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753398, + "CONCEPT_NAME" : "Resection of Sigmoid Colon, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTN0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753399, + "CONCEPT_NAME" : "Resection of Sigmoid Colon, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTN4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753400, + "CONCEPT_NAME" : "Resection of Sigmoid Colon, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTN7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753401, + "CONCEPT_NAME" : "Resection of Sigmoid Colon, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTN8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43017218, + "CONCEPT_NAME" : "Resection of Sigmoid Colon, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTNFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753390, + "CONCEPT_NAME" : "Resection of Transverse Colon, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTL0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753391, + "CONCEPT_NAME" : "Resection of Transverse Colon, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTL4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753392, + "CONCEPT_NAME" : "Resection of Transverse Colon, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTL7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2753393, + "CONCEPT_NAME" : "Resection of Transverse Colon, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTL8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 43017216, + "CONCEPT_NAME" : "Resection of Transverse Colon, Via Natural or Artificial Opening With Percutaneous Endoscopic Assistance", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0DTLFZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/11.json b/tests/cohorts/11.json new file mode 100644 index 00000000..f52f7649 --- /dev/null +++ b/tests/cohorts/11.json @@ -0,0 +1,304 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ConditionOccurrence" : { + "CodesetId" : 3, + "ConditionTypeExclude" : false + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "All" + } + }, + "ConceptSets" : [ + { + "id" : 3, + "name" : "Malaise or Fatigue or (Malaise and Fatigue)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 4223659, + "CONCEPT_NAME" : "Fatigue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "84229001", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4272240, + "CONCEPT_NAME" : "Malaise", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "367391008", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4158491, + "CONCEPT_NAME" : "C/O - debility - malaise", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "272036004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37396808, + "CONCEPT_NAME" : "Cancer-related fatigue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "716749005", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4219363, + "CONCEPT_NAME" : "Congenital debility of fetus", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "82022002", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4221911, + "CONCEPT_NAME" : "Fatigue associated with AIDS", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420900006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37205051, + "CONCEPT_NAME" : "Fatigue due to chemotherapy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "784317004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 37205052, + "CONCEPT_NAME" : "Fatigue due to radiation therapy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "784318009", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 45772721, + "CONCEPT_NAME" : "Fatigue due to treatment", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "704369007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4225027, + "CONCEPT_NAME" : "Malaise associated with AIDS", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "420801006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 40484614, + "CONCEPT_NAME" : "Postexertional fatigue", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "444042007", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4092860, + "CONCEPT_NAME" : "Rapid fatigue of gait", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "250002000", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4090207, + "CONCEPT_NAME" : "Senile asthenia", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "18726006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 44782753, + "CONCEPT_NAME" : "Weakness as a late effect of stroke", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "148871000119109", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : true, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 4309912, + "CONCEPT_NAME" : "Generally unwell", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "213257006", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "All" + }, + "InclusionRules" : [], + "EndStrategy" : { + "DateOffset" : { + "DateField" : "EndDate", + "Offset" : 14 + } + }, + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1100.json b/tests/cohorts/1100.json new file mode 100644 index 00000000..947ba8dc --- /dev/null +++ b/tests/cohorts/1100.json @@ -0,0 +1,653 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 85, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 85 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 85, + "name" : "Cystectomy (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2773930, + "CONCEPT_NAME" : "Excision of Bladder, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TBB0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773932, + "CONCEPT_NAME" : "Excision of Bladder, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TBB3ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773934, + "CONCEPT_NAME" : "Excision of Bladder, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TBB4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003806, + "CONCEPT_NAME" : "Other total cystectomy", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57.79", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003803, + "CONCEPT_NAME" : "Partial cystectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57.6", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "3-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003805, + "CONCEPT_NAME" : "Radical cystectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "57.71", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2780485, + "CONCEPT_NAME" : "Resection of Bilateral Seminal Vesicles, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0VT30ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2780486, + "CONCEPT_NAME" : "Resection of Bilateral Seminal Vesicles, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0VT34ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776775, + "CONCEPT_NAME" : "Resection of Bladder, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTB0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776776, + "CONCEPT_NAME" : "Resection of Bladder, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTB4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776777, + "CONCEPT_NAME" : "Resection of Bladder, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTB7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776778, + "CONCEPT_NAME" : "Resection of Bladder, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTB8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2780477, + "CONCEPT_NAME" : "Resection of Prostate, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0VT00ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2780478, + "CONCEPT_NAME" : "Resection of Prostate, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0VT04ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2780479, + "CONCEPT_NAME" : "Resection of Prostate, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0VT07ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2780480, + "CONCEPT_NAME" : "Resection of Prostate, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0VT08ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776783, + "CONCEPT_NAME" : "Resection of Urethra, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTD0ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776972, + "CONCEPT_NAME" : "Resection of Urethra, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTD4ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776973, + "CONCEPT_NAME" : "Resection of Urethra, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTD7ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776974, + "CONCEPT_NAME" : "Resection of Urethra, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TTD8ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/1101.json b/tests/cohorts/1101.json new file mode 100644 index 00000000..8e3a4332 --- /dev/null +++ b/tests/cohorts/1101.json @@ -0,0 +1,942 @@ +{ + "cdmVersionRange" : ">=5.0.0", + "PrimaryCriteria" : { + "CriteriaList" : [ + { + "ProcedureOccurrence" : { + "CodesetId" : 84, + "ProcedureTypeExclude" : false + } + }, + { + "ProcedureOccurrence" : { + "ProcedureTypeExclude" : false, + "ProcedureSourceConcept" : 84 + } + } + ], + "ObservationWindow" : { + "PriorDays" : 0, + "PostDays" : 0 + }, + "PrimaryCriteriaLimit" : { + "Type" : "First" + } + }, + "ConceptSets" : [ + { + "id" : 0, + "name" : "Inpatient visit", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 9201, + "CONCEPT_NAME" : "Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "IP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 43, + "name" : "Emergency or ER / Inpatient", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 262, + "CONCEPT_NAME" : "Emergency Room and Inpatient Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ERIP", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 9203, + "CONCEPT_NAME" : "Emergency Room Visit", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "ER", + "DOMAIN_ID" : "Visit", + "VOCABULARY_ID" : "Visit", + "CONCEPT_CLASS_ID" : "Visit" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 81, + "name" : "Atrial Fibrillation (any)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 313217, + "CONCEPT_NAME" : "Atrial fibrillation", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "49436004", + "DOMAIN_ID" : "Condition", + "VOCABULARY_ID" : "SNOMED", + "CONCEPT_CLASS_ID" : "Clinical Finding" + }, + "isExcluded" : false, + "includeDescendants" : true, + "includeMapped" : false + } + ] + } + }, + { + "id" : 84, + "name" : "Nephrectomy (Bucher et al)", + "expression" : { + "items" : [ + { + "concept" : { + "CONCEPT_ID" : 2003623, + "CONCEPT_NAME" : "Bilateral nephrectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55.54", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773711, + "CONCEPT_NAME" : "Excision of Left Kidney Pelvis, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB40ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773713, + "CONCEPT_NAME" : "Excision of Left Kidney Pelvis, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB43ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773715, + "CONCEPT_NAME" : "Excision of Left Kidney Pelvis, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB44ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773717, + "CONCEPT_NAME" : "Excision of Left Kidney Pelvis, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB47ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773719, + "CONCEPT_NAME" : "Excision of Left Kidney Pelvis, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB48ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773691, + "CONCEPT_NAME" : "Excision of Left Kidney, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB10ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773693, + "CONCEPT_NAME" : "Excision of Left Kidney, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB13ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773695, + "CONCEPT_NAME" : "Excision of Left Kidney, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB14ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773697, + "CONCEPT_NAME" : "Excision of Left Kidney, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB17ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773699, + "CONCEPT_NAME" : "Excision of Left Kidney, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB18ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773701, + "CONCEPT_NAME" : "Excision of Right Kidney Pelvis, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB30ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773703, + "CONCEPT_NAME" : "Excision of Right Kidney Pelvis, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB33ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773705, + "CONCEPT_NAME" : "Excision of Right Kidney Pelvis, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB34ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773707, + "CONCEPT_NAME" : "Excision of Right Kidney Pelvis, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB37ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773709, + "CONCEPT_NAME" : "Excision of Right Kidney Pelvis, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB38ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773681, + "CONCEPT_NAME" : "Excision of Right Kidney, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB00ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773683, + "CONCEPT_NAME" : "Excision of Right Kidney, Percutaneous Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB03ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773685, + "CONCEPT_NAME" : "Excision of Right Kidney, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB04ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773687, + "CONCEPT_NAME" : "Excision of Right Kidney, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB07ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2773689, + "CONCEPT_NAME" : "Excision of Right Kidney, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TB08ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003611, + "CONCEPT_NAME" : "Nephrectomy of remaining kidney", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55.52", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003610, + "CONCEPT_NAME" : "Nephroureterectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55.51", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003608, + "CONCEPT_NAME" : "Partial nephrectomy", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55.4", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "3-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2003622, + "CONCEPT_NAME" : "Removal of transplanted or rejected kidney", + "STANDARD_CONCEPT" : "N", + "STANDARD_CONCEPT_CAPTION" : "Non-Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "55.53", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD9Proc", + "CONCEPT_CLASS_ID" : "4-dig billing code" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776763, + "CONCEPT_NAME" : "Resection of Left Kidney Pelvis, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT40ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776764, + "CONCEPT_NAME" : "Resection of Left Kidney Pelvis, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT44ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776765, + "CONCEPT_NAME" : "Resection of Left Kidney Pelvis, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT47ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776766, + "CONCEPT_NAME" : "Resection of Left Kidney Pelvis, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT48ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776755, + "CONCEPT_NAME" : "Resection of Left Kidney, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT10ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776756, + "CONCEPT_NAME" : "Resection of Left Kidney, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT14ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776759, + "CONCEPT_NAME" : "Resection of Right Kidney Pelvis, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT30ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776760, + "CONCEPT_NAME" : "Resection of Right Kidney Pelvis, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT34ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776761, + "CONCEPT_NAME" : "Resection of Right Kidney Pelvis, Via Natural or Artificial Opening", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT37ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776762, + "CONCEPT_NAME" : "Resection of Right Kidney Pelvis, Via Natural or Artificial Opening Endoscopic", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT38ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776753, + "CONCEPT_NAME" : "Resection of Right Kidney, Open Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT00ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + }, + { + "concept" : { + "CONCEPT_ID" : 2776754, + "CONCEPT_NAME" : "Resection of Right Kidney, Percutaneous Endoscopic Approach", + "STANDARD_CONCEPT" : "S", + "STANDARD_CONCEPT_CAPTION" : "Standard", + "INVALID_REASON" : "V", + "INVALID_REASON_CAPTION" : "Valid", + "CONCEPT_CODE" : "0TT04ZZ", + "DOMAIN_ID" : "Procedure", + "VOCABULARY_ID" : "ICD10PCS", + "CONCEPT_CLASS_ID" : "ICD10PCS" + }, + "isExcluded" : false, + "includeDescendants" : false, + "includeMapped" : false + } + ] + } + } + ], + "QualifiedLimit" : { + "Type" : "First" + }, + "ExpressionLimit" : { + "Type" : "First" + }, + "InclusionRules" : [ + { + "name" : "Age above 18 years", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [], + "DemographicCriteriaList" : [ + { + "Age" : { + "Value" : 18, + "Op" : "gte" + } + } + ], + "Groups" : [] + } + }, + { + "name" : "Inpatient visit on day of surgery without ER visit immediately on or prior", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CorrelatedCriteria" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "VisitOccurrence" : { + "CodesetId" : 43, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 2, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + }, + "CodesetId" : 0, + "VisitTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : -1 + }, + "End" : { + "Days" : 0, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "EndWindow" : { + "Start" : { + "Days" : 1, + "Coeff" : 1 + }, + "End" : { + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : true + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "Atrial fibrillation (any) within 14d of surgery", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Days" : 0, + "Coeff" : 1 + }, + "End" : { + "Days" : 14, + "Coeff" : 1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 2, + "Count" : 1, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + }, + { + "name" : "No prior atrial fibrillation ", + "expression" : { + "Type" : "ALL", + "CriteriaList" : [ + { + "Criteria" : { + "ConditionOccurrence" : { + "CodesetId" : 81, + "ConditionTypeExclude" : false + } + }, + "StartWindow" : { + "Start" : { + "Coeff" : -1 + }, + "End" : { + "Days" : 1, + "Coeff" : -1 + }, + "UseIndexEnd" : false, + "UseEventEnd" : false + }, + "RestrictVisit" : false, + "IgnoreObservationPeriod" : false, + "Occurrence" : { + "Type" : 0, + "Count" : 0, + "IsDistinct" : false + } + } + ], + "DemographicCriteriaList" : [], + "Groups" : [] + } + } + ], + "CensoringCriteria" : [], + "CollapseSettings" : { + "CollapseType" : "ERA", + "EraPad" : 0 + }, + "CensorWindow" : {} +} \ No newline at end of file diff --git a/tests/cohorts/reference_outputs/10.md b/tests/cohorts/reference_outputs/10.md new file mode 100644 index 00000000..c096af26 --- /dev/null +++ b/tests/cohorts/reference_outputs/10.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Nausea or Vomiting'. + +2. observations of 'Nausea or Vomiting'. + +### Cohort Exit + +The cohort end date will be offset from index event's end date plus 14 days. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/10.sql b/tests/cohorts/reference_outputs/10.sql new file mode 100644 index 00000000..792d5414 --- /dev/null +++ b/tests/cohorts/reference_outputs/10.sql @@ -0,0 +1,307 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (31967,4158495,4101344,4012500,201218)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (31967,4158495,4101344,4012500,201218)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Observation Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,14,end_date) > op_end_date then op_end_date else DATEADD(day,14,end_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/100.md b/tests/cohorts/reference_outputs/100.md new file mode 100644 index 00000000..5a7f84c8 --- /dev/null +++ b/tests/cohorts/reference_outputs/100.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Alzheimer's disease'. + +### Cohort Exit + +The cohort end date will be offset from index event's end date plus 0 days. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 1 days of each other. + + diff --git a/tests/cohorts/reference_outputs/100.sql b/tests/cohorts/reference_outputs/100.sql new file mode 100644 index 00000000..4a5a01db --- /dev/null +++ b/tests/cohorts/reference_outputs/100.sql @@ -0,0 +1,293 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (378419)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (378419)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,0,end_date) > op_end_date then op_end_date else DATEADD(day,0,end_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 1, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,1,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1000.md b/tests/cohorts/reference_outputs/1000.md new file mode 100644 index 00000000..dbe582c8 --- /dev/null +++ b/tests/cohorts/reference_outputs/1000.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of '[LEGEND HTN] Nausea'. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 30 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1000.sql b/tests/cohorts/reference_outputs/1000.sql new file mode 100644 index 00000000..b8556843 --- /dev/null +++ b/tests/cohorts/reference_outputs/1000.sql @@ -0,0 +1,304 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (31967)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (31967)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (30284)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (30284)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 30, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,30,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1001.md b/tests/cohorts/reference_outputs/1001.md new file mode 100644 index 00000000..3d5104f0 --- /dev/null +++ b/tests/cohorts/reference_outputs/1001.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Edema'. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 180 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1001.sql b/tests/cohorts/reference_outputs/1001.sql new file mode 100644 index 00000000..4201c3e8 --- /dev/null +++ b/tests/cohorts/reference_outputs/1001.sql @@ -0,0 +1,293 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (433595,133299)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (433595,133299)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 180, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,180,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1002.md b/tests/cohorts/reference_outputs/1002.md new file mode 100644 index 00000000..9280919c --- /dev/null +++ b/tests/cohorts/reference_outputs/1002.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Photosensitivity'. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 90 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1002.sql b/tests/cohorts/reference_outputs/1002.sql new file mode 100644 index 00000000..06e3999e --- /dev/null +++ b/tests/cohorts/reference_outputs/1002.sql @@ -0,0 +1,299 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4234104)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4234104)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4300445,4263325,4031007,442179,37312586,138825,4304266,4064057,141374,4031006,439096,4070156,4290728,4241471,36674412,4293437,4066470,4119822,4033832,37116482,37116483,4290729,4239682,4242265,36715275,4230340,4300796,141650,4301164,4299673,4234867,36715367,4308081,42709861,4112749,4300444,4031005,4116197,4299672,4080922,4293560,4293562,4300794,4300795,4293563,4293561,37110331,4006157,37110590,4292224,4293593,4290732,42537710,4318376,42537712,42537711,4290730,4298594,4298593,4270722,42539382,42709860,4080921,4176424,4223992,4204365,4195589,4278846,4297664,4296207,4066838,4031625,4185267,4031162,4217502,4296189,4033831,4031004,4296206)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 90, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,90,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1003.md b/tests/cohorts/reference_outputs/1003.md new file mode 100644 index 00000000..53979193 --- /dev/null +++ b/tests/cohorts/reference_outputs/1003.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. condition occurrence of 'Primary malignant neoplasm of kidney' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1003.sql b/tests/cohorts/reference_outputs/1003.sql new file mode 100644 index 00000000..b1206032 --- /dev/null +++ b/tests/cohorts/reference_outputs/1003.sql @@ -0,0 +1,284 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (198985,4215373)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (198985)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1004.md b/tests/cohorts/reference_outputs/1004.md new file mode 100644 index 00000000..bc91d20f --- /dev/null +++ b/tests/cohorts/reference_outputs/1004.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Neoplasm of thyroid gland' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1004.sql b/tests/cohorts/reference_outputs/1004.sql new file mode 100644 index 00000000..50c3aca3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1004.sql @@ -0,0 +1,284 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4131909)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4131909)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1005.md b/tests/cohorts/reference_outputs/1005.md new file mode 100644 index 00000000..49a861cf --- /dev/null +++ b/tests/cohorts/reference_outputs/1005.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of '[LEGEND HTN] Venous thromboembolism (pulmonary embolism and deep vein thrombosis)'. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 180 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1005.sql b/tests/cohorts/reference_outputs/1005.sql new file mode 100644 index 00000000..817f70ad --- /dev/null +++ b/tests/cohorts/reference_outputs/1005.sql @@ -0,0 +1,304 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440417,254662,444247,44834756)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440417,254662,444247)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 180, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,180,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1006.md b/tests/cohorts/reference_outputs/1006.md new file mode 100644 index 00000000..4a86fdf9 --- /dev/null +++ b/tests/cohorts/reference_outputs/1006.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of '[LEGEND HTN] Vomiting'. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 30 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1006.sql b/tests/cohorts/reference_outputs/1006.sql new file mode 100644 index 00000000..f0c4e9a3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1006.sql @@ -0,0 +1,304 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (441408)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (441408)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40480290,4216862,440785)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40480290,4216862,440785)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 30, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,30,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1007.md b/tests/cohorts/reference_outputs/1007.md new file mode 100644 index 00000000..0d54fd8a --- /dev/null +++ b/tests/cohorts/reference_outputs/1007.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Epilepsy Seizures excl Alcohol withdrawal-induced convulsion'. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1007.sql b/tests/cohorts/reference_outputs/1007.sql new file mode 100644 index 00000000..22f04c97 --- /dev/null +++ b/tests/cohorts/reference_outputs/1007.sql @@ -0,0 +1,295 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4197485,4029498)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4197485,4029498)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (435875,380533,443700,4202330,37109948,4176652,4044227)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (435875,380533,443700,4202330,37109948)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1009.md b/tests/cohorts/reference_outputs/1009.md new file mode 100644 index 00000000..b43c7b8f --- /dev/null +++ b/tests/cohorts/reference_outputs/1009.md @@ -0,0 +1,41 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. drug eras of 'Atypical Antipsychotics'; having at least 1 drug era of 'First-line anti-Depressants therapy', starting anytime on or before 'Atypical Antipsychotics' start date and ending 365 days before 'Atypical Antipsychotics' start date. + +2. drug eras of 'First-line anti-Depressants therapy'; with all of the following criteria: + + 1. having at least 3 distinct standard concepts from drug eras of 'First-line anti-Depressants therapy', starting anytime on or before 'First-line anti-Depressants therapy' start date and ending 365 days before 'First-line anti-Depressants therapy' start date. + 2. having at least 2 distinct standard concepts from drug eras of 'First-line anti-Depressants therapy', starting anytime prior to 'First-line anti-Depressants therapy' start date and ending 365 days before 'First-line anti-Depressants therapy' start date. + + +3. drug eras of 'esketamine'; having at least 2 distinct standard concepts from dose eras of 'First-line anti-Depressants therapy', starting anytime prior to 'esketamine' start date and ending 365 days before 'esketamine' start date. + +Restrict entry events to having at least 1 condition occurrence of 'Depressive disorder prevalent', starting between 365 days before and 0 days before cohort entry start date. + +Limit these restricted entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. No prior mania + +Entry events having no condition occurrences of 'CB_376 Mania', starting anytime on or before cohort entry start date. + +#### 2. No prior dementia + +Entry events having no condition occurrences of 'Dementia (validated: Taylor, 2009)', starting anytime on or before cohort entry start date. + +#### 3. No prior psychosis + +Entry events having no condition occurrences of 'CB_376 Psychosis', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1009.sql b/tests/cohorts/reference_outputs/1009.sql new file mode 100644 index 00000000..35270c19 --- /dev/null +++ b/tests/cohorts/reference_outputs/1009.sql @@ -0,0 +1,1519 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436665,4333677,437249)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436665,4333677,437249)) + +) I +) C UNION ALL +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (432590,436073,435783)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (432590,436073,435783)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (434900,375229,4333667,441540,380986)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (434900)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (757688,800878,785788,703244,766814,735979,712615)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (757688,800878,785788,703244,766814,735979,712615)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (755695)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (755695)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 15 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (372608,375239,4182210,4043378,436092,373179,435088)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4182210)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (378726,376095,377788,372610)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (376095,377788,372610)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 16 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36878783,19032424,710062,713109,750982,19039883,797617,798834,716968,717607,19023846,19037989,738156,715259,715939,755695,751412,778268,19122204,781705,19091830,794147,19110751,19007737,19080226,725131,714684,19127550,721724,19129635,36427294,722031,733896,754270,19098514,19084693,766209,739138,1398039,19041910,703470,703547,705755,19006186,743670,40234834,19008261,44507700)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36878783,19032424,710062,713109,750982,19039883,797617,798834,716968,717607,19023846,19037989,738156,715259,715939,755695,751412,778268,19122204,781705,19091830,794147,19110751,19007737,19080226,725131,714684,19127550,721724,19129635,36427294,722031,733896,754270,19098514,19084693,766209,739138,1398039,19041910,703470,703547,705755,19006186,743670,40234834,19008261,44507700)) + +) I +) C UNION ALL +SELECT 18 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440383)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440383)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (438727,436665,40481798,435520,4224940)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (438727,436665,40481798,435520,4224940)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 19 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1366610)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1366610)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 3 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 2 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Dose Era Criteria +select C.person_id, C.dose_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.dose_era_id,de.drug_concept_id, de.unit_concept_id, de.dose_value,de.dose_era_start_date as start_date, de.dose_era_end_date as end_date + FROM @cdm_database_schema.DOSE_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Dose Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 2 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 3 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 2 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Dose Era Criteria +select C.person_id, C.dose_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.dose_era_id,de.drug_concept_id, de.unit_concept_id, de.dose_value,de.dose_era_start_date as start_date, de.dose_era_end_date as end_date + FROM @cdm_database_schema.DOSE_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Dose Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 2 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 11) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 3 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Drug Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 2 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id , A.domain_concept_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Era Criteria +select C.person_id, C.drug_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_era_id,de.drug_concept_id,de.drug_exposure_count,de.gap_days,de.drug_era_start_date as start_date, de.drug_era_end_date as end_date + FROM @cdm_database_schema.DRUG_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 19) +) C + + +-- End Drug Era Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Dose Era Criteria +select C.person_id, C.dose_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id,C.start_date as sort_date, C.drug_concept_id as domain_concept_id +from +( + select de.person_id,de.dose_era_id,de.drug_concept_id, de.unit_concept_id, de.dose_value,de.dose_era_start_date as start_date, de.dose_era_end_date as end_date + FROM @cdm_database_schema.DOSE_ERA de +where de.drug_concept_id in (SELECT concept_id from #Codesets where codeset_id = 16) +) C + + +-- End Dose Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) AND A.END_DATE >= DATEADD(day,-365,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(DISTINCT cc.domain_concept_id) >= 2 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 18) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE +WHERE QE.ordinal = 1 +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 15) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{3 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),3)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 3 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1010.md b/tests/cohorts/reference_outputs/1010.md new file mode 100644 index 00000000..70bda95d --- /dev/null +++ b/tests/cohorts/reference_outputs/1010.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Graft versus host disease included non standard' for the first time in the person's history. + +2. condition occurrence of any condition (including 'Graft versus host disease included non standard' source concepts) for the first time in the person's history. + +3. condition occurrence of any condition (including 'Unspecified graft vs host dx - non standard' source concepts) for the first time in the person's history; having at least 1 procedure occurrence of 'Hematopoietic Stem Cell Transplantation (HSCT) ', starting anytime up to 180 days before any condition start date. + +Limit qualifying entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1010.sql b/tests/cohorts/reference_outputs/1010.sql new file mode 100644 index 00000000..24ff58c7 --- /dev/null +++ b/tests/cohorts/reference_outputs/1010.sql @@ -0,0 +1,418 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4120445,2789432,2789464,2788927,2788960,2789179,2789211,2788671,2788704,2789460,2785921,2788955,2788988,2789207,2789428,2788699,2788732,2789462,2785923,2788957,2789177,2789209,2789430,2788701,2788734,2788926,2788959,2788483,2788703,2789433,2789465,2788928,2788961,2789180,2789212,2788672,2788705,2789461,2785922,2788956,2789176,2789208,2789429,2788700,2788733,2789463,2785924,2788958,2789178,2789210,2789431,2788702,2788925,42537745,4121274,4125659,45566479,45537646,45585326)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4120445,42537745,4121274,4125659)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2108458,43527933,2617352,2721123,2108456,2108457,46272967)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (2108458,43527933,2617352,2721123,2108456,2108457,46272967)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (434314,45595782)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (434314)) + +) I +) C UNION ALL +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (44828814,45537943)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (44828814,45537943)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cns on (co.condition_source_concept_id = cns.concept_id and cns.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cns on (co.condition_source_concept_id = cns.concept_id and cns.codeset_id = 3) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cns on (co.condition_source_concept_id = cns.concept_id and cns.codeset_id = 3) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cns on (co.condition_source_concept_id = cns.concept_id and cns.codeset_id = 3) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Procedure Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-180,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1011.md b/tests/cohorts/reference_outputs/1011.md new file mode 100644 index 00000000..aff10620 --- /dev/null +++ b/tests/cohorts/reference_outputs/1011.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Marginal zone lymphoma' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1011.sql b/tests/cohorts/reference_outputs/1011.sql new file mode 100644 index 00000000..bf2e90a0 --- /dev/null +++ b/tests/cohorts/reference_outputs/1011.sql @@ -0,0 +1,284 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40490918,35622279)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40490918,35622279)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1012.md b/tests/cohorts/reference_outputs/1012.md new file mode 100644 index 00000000..2f31e62a --- /dev/null +++ b/tests/cohorts/reference_outputs/1012.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Waldenstrom macroglobulinemia' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1012.sql b/tests/cohorts/reference_outputs/1012.sql new file mode 100644 index 00000000..13a44961 --- /dev/null +++ b/tests/cohorts/reference_outputs/1012.sql @@ -0,0 +1,284 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (435502,4141255,4029658,35622279)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (435502,4029658,35622279)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1013.md b/tests/cohorts/reference_outputs/1013.md new file mode 100644 index 00000000..48c157cd --- /dev/null +++ b/tests/cohorts/reference_outputs/1013.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Ankylosing Spondylitis' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1013.sql b/tests/cohorts/reference_outputs/1013.sql new file mode 100644 index 00000000..9e6caf77 --- /dev/null +++ b/tests/cohorts/reference_outputs/1013.sql @@ -0,0 +1,295 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (437082)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (437082)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4083681,4079735,37017494)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4083681,4079735)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1016.md b/tests/cohorts/reference_outputs/1016.md new file mode 100644 index 00000000..af76dbea --- /dev/null +++ b/tests/cohorts/reference_outputs/1016.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Polyarticular juvenile idiopathic arthritis' for the first time in the person's history, who are <= 16 years old; starting on or after January 1, 2016. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1016.sql b/tests/cohorts/reference_outputs/1016.sql new file mode 100644 index 00000000..f701e95e --- /dev/null +++ b/tests/cohorts/reference_outputs/1016.sql @@ -0,0 +1,286 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4195770,4132809,42535177,4132810,72714,4218311)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4195770,4132809,42535177,4132810,72714,4218311)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C +JOIN @cdm_database_schema.PERSON P on C.person_id = P.person_id +WHERE C.start_date >= DATEFROMPARTS(2016, 1, 1) +AND YEAR(C.start_date) - P.year_of_birth <= 16 +AND C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1017.md b/tests/cohorts/reference_outputs/1017.md new file mode 100644 index 00000000..0d5eb5ec --- /dev/null +++ b/tests/cohorts/reference_outputs/1017.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Neonatal Thrombocytopenia' for the first time in the person's history, who are < 1 years old. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1017.sql b/tests/cohorts/reference_outputs/1017.sql new file mode 100644 index 00000000..10d395cb --- /dev/null +++ b/tests/cohorts/reference_outputs/1017.sql @@ -0,0 +1,285 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (435076,4133984,4221109,4195579,4172999,4234257)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (435076,4133984)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C +JOIN @cdm_database_schema.PERSON P on C.person_id = P.person_id +WHERE YEAR(C.start_date) - P.year_of_birth < 1 +AND C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1018.md b/tests/cohorts/reference_outputs/1018.md new file mode 100644 index 00000000..fa47e7ab --- /dev/null +++ b/tests/cohorts/reference_outputs/1018.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Warm autoimmune hemolytic anemia' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1018.sql b/tests/cohorts/reference_outputs/1018.sql new file mode 100644 index 00000000..6efc6ead --- /dev/null +++ b/tests/cohorts/reference_outputs/1018.sql @@ -0,0 +1,295 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4219853)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4219853)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4160887,4146936,4098017,4131917,4098754,436956)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4160887,4146936,4098017,4131917,4098754,436956)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1019.md b/tests/cohorts/reference_outputs/1019.md new file mode 100644 index 00000000..965d49ca --- /dev/null +++ b/tests/cohorts/reference_outputs/1019.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'HDFN - Mother and child codes'; having at least 1 condition era of 'Pregnancy Codes', starting anytime on or before 'HDFN - Mother and child codes' start date and ending 14 days before 'HDFN - Mother and child codes' start date; containing = 0 occurrences. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 270 days. +The person exits the cohort when encountering any of the following events: +1. condition occurrences of 'Pregnancy End points'. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 90 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1019.sql b/tests/cohorts/reference_outputs/1019.sql new file mode 100644 index 00000000..e6ec4dc5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1019.sql @@ -0,0 +1,406 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (433603,199891,4028774)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (433603,199891,4028774)) + +) I +) C UNION ALL +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443213,437611,4067106,433260)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443213,437611,4067106,433260)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443213,437611,4067106,433260)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Era Criteria +select C.person_id, C.condition_era_id as event_id, C.start_date, C.end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date +from +( + select ce.person_id,ce.condition_era_id,ce.condition_concept_id,ce.condition_occurrence_count,ce.condition_era_start_date as start_date, ce.condition_era_end_date as end_date + FROM @cdm_database_schema.CONDITION_ERA ce +where ce.condition_concept_id in (SELECT concept_id from #Codesets where codeset_id = 1) +) C + +WHERE C.condition_occurrence_count = 0 +-- End Condition Era Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,-14,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,270,start_date) > op_end_date then op_end_date else DATEADD(day,270,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + +UNION ALL +-- Censor Events +select i.event_id, i.person_id, MIN(c.start_date) as end_date +FROM #included_events i +JOIN +( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) C on C.person_id = I.person_id and C.start_date >= I.start_date and C.START_DATE <= I.op_end_date +GROUP BY i.event_id, i.person_id + + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 90, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,90,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1020.md b/tests/cohorts/reference_outputs/1020.md new file mode 100644 index 00000000..c52a74a9 --- /dev/null +++ b/tests/cohorts/reference_outputs/1020.md @@ -0,0 +1,26 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrence of 'Major depressive disorder' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +Restrict entry events to with all of the following criteria: + + 1. having no condition occurrences of 'Bipolar disorder', starting anytime on or before cohort entry start date. + 2. having no condition occurrences of 'Schizoaffective disorder', starting anytime on or before cohort entry start date. + 3. having no condition occurrences of 'Schizophrenia not including Paraphenia', starting anytime on or before cohort entry start date. + 4. having no condition occurrences of 'Dementia', starting anytime on or before cohort entry start date. + 5. having no condition occurrences of 'Psychotic disorder', starting anytime on or before cohort entry start date. + + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1020.sql b/tests/cohorts/reference_outputs/1020.sql new file mode 100644 index 00000000..6342d055 --- /dev/null +++ b/tests/cohorts/reference_outputs/1020.sql @@ -0,0 +1,825 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440383,4175329,40546087,4191716,4212469)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440383,4175329,40546087,4191716,4212469)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436665)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436665)) + +) I +) C UNION ALL +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4286201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4286201)) + +) I +) C UNION ALL +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (433734,435235,433742,435783,440077)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (433734,435235,433742,435783,440077)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (434318)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (434318)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4182210,372608,4043378,373179,4104700,435088,4168666,380701,374009,4009705)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4182210,4043378,373179)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4152048,376095,37116464,36717598,377788,42535731,37311999,372610)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4152048,376095,37116464,36717598,377788,42535731,37311999,372610)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436073)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436073)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, p.person_id, p.event_id +from (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 3 as index_id, p.person_id, p.event_id +from (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 4 as index_id, p.person_id, p.event_id +from (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 5 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1021.md b/tests/cohorts/reference_outputs/1021.md new file mode 100644 index 00000000..17eefefd --- /dev/null +++ b/tests/cohorts/reference_outputs/1021.md @@ -0,0 +1,30 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) '; with any of the following criteria: + + 1. having at least 1 condition occurrence of 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ', starting between 1 days after and 365 days after 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ' start date. + 2. having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ' start date and ending between 0 days after and all days after 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ' start date. + 3. having at least 1 drug exposure of 'Pyridostigmine', starting between 0 days before and 60 days after 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ' start date. + + +2. drug exposures of 'Pyridostigmine'; having at least 1 condition occurrence of 'Myasthenia gravis (exclude congenital, juvenile, neonatal or genetic) ', starting between 0 days before and 60 days after 'Pyridostigmine' start date. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age >= 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1021.sql b/tests/cohorts/reference_outputs/1021.sql new file mode 100644 index 00000000..13cfcf2b --- /dev/null +++ b/tests/cohorts/reference_outputs/1021.sql @@ -0,0 +1,599 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (76685,4045732)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (76685,4045732)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4046355,4204694,4046356,4101899,81400,4046357)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4046355,4204694,4046356,4101899,81400,4046357)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (759740)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (759740)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,1,P.START_DATE) AND A.START_DATE <= DATEADD(day,365,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,60,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,60,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1022.md b/tests/cohorts/reference_outputs/1022.md new file mode 100644 index 00000000..f29ce94e --- /dev/null +++ b/tests/cohorts/reference_outputs/1022.md @@ -0,0 +1,19 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Major Depressive Disorder' for the first time in the person's history; having at least 1 condition occurrence of 'Sleep Disorders', starting between 365 days before and 0 days after 'Major Depressive Disorder' start date. + +2. condition occurrence of 'Sleep Disorders' for the first time in the person's history; having at least 1 condition occurrence of 'Major Depressive Disorder', starting between 365 days before and 0 days after 'Sleep Disorders' start date. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1022.sql b/tests/cohorts/reference_outputs/1022.sql new file mode 100644 index 00000000..c0502695 --- /dev/null +++ b/tests/cohorts/reference_outputs/1022.sql @@ -0,0 +1,488 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (44798390,4287868,4220636,4115402,4204989,40481897,4312903,4104980,4113205,44810442,4045772,4099949,435524,4132137,4175644)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (44798390,4287868,4220636,4115402,4204989,40481897,4312903,4104980,4113205,44810442,4045772,4099949,435524,4132137,4175644)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46269699,375794,4044240,4121694,35623409,36716323,43021812,43021860,43020464,43020467,37110489,4009650,4210451,437854,4086499,37018652,37110294,37110295,43531585,439794,37110296,37016175,4331287,319793,43530733,42535241,43530616,44784627,44784625,435792,444300,36714658,438134,37016174,434891,436669,4143701,4047912,439150,37110490,4180282,43531627,40483183,40482713,40481299,37016173,434172,37110297,4043564,436100,42536721,43531721,4137847,42872389,42872388,442588,4230779,40481372,40482247,43531594,440087,37016172,37110493,434904,43022069,4262584,4262580,443528,40482198,762958,762960,762959,4181303,4239812,37109055,313459,37119151,40483220,4139210,435238,43021811,37110298,443393,437260)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46269699,375794,4044240,4121694,35623409,36716323,43021812,43021860,43020464,43020467,37110489,4009650,4210451,437854,4086499,37018652,37110294,37110295,43531585,439794,37110296,37016175,4331287,319793,43530733,42535241,43530616,44784627,44784625,435792,444300,36714658,438134,37016174,434891,436669,4143701,4047912,439150,37110490,4180282,43531627,40483183,40482713,40481299,37016173,434172,37110297,4043564,436100,42536721,43531721,4137847,42872389,42872388,442588,4230779,40481372,40482247,43531594,440087,37016172,37110493,434904,43022069,4262584,4262580,443528,40482198,762958,762960,762959,4181303,4239812,37109055,313459,37119151,40483220,4139210,435238,43021811,37110298,443393,437260)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203,9201)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440383,4175329,40546087,4191716,4212469)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440383,4175329,40546087,4191716,4212469)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1023.md b/tests/cohorts/reference_outputs/1023.md new file mode 100644 index 00000000..07d2583a --- /dev/null +++ b/tests/cohorts/reference_outputs/1023.md @@ -0,0 +1,25 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Major Depressive Disorder' for the first time in the person's history; with any of the following criteria: + + 1. having at least 1 condition occurrence of 'Suicide and suicidal ideation, prevalent (informed by PHOEBE)', starting between 365 days before and 0 days after 'Major Depressive Disorder' start date. + 2. having at least 1 observation of 'Suicide and suicidal ideation, prevalent (informed by PHOEBE)', starting between 365 days before and 0 days after 'Major Depressive Disorder' start date. + + +2. condition occurrence of 'Suicide and suicidal ideation, prevalent (informed by PHOEBE)' for the first time in the person's history; having at least 1 condition occurrence of 'Major Depressive Disorder', starting between 365 days before and 0 days after 'Suicide and suicidal ideation, prevalent (informed by PHOEBE)' start date. + +3. observation of 'Suicide and suicidal ideation, prevalent (informed by PHOEBE)' for the first time in the person's history; having at least 1 condition occurrence of 'Major Depressive Disorder', starting between 365 days before and 0 days after 'Suicide and suicidal ideation, prevalent (informed by PHOEBE)' start date. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1023.sql b/tests/cohorts/reference_outputs/1023.sql new file mode 100644 index 00000000..c71ece28 --- /dev/null +++ b/tests/cohorts/reference_outputs/1023.sql @@ -0,0 +1,604 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (439235,4181216,444362,4273391,440925,4303690,4009713,4219484,435446,4058281,4021339,4216115,4092411,4152408)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (439235,4181216,444362,4273391,440925,4303690,4009713,4219484,435446,4058281,4021339,4216115,4092411,4152408)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203,9201)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440383,4175329,40546087,4191716,4212469)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440383,4175329,40546087,4191716,4212469)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Observation Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date , row_number() over (PARTITION BY o.person_id ORDER BY o.observation_date, o.observation_id) as ordinal + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Observation Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date , row_number() over (PARTITION BY o.person_id ORDER BY o.observation_date, o.observation_id) as ordinal + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Observation Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date , row_number() over (PARTITION BY o.person_id ORDER BY o.observation_date, o.observation_id) as ordinal + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Observation Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1024.md b/tests/cohorts/reference_outputs/1024.md new file mode 100644 index 00000000..d6d86c7d --- /dev/null +++ b/tests/cohorts/reference_outputs/1024.md @@ -0,0 +1,19 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Major Depressive Disorder' for the first time in the person's history; having at least 1 condition occurrence of 'Anhedonia', starting between 365 days before and 0 days after 'Major Depressive Disorder' start date. + +2. condition occurrence of 'Anhedonia' for the first time in the person's history; having at least 1 condition occurrence of 'Major Depressive Disorder', starting between 365 days before and 0 days after 'Anhedonia' start date. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1024.sql b/tests/cohorts/reference_outputs/1024.sql new file mode 100644 index 00000000..b17d26c4 --- /dev/null +++ b/tests/cohorts/reference_outputs/1024.sql @@ -0,0 +1,472 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4102935)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203,9201)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440383,4175329,40546087,4191716,4212469)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440383,4175329,40546087,4191716,4212469)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436665,442306,36684319,438727,40481798,443864,4239471,377527,435520,4224940,379784,433440)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1025.md b/tests/cohorts/reference_outputs/1025.md new file mode 100644 index 00000000..681094b3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1025.md @@ -0,0 +1,25 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'ADHD condition or procedure'. + +2. procedure occurrences of 'ADHD condition or procedure'. + +3. drug exposures of 'ADHD medications'; with any of the following criteria: + + 1. having at least 1 condition occurrence of 'ADHD condition or procedure', starting between 0 days before and 365 days after 'ADHD medications' start date. + 2. having at least 1 procedure occurrence of 'ADHD condition or procedure', starting between 0 days before and 365 days after 'ADHD medications' start date. + + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1025.sql b/tests/cohorts/reference_outputs/1025.sql new file mode 100644 index 00000000..26785dee --- /dev/null +++ b/tests/cohorts/reference_outputs/1025.sql @@ -0,0 +1,436 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (44813054,40480225,4262921,45765570,4047120,4085043)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (44813054,40480225,4262921,45765570,4047120,4085043)) + +) I +) C UNION ALL +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (714785,742185,719311,705944,709567,19090984,1398937,731533,19008261,1344965,704053,710650,37002370,1537411)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (714785,742185,719311,705944,709567,19090984,1398937,731533,19008261,1344965,704053,710650,37002370,1537411)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,365,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Drug Exposure Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Procedure Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,365,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1026.md b/tests/cohorts/reference_outputs/1026.md new file mode 100644 index 00000000..c58b5b9f --- /dev/null +++ b/tests/cohorts/reference_outputs/1026.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Multiple sclerosis' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1026.sql b/tests/cohorts/reference_outputs/1026.sql new file mode 100644 index 00000000..cec51d6c --- /dev/null +++ b/tests/cohorts/reference_outputs/1026.sql @@ -0,0 +1,284 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (374919,44784474,765565,761978)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (374919,44784474,765565,761978)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1027.md b/tests/cohorts/reference_outputs/1027.md new file mode 100644 index 00000000..00388756 --- /dev/null +++ b/tests/cohorts/reference_outputs/1027.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Chronic Leukocytic Leukemia not including Hairy cell, prolymphocytic leukemia, T cell, reticuloendotheliosis + remission' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1027.sql b/tests/cohorts/reference_outputs/1027.sql new file mode 100644 index 00000000..c981d22b --- /dev/null +++ b/tests/cohorts/reference_outputs/1027.sql @@ -0,0 +1,295 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4002356,138379)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4002356,138379)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4038845,4173974,4001331,4079683,44783718)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4038845,4173974,4001331,4079683,44783718)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1028.md b/tests/cohorts/reference_outputs/1028.md new file mode 100644 index 00000000..6004274a --- /dev/null +++ b/tests/cohorts/reference_outputs/1028.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Primary or malignant urothelial bladder cancer'. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1028.sql b/tests/cohorts/reference_outputs/1028.sql new file mode 100644 index 00000000..8d450b44 --- /dev/null +++ b/tests/cohorts/reference_outputs/1028.sql @@ -0,0 +1,295 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (197508,4177230,192855)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (197508,4177230,192855)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4312149,4312802,4313210,4314336,4313925,4314491,4313221,4313222,4314494,37016119,4113112,4111028,37116429,36713671,4080733,4175529,4315813)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4312149,4312802,4313210,4314336,4313925,4314491,4313221,4313222,4314494,37016119,4113112,4111028,37116429,36713671,4080733,4175529,4315813)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1029.md b/tests/cohorts/reference_outputs/1029.md new file mode 100644 index 00000000..9c4616a6 --- /dev/null +++ b/tests/cohorts/reference_outputs/1029.md @@ -0,0 +1,19 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Mantle Cell Lymphoma'. + +2. condition occurrences of any condition (including 'Mantle Cell Lymphoma (non-standard)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1029.sql b/tests/cohorts/reference_outputs/1029.sql new file mode 100644 index 00000000..336eb9a4 --- /dev/null +++ b/tests/cohorts/reference_outputs/1029.sql @@ -0,0 +1,315 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (45590943)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40481901)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40481901)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440058,435758,440058,135204,194878,40487528,135759)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440058,435758,440058,135204,194878,40487528,135759)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cns on (co.condition_source_concept_id = cns.concept_id and cns.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1030.md b/tests/cohorts/reference_outputs/1030.md new file mode 100644 index 00000000..eafa0876 --- /dev/null +++ b/tests/cohorts/reference_outputs/1030.md @@ -0,0 +1,17 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Prostate cancer', who are male >= 18 years old. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1030.sql b/tests/cohorts/reference_outputs/1030.sql new file mode 100644 index 00000000..52baf5ba --- /dev/null +++ b/tests/cohorts/reference_outputs/1030.sql @@ -0,0 +1,285 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4163261)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4163261)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C +JOIN @cdm_database_schema.PERSON P on C.person_id = P.person_id +WHERE YEAR(C.start_date) - P.year_of_birth >= 18 +AND P.gender_concept_id in (8507) +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1031.md b/tests/cohorts/reference_outputs/1031.md new file mode 100644 index 00000000..eae255f0 --- /dev/null +++ b/tests/cohorts/reference_outputs/1031.md @@ -0,0 +1,19 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrence of 'Coronary artery disease ' for the first time in the person's history. + +2. observation of 'Coronary artery disease ' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1031.sql b/tests/cohorts/reference_outputs/1031.sql new file mode 100644 index 00000000..6dd2c91c --- /dev/null +++ b/tests/cohorts/reference_outputs/1031.sql @@ -0,0 +1,298 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (43020660,4185932,37109911,4177223,4127089,37109912,42537729,438172,316995,4108678,4124687,45766165,4108220,4058723,44783188,4080593,4108680,37109910,318443,44809539,45766212,37312532)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (43020660,4185932,37109911,4177223,4127089,37109912,42537729,438172,316995,4108678,4124687,45766165,4108220,4058723,44783188,4080593,4108680,37109910,318443,44809539,45766212)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date , row_number() over (PARTITION BY o.person_id ORDER BY o.observation_date, o.observation_id) as ordinal + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Observation Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1032.md b/tests/cohorts/reference_outputs/1032.md new file mode 100644 index 00000000..6facd87f --- /dev/null +++ b/tests/cohorts/reference_outputs/1032.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)'. + +2. drug exposures of 'Blood glucose lowering drugs, excluding insulin'. + +3. measurements of 'Hemoglobin A1c (HbA1c) measurements', numeric value between 6.5 and 30; unit: "percent". + +4. measurements of 'Hemoglobin A1c (HbA1c) measurements', numeric value between 48 and 99; unit: "millimole per mole". + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. no Type 1 diabetes mellitus diagnosis on or prior to T2DM + +Entry events having no condition occurrences of 'Type 1 Diabetes Mellitus', starting anytime on or before cohort entry start date; allow events outside observation period. + +#### 2. no secondary diabetes diagnosis on or prior to T2DM + +Entry events having no condition occurrences of 'Secondary diabetes mellitus', starting anytime on or before cohort entry start date; allow events outside observation period. + +#### 3. has at least one diagnosis of T2DM on or within 365d of index date + +Entry events having at least 1 condition occurrence of 'Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)', starting between 0 days before and 365 days after cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1032.sql b/tests/cohorts/reference_outputs/1032.sql new file mode 100644 index 00000000..decdae6d --- /dev/null +++ b/tests/cohorts/reference_outputs/1032.sql @@ -0,0 +1,550 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443238,201820,442793)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443238,201820,442793)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (195771)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (195771)) + +) I +) C UNION ALL +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (37059902,4184637)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (37059902,4184637)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (21600744)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (21600744)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Drug Exposure Criteria + +UNION ALL +-- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.unit_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + +WHERE (C.value_as_number >= 6.5000 and C.value_as_number <= 30.0000) +AND C.unit_concept_id in (8554) +-- End Measurement Criteria + +UNION ALL +-- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.unit_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + +WHERE (C.value_as_number >= 48.0000 and C.value_as_number <= 99.0000) +AND C.unit_concept_id in (9579) +-- End Measurement Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,365,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{3 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),3)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 3 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1033.md b/tests/cohorts/reference_outputs/1033.md new file mode 100644 index 00000000..616a6f57 --- /dev/null +++ b/tests/cohorts/reference_outputs/1033.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'HIV excluding HIV-II '. + +Restrict entry events to with at least 1 of the following criteria: + + 1. having at least 1 condition occurrence of 'HIV excluding HIV-II ', starting 1 days after cohort entry start date. + 2. having at least 1 drug exposure of 'HIV drugs', starting between 0 days after and all days after cohort entry start date. + 3. having at least 1 measurement of 'HIV Screening Test', starting between 0 days after and all days after cohort entry start date; numeric value > 1. + + +Limit these restricted entry events to the earliest event per person. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1033.sql b/tests/cohorts/reference_outputs/1033.sql new file mode 100644 index 00000000..b5a26882 --- /dev/null +++ b/tests/cohorts/reference_outputs/1033.sql @@ -0,0 +1,516 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 13 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4276586,44783356,439727)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4276586,44783356,439727)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4013105,432554)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4013105,432554)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 15 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1736971,1789428,1727223,964008,42874220,1756831,1747157,1724869,43560385,35200446,1738135,42874212,1703069,1717002,1758536,1736829,42544019,1711523,1704183,1738170,1787101,1715472,1769389,1712889,40238930,1748921,1746244,1781406,1710281,1736999,1724827,1710612)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1736971,1789428,1727223,964008,42874220,1756831,1747157,1724869,43560385,35200446,1738135,42874212,1703069,1717002,1758536,1736829,42544019,1711523,1704183,1738170,1787101,1715472,1769389,1712889,40238930,1748921,1746244,1781406,1710281,1736999,1724827,1710612)) + +) I +) C UNION ALL +SELECT 17 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2212882,2212884,2212876,40792567,40792354,42529218,4038851,40762145,21491519,21493662,21491520,21491518,3030461,21491517,3044830,2213092,42742380,2213141,2213140,2213142)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (2212882,2212884,2212876,40792567,40792354,42529218,4038851,40762145,21491519,21493662,21491520,21491518,3030461,21491517,3044830,2213092,42742380,2213141,2213140,2213142)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,1,P.START_DATE) AND A.START_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 15) +) C + + +-- End Drug Exposure Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 17) +) C + +WHERE C.value_as_number > 1.0000 +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) >= 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE +WHERE QE.ordinal = 1 +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1034.md b/tests/cohorts/reference_outputs/1034.md new file mode 100644 index 00000000..ab63e534 --- /dev/null +++ b/tests/cohorts/reference_outputs/1034.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Respiratory syncytial virus infection'. + +### Inclusion Criteria + +#### 1. 30 day clean window + +Entry events having no condition occurrences of 'Respiratory syncytial virus infection', starting in the 30 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 30 days. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1034.sql b/tests/cohorts/reference_outputs/1034.sql new file mode 100644 index 00000000..9ae70ca2 --- /dev/null +++ b/tests/cohorts/reference_outputs/1034.sql @@ -0,0 +1,352 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (437222)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (437222)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,30,start_date) > op_end_date then op_end_date else DATEADD(day,30,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1035.md b/tests/cohorts/reference_outputs/1035.md new file mode 100644 index 00000000..094e7880 --- /dev/null +++ b/tests/cohorts/reference_outputs/1035.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Thiazide or thiazide-like diuretics' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Thiazide or thiazide-like diuretics': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1035.sql b/tests/cohorts/reference_outputs/1035.sql new file mode 100644 index 00000000..3a3b0dfd --- /dev/null +++ b/tests/cohorts/reference_outputs/1035.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1395058,974166,978555,907013)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1395058,974166,978555,907013)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 0 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 0 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1036.md b/tests/cohorts/reference_outputs/1036.md new file mode 100644 index 00000000..514ccc80 --- /dev/null +++ b/tests/cohorts/reference_outputs/1036.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Beta blockers' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Beta blockers': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1036.sql b/tests/cohorts/reference_outputs/1036.sql new file mode 100644 index 00000000..327bff78 --- /dev/null +++ b/tests/cohorts/reference_outputs/1036.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1037.md b/tests/cohorts/reference_outputs/1037.md new file mode 100644 index 00000000..c264ff65 --- /dev/null +++ b/tests/cohorts/reference_outputs/1037.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] SGLT2 inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] SGLT2 inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1037.sql b/tests/cohorts/reference_outputs/1037.sql new file mode 100644 index 00000000..2227d745 --- /dev/null +++ b/tests/cohorts/reference_outputs/1037.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (793293,43526465,44785829,45774751)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (793293,43526465,44785829,45774751)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 3 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 3 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1038.md b/tests/cohorts/reference_outputs/1038.md new file mode 100644 index 00000000..364013e4 --- /dev/null +++ b/tests/cohorts/reference_outputs/1038.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] GLP-1 receptor antagonists' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] GLP-1 receptor antagonists': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1038.sql b/tests/cohorts/reference_outputs/1038.sql new file mode 100644 index 00000000..1f58b12a --- /dev/null +++ b/tests/cohorts/reference_outputs/1038.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (45774435,44816332,40170911,793143,1583722,44506754)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (45774435,44816332,40170911,793143,1583722,44506754)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 4 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 4 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1039.md b/tests/cohorts/reference_outputs/1039.md new file mode 100644 index 00000000..a9602cd3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1039.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] DPP4 Inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] DPP4 Inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1039.sql b/tests/cohorts/reference_outputs/1039.sql new file mode 100644 index 00000000..5dae0157 --- /dev/null +++ b/tests/cohorts/reference_outputs/1039.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40166035,40239216,43013884,19122137,1580747)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40166035,40239216,43013884,19122137,1580747)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 5 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 5 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1040.md b/tests/cohorts/reference_outputs/1040.md new file mode 100644 index 00000000..73a1fddb --- /dev/null +++ b/tests/cohorts/reference_outputs/1040.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] TNF inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] TNF inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1040.sql b/tests/cohorts/reference_outputs/1040.sql new file mode 100644 index 00000000..f02d3e47 --- /dev/null +++ b/tests/cohorts/reference_outputs/1040.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (19041065,912263,937368,1151789,1119119)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (19041065,912263,937368,1151789,1119119)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1041.md b/tests/cohorts/reference_outputs/1041.md new file mode 100644 index 00000000..2bac5c2c --- /dev/null +++ b/tests/cohorts/reference_outputs/1041.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] JAK inhibitor' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] JAK inhibitor': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1041.sql b/tests/cohorts/reference_outputs/1041.sql new file mode 100644 index 00000000..7c6fc9a5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1041.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1510627,40244464,42904205)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1510627,40244464,42904205)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 7 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 7 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1042.md b/tests/cohorts/reference_outputs/1042.md new file mode 100644 index 00000000..090b982d --- /dev/null +++ b/tests/cohorts/reference_outputs/1042.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] IL23 inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] IL23 inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1042.sql b/tests/cohorts/reference_outputs/1042.sql new file mode 100644 index 00000000..a24e6be0 --- /dev/null +++ b/tests/cohorts/reference_outputs/1042.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35200139,1511348,1593700)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35200139,1511348,1593700)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 8 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 8 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1043.md b/tests/cohorts/reference_outputs/1043.md new file mode 100644 index 00000000..5bffb567 --- /dev/null +++ b/tests/cohorts/reference_outputs/1043.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] fluoroquinolone systemic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] fluoroquinolone systemic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1043.sql b/tests/cohorts/reference_outputs/1043.sql new file mode 100644 index 00000000..7f84d1f5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1043.sql @@ -0,0 +1,348 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1721543,35198003,1747032,19041153,1592954,1716721,923081,19050750,1712549,35197938,36878831,40161662,43009030,1743222,35834909,35198165,1789276,1797513,1742253,1716903,35197897,19027679,1733765,1707800)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1721543,35198003,1747032,19041153,1592954,1716721,923081,19050750,1712549,35197938,36878831,40161662,43009030,1743222,35834909,35198165,1789276,1797513,1742253,1716903,35197897,19027679,1733765,1707800)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (42613186,2909524,40161667,40028718,40028720,35860696,35858962,40059607,35861002,40001157,40059318,40057467,40066892,40066893,43695029,40069651,35851732,42961482,42479725,40028359,42629035,43258666,40028361,40160496,35605255,35860990,35144130,40069655,42965658,36269500,35857832,35857838,35860698,35862078,35862084,2052955,43678347,35154779,35141912,35861725,35851383,35851392,35856292)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (42613186,2909524,40161667,40028718,40028720,35860696,35858962,40059607,35861002,40001157,40059318,40057467,40066892,40066893,43695029,40069651,35851732,42961482,42479725,40028359,42629035,43258666,40028361,40160496,35605255,35860990,35144130,40069655,42965658,36269500,35857832,35857838,35860698,35862078,35862084,2052955,43678347,35154779,35141912,35861725,35851383,35851392,35856292)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 9 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 9 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1044.md b/tests/cohorts/reference_outputs/1044.md new file mode 100644 index 00000000..9e6b9282 --- /dev/null +++ b/tests/cohorts/reference_outputs/1044.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] cephalosporin systematic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] cephalosporin systematic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1044.sql b/tests/cohorts/reference_outputs/1044.sql new file mode 100644 index 00000000..9467c9b3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1044.sql @@ -0,0 +1,348 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40798709,1796435,40798704,19072255,43008993,19028286,19072857,1773402,19028288,1774470,1774932,19051271,1775741,43009045,1749008,1738366,43009083,19051345,1776684,35198137,43008994,1749083,1777254,1777806,1778162,1786621,19052683,19086759,19086790,1786842,43009087,1708100,19126622,1768849,1769535,19070174,19070680,40798700,1771162,43009082,43009044,1796458,1747005,19028241)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40798709,1796435,40798704,19072255,43008993,19028286,19072857,1773402,19028288,1774470,1774932,19051271,1775741,43009045,1749008,1738366,43009083,19051345,1776684,35198137,43008994,1749083,1777254,1777806,1778162,1786621,19052683,19086759,19086790,1786842,43009087,1708100,19126622,1768849,1769535,19070174,19070680,40798700,1771162,43009082,43009044,1796458,1747005,19028241)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35129269,35160132,2035392,21132307,40020954)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35129269,35160132,2035392,21132307,40020954)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 10 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 10 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1045.md b/tests/cohorts/reference_outputs/1045.md new file mode 100644 index 00000000..9688d67e --- /dev/null +++ b/tests/cohorts/reference_outputs/1045.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Trimethoprim systemetic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Trimethoprim systemetic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1045.sql b/tests/cohorts/reference_outputs/1045.sql new file mode 100644 index 00000000..d3986579 --- /dev/null +++ b/tests/cohorts/reference_outputs/1045.sql @@ -0,0 +1,348 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40081374,36882762,40220482,35153537,40147374,40081379,40081388,1705674)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40081374,36882762,40220482,35153537,40147374,40081379,40081388,1705674)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40073114,40073115,40180925)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40073114,40073115,40180925)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 11 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 11 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1046.md b/tests/cohorts/reference_outputs/1046.md new file mode 100644 index 00000000..1407ff3a --- /dev/null +++ b/tests/cohorts/reference_outputs/1046.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Thiazide or thiazide-like diuretics' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in essential hypertension + +Entry events having at least 1 condition occurrence of 'Essential hypertension', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Thiazide or thiazide-like diuretics': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1046.sql b/tests/cohorts/reference_outputs/1046.sql new file mode 100644 index 00000000..b2270d9c --- /dev/null +++ b/tests/cohorts/reference_outputs/1046.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1395058,974166,978555,907013)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1395058,974166,978555,907013)) + +) I +) C UNION ALL +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (320128,316866)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (320128,316866)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 0 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 0 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1047.md b/tests/cohorts/reference_outputs/1047.md new file mode 100644 index 00000000..e2d4e9cb --- /dev/null +++ b/tests/cohorts/reference_outputs/1047.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Dihydropyridine calcium channel blockers (dCCB)' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in essential hypertension + +Entry events having at least 1 condition occurrence of 'Essential hypertension', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Dihydropyridine calcium channel blockers (dCCB)': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1047.sql b/tests/cohorts/reference_outputs/1047.sql new file mode 100644 index 00000000..698d518a --- /dev/null +++ b/tests/cohorts/reference_outputs/1047.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1332418,1353776,1326012,1318137,1318853,1319880)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1332418,1353776,1326012,1318137,1318853,1319880)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (320128,316866)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (320128,316866)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 1 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 1 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1048.md b/tests/cohorts/reference_outputs/1048.md new file mode 100644 index 00000000..e3c831c5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1048.md @@ -0,0 +1,18 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Dihydropyridine calcium channel blockers (dCCB)' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Dihydropyridine calcium channel blockers (dCCB)': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1048.sql b/tests/cohorts/reference_outputs/1048.sql new file mode 100644 index 00000000..f075b6cc --- /dev/null +++ b/tests/cohorts/reference_outputs/1048.sql @@ -0,0 +1,337 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1332418,1353776,1326012,1318137,1318853,1319880)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1332418,1353776,1326012,1318137,1318853,1319880)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 1 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 1 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1049.md b/tests/cohorts/reference_outputs/1049.md new file mode 100644 index 00000000..df607e09 --- /dev/null +++ b/tests/cohorts/reference_outputs/1049.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Beta blockers' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in essential hypertension + +Entry events having at least 1 condition occurrence of 'Essential hypertension', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Beta blockers': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1049.sql b/tests/cohorts/reference_outputs/1049.sql new file mode 100644 index 00000000..19248c9d --- /dev/null +++ b/tests/cohorts/reference_outputs/1049.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) + +) I +) C UNION ALL +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (320128,316866)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (320128,316866)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1050.md b/tests/cohorts/reference_outputs/1050.md new file mode 100644 index 00000000..a870c886 --- /dev/null +++ b/tests/cohorts/reference_outputs/1050.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Beta blockers' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Left Heart Failure + +Entry events having at least 1 condition occurrence of 'Left Heart Failure', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Beta blockers': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1050.sql b/tests/cohorts/reference_outputs/1050.sql new file mode 100644 index 00000000..019b4630 --- /dev/null +++ b/tests/cohorts/reference_outputs/1050.sql @@ -0,0 +1,416 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (442310,4195785,444031,443587,439846,443580,444101,319835,43020910)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (442310,4195785,444031,443587,439846,443580,444101,319835,43020910)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (37309625,4215446,4233424,4284562,4014159,44782713,312927,608954)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (37309625,4215446,4233424,4284562,4014159,44782713,312927,608954)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1051.md b/tests/cohorts/reference_outputs/1051.md new file mode 100644 index 00000000..efe48140 --- /dev/null +++ b/tests/cohorts/reference_outputs/1051.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] SGLT2 inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Left Heart Failure + +Entry events having at least 1 condition occurrence of 'Left Heart Failure', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] SGLT2 inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1051.sql b/tests/cohorts/reference_outputs/1051.sql new file mode 100644 index 00000000..fc3bf6d1 --- /dev/null +++ b/tests/cohorts/reference_outputs/1051.sql @@ -0,0 +1,416 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (793293,43526465,44785829,45774751)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (793293,43526465,44785829,45774751)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (442310,4195785,444031,443587,439846,443580,444101,319835,43020910)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (442310,4195785,444031,443587,439846,443580,444101,319835,43020910)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (37309625,4215446,4233424,4284562,4014159,44782713,312927,608954)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (37309625,4215446,4233424,4284562,4014159,44782713,312927,608954)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 3 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 3 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1052.md b/tests/cohorts/reference_outputs/1052.md new file mode 100644 index 00000000..c9c10e6c --- /dev/null +++ b/tests/cohorts/reference_outputs/1052.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Beta blockers' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Acute myocardial infarction + +Entry events having at least 1 condition occurrence of '[HowOften] Acute myocardial Infarction', starting between 30 days before and 0 days after cohort entry start date; having at least 1 visit occurrence of '[HowOften] Inpatient or ER visit', starting anytime on or before '[HowOften] Acute myocardial Infarction' start date and ending between 0 days before and all days after '[HowOften] Acute myocardial Infarction' start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Beta blockers': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1052.sql b/tests/cohorts/reference_outputs/1052.sql new file mode 100644 index 00000000..d0749351 --- /dev/null +++ b/tests/cohorts/reference_outputs/1052.sql @@ -0,0 +1,500 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1319998,1314002,1322081,1338005,1346823,1386957,1307046,1313200,1314577,1327978,1345858,1353766)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4329847)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4329847)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (314666)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (314666)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203,9201)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 2 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1053.md b/tests/cohorts/reference_outputs/1053.md new file mode 100644 index 00000000..11d1ae4f --- /dev/null +++ b/tests/cohorts/reference_outputs/1053.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] GLP-1 receptor antagonists' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in type 2 diabetes mellitus + +Entry events having at least 1 condition occurrence of '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)', starting anytime on or before cohort entry start date; with all of the following criteria: + + 1. having no condition occurrences of '[PL] Type 1 Diabetes Mellitus', starting anytime on or before '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)' start date; allow events outside observation period. + 2. having no condition occurrences of '[PL] Secondary diabetes mellitus', starting anytime on or before '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)' start date; allow events outside observation period. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] GLP-1 receptor antagonists': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1053.sql b/tests/cohorts/reference_outputs/1053.sql new file mode 100644 index 00000000..f14f20e6 --- /dev/null +++ b/tests/cohorts/reference_outputs/1053.sql @@ -0,0 +1,587 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (45774435,44816332,40170911,793143,1583722,44506754)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (45774435,44816332,40170911,793143,1583722,44506754)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443238,201820,442793)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443238,201820,442793)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (195771)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (195771)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 4 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 4 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1054.md b/tests/cohorts/reference_outputs/1054.md new file mode 100644 index 00000000..12cfcd00 --- /dev/null +++ b/tests/cohorts/reference_outputs/1054.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] SGLT2 inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Type 2 diabetes mellitus + +Entry events having at least 1 condition occurrence of '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)', starting anytime on or before cohort entry start date; with all of the following criteria: + + 1. having no condition occurrences of '[PL] Type 1 Diabetes Mellitus', starting anytime on or before '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)' start date; allow events outside observation period. + 2. having no condition occurrences of '[PL] Secondary diabetes mellitus', starting anytime on or before '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)' start date; allow events outside observation period. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] SGLT2 inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1054.sql b/tests/cohorts/reference_outputs/1054.sql new file mode 100644 index 00000000..6d6dca40 --- /dev/null +++ b/tests/cohorts/reference_outputs/1054.sql @@ -0,0 +1,587 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (793293,43526465,44785829,45774751)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (793293,43526465,44785829,45774751)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443238,201820,442793)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443238,201820,442793)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) + +) I +) C UNION ALL +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (195771)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (195771)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 3 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 3 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1055.md b/tests/cohorts/reference_outputs/1055.md new file mode 100644 index 00000000..33b5800a --- /dev/null +++ b/tests/cohorts/reference_outputs/1055.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] DPP4 Inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in type 2 diabetes mellitus + +Entry events having at least 1 condition occurrence of '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)', starting anytime on or before cohort entry start date; with all of the following criteria: + + 1. having no condition occurrences of '[PL] Type 1 Diabetes Mellitus', starting anytime on or before '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)' start date; allow events outside observation period. + 2. having no condition occurrences of '[PL] Secondary diabetes mellitus', starting anytime on or before '[PL] Type 2 diabetes mellitus (diabetes mellitus excluding T1DM and secondary)' start date; allow events outside observation period. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] DPP4 Inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1055.sql b/tests/cohorts/reference_outputs/1055.sql new file mode 100644 index 00000000..f0813a8a --- /dev/null +++ b/tests/cohorts/reference_outputs/1055.sql @@ -0,0 +1,587 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40166035,40239216,43013884,19122137,1580747)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40166035,40239216,43013884,19122137,1580747)) + +) I +) C UNION ALL +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443238,201820,442793)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443238,201820,442793)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484648,201254,435216,201254,195771,4058243,761051)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40484649,42689695,765533,43531006,765650,45770986,201254,45768456,40484648,4128019,435216)) + +) I +) C UNION ALL +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (195771)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (195771)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 5 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 5 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1056.md b/tests/cohorts/reference_outputs/1056.md new file mode 100644 index 00000000..798ecd24 --- /dev/null +++ b/tests/cohorts/reference_outputs/1056.md @@ -0,0 +1,31 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] GLP-1 receptor antagonists' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in obesity + +Entry events with any of the following criteria: + + 1. having at least 1 measurement of '[PL] BMI measurement', starting between 365 days before and 0 days after cohort entry start date; numeric value between 30 and 60. + 2. having at least 1 measurement of '[PL] Body weight', starting between 365 days before and 0 days after cohort entry start date; numeric value between 265 and 440; unit: "pound (us)". + 3. having at least 1 measurement of '[PL] Body weight', starting between 365 days before and 0 days after cohort entry start date; numeric value between 120 and 200; unit: "kilogram". + 4. having at least 1 condition occurrence of '[PL] Obesity diagnoses', starting between 365 days before and 0 days after cohort entry start date. + 5. having at least 1 observation of '[PL] Obesity diagnoses', starting between 365 days before and 0 days after cohort entry start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] GLP-1 receptor antagonists': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1056.sql b/tests/cohorts/reference_outputs/1056.sql new file mode 100644 index 00000000..35339322 --- /dev/null +++ b/tests/cohorts/reference_outputs/1056.sql @@ -0,0 +1,536 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (45774435,44816332,40170911,793143,1583722,44506754)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (45774435,44816332,40170911,793143,1583722,44506754)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4215968,4176962)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4215968,4176962)) + +) I +) C UNION ALL +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (3038553,36304833)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (3038553,36304833)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (3025315,4099154,3013762,3027492,3023166)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (3025315,4099154,3013762,3027492,3023166)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4264825)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4264825)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE (C.value_as_number >= 30.0000 and C.value_as_number <= 60.0000) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.unit_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + +WHERE (C.value_as_number >= 265.0000 and C.value_as_number <= 440.0000) +AND C.unit_concept_id in (8739) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.unit_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + +WHERE (C.value_as_number >= 120.0000 and C.value_as_number <= 200.0000) +AND C.unit_concept_id in (9529) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 3 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 4 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Observation Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 4 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 4 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1057.md b/tests/cohorts/reference_outputs/1057.md new file mode 100644 index 00000000..2b848789 --- /dev/null +++ b/tests/cohorts/reference_outputs/1057.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] IL23 inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Plaque psoriasis + +Entry events having at least 1 condition occurrence of 'Plaque psoriasis', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] IL23 inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1057.sql b/tests/cohorts/reference_outputs/1057.sql new file mode 100644 index 00000000..a20488ca --- /dev/null +++ b/tests/cohorts/reference_outputs/1057.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35200139,1511348,1593700)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35200139,1511348,1593700)) + +) I +) C UNION ALL +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (140168,4307925,4063431)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4307925,4063431)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 8 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 8 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1058.md b/tests/cohorts/reference_outputs/1058.md new file mode 100644 index 00000000..049f4c9d --- /dev/null +++ b/tests/cohorts/reference_outputs/1058.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] TNF inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Plaque psoriasis + +Entry events having at least 1 condition occurrence of 'Plaque psoriasis', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] TNF inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1058.sql b/tests/cohorts/reference_outputs/1058.sql new file mode 100644 index 00000000..18dd31f4 --- /dev/null +++ b/tests/cohorts/reference_outputs/1058.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (19041065,912263,937368,1151789,1119119)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (19041065,912263,937368,1151789,1119119)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (140168,4307925,4063431)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4307925,4063431)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1059.md b/tests/cohorts/reference_outputs/1059.md new file mode 100644 index 00000000..aef6137d --- /dev/null +++ b/tests/cohorts/reference_outputs/1059.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] TNF inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Psoriatic Arthritis + +Entry events with any of the following criteria: + + 1. having at least 1 condition occurrence of 'Psoriatic arthritis (exclude mutilans)', starting anytime on or before cohort entry start date. + 2. having at least 1 condition occurrence of 'Arthropathy', starting anytime on or before cohort entry start date; having at least 1 condition occurrence of 'Psoriasis', starting between 60 days before and 60 days after 'Arthropathy' start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] TNF inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1059.sql b/tests/cohorts/reference_outputs/1059.sql new file mode 100644 index 00000000..185e0a4e --- /dev/null +++ b/tests/cohorts/reference_outputs/1059.sql @@ -0,0 +1,530 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (19041065,912263,937368,1151789,1119119)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (19041065,912263,937368,1151789,1119119)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (81931,40319772)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (81931,40319772)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4025831)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (140168)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (140168)) + +) I +) C UNION ALL +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (80809,81097,72714,75621,72705,75622,75897,79903,4153359,437082)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (80809,81097,72714,75621,72705,75622,75897,79903,4153359,437082)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-60,P.START_DATE) AND A.START_DATE <= DATEADD(day,60,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1060.md b/tests/cohorts/reference_outputs/1060.md new file mode 100644 index 00000000..aff32d18 --- /dev/null +++ b/tests/cohorts/reference_outputs/1060.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] fluoroquinolone systemic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Urinary Tract Infection + +Entry events having at least 1 condition occurrence of 'Urinary tract infection', starting between 30 days before and 0 days after cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] fluoroquinolone systemic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1060.sql b/tests/cohorts/reference_outputs/1060.sql new file mode 100644 index 00000000..6b622423 --- /dev/null +++ b/tests/cohorts/reference_outputs/1060.sql @@ -0,0 +1,427 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1721543,35198003,1747032,19041153,1592954,1716721,923081,19050750,1712549,35197938,36878831,40161662,43009030,1743222,35834909,35198165,1789276,1797513,1742253,1716903,35197897,19027679,1733765,1707800)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1721543,35198003,1747032,19041153,1592954,1716721,923081,19050750,1712549,35197938,36878831,40161662,43009030,1743222,35834909,35198165,1789276,1797513,1742253,1716903,35197897,19027679,1733765,1707800)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (42613186,2909524,40161667,40028718,40028720,35860696,35858962,40059607,35861002,40001157,40059318,40057467,40066892,40066893,43695029,40069651,35851732,42961482,42479725,40028359,42629035,43258666,40028361,40160496,35605255,35860990,35144130,40069655,42965658,36269500,35857832,35857838,35860698,35862078,35862084,2052955,43678347,35154779,35141912,35861725,35851383,35851392,35856292)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (42613186,2909524,40161667,40028718,40028720,35860696,35858962,40059607,35861002,40001157,40059318,40057467,40066892,40066893,43695029,40069651,35851732,42961482,42479725,40028359,42629035,43258666,40028361,40160496,35605255,35860990,35144130,40069655,42965658,36269500,35857832,35857838,35860698,35862078,35862084,2052955,43678347,35154779,35141912,35861725,35851383,35851392,35856292)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (81902,77340,4126297,195588)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (81902,77340,4126297,195588)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4167328,4265485,198806,4126267,194997,4077499,442345,4062493,45757237,36714969,195743,201353,4047937,201792,4128384,78357,195313,197919,439349,4227291,4060312,4127564,4126141,4127565,4207186,4207190,434557,432251,36102152,433417,36102938)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4167328,4265485,198806,4126267,4077499,442345,4062493,45757237,36714969,195743,201353,4047937,201792,78357,195313,197919,4127564,4127565,4207186,4207190,434557,432251,36102152,433417,36102938)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 9 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 9 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1061.md b/tests/cohorts/reference_outputs/1061.md new file mode 100644 index 00000000..d2aef5da --- /dev/null +++ b/tests/cohorts/reference_outputs/1061.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] cephalosporin systematic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Urinary Tract Infection + +Entry events having at least 1 condition occurrence of 'Urinary tract infection', starting between 30 days before and 0 days after cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] cephalosporin systematic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1061.sql b/tests/cohorts/reference_outputs/1061.sql new file mode 100644 index 00000000..2774a1c5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1061.sql @@ -0,0 +1,427 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40798709,1796435,40798704,19072255,43008993,19028286,19072857,1773402,19028288,1774470,1774932,19051271,1775741,43009045,1749008,1738366,43009083,19051345,1776684,35198137,43008994,1749083,1777254,1777806,1778162,1786621,19052683,19086759,19086790,1786842,43009087,1708100,19126622,1768849,1769535,19070174,19070680,40798700,1771162,43009082,43009044,1796458,1747005,19028241)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40798709,1796435,40798704,19072255,43008993,19028286,19072857,1773402,19028288,1774470,1774932,19051271,1775741,43009045,1749008,1738366,43009083,19051345,1776684,35198137,43008994,1749083,1777254,1777806,1778162,1786621,19052683,19086759,19086790,1786842,43009087,1708100,19126622,1768849,1769535,19070174,19070680,40798700,1771162,43009082,43009044,1796458,1747005,19028241)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35129269,35160132,2035392,21132307,40020954)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35129269,35160132,2035392,21132307,40020954)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (81902,77340,4126297,195588)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (81902,77340,4126297,195588)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4167328,4265485,198806,4126267,194997,4077499,442345,4062493,45757237,36714969,195743,201353,4047937,201792,4128384,78357,195313,197919,439349,4227291,4060312,4127564,4126141,4127565,4207186,4207190,434557,432251,36102152,433417,36102938)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4167328,4265485,198806,4126267,4077499,442345,4062493,45757237,36714969,195743,201353,4047937,201792,78357,195313,197919,4127564,4127565,4207186,4207190,434557,432251,36102152,433417,36102938)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 10 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 10 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1062.md b/tests/cohorts/reference_outputs/1062.md new file mode 100644 index 00000000..ed85f0f7 --- /dev/null +++ b/tests/cohorts/reference_outputs/1062.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Trimethoprim systemetic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Urinary Tract Infection + +Entry events having at least 1 condition occurrence of 'Urinary tract infection', starting between 30 days before and 0 days after cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Trimethoprim systemetic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1062.sql b/tests/cohorts/reference_outputs/1062.sql new file mode 100644 index 00000000..25ef891c --- /dev/null +++ b/tests/cohorts/reference_outputs/1062.sql @@ -0,0 +1,427 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40081374,36882762,40220482,35153537,40147374,40081379,40081388,1705674)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40081374,36882762,40220482,35153537,40147374,40081379,40081388,1705674)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40073114,40073115,40180925)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40073114,40073115,40180925)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 12 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (81902,77340,4126297,195588)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (81902,77340,4126297,195588)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4167328,4265485,198806,4126267,194997,4077499,442345,4062493,45757237,36714969,195743,201353,4047937,201792,4128384,78357,195313,197919,439349,4227291,4060312,4127564,4126141,4127565,4207186,4207190,434557,432251,36102152,433417,36102938)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4167328,4265485,198806,4126267,4077499,442345,4062493,45757237,36714969,195743,201353,4047937,201792,78357,195313,197919,4127564,4127565,4207186,4207190,434557,432251,36102152,433417,36102938)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 11 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 11 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1063.md b/tests/cohorts/reference_outputs/1063.md new file mode 100644 index 00000000..5209ed7c --- /dev/null +++ b/tests/cohorts/reference_outputs/1063.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] fluoroquinolone systemic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Acute Typical Pneumonia + +Entry events with all of the following criteria: + + 1. having at least 1 condition occurrence of 'Acute Typical Pneumonia', starting between 30 days before and 0 days after cohort entry start date. + 2. having no condition occurrences of 'Non Acute Typical Pneumonia', starting between 30 days before and 0 days after cohort entry start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] fluoroquinolone systemic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1063.sql b/tests/cohorts/reference_outputs/1063.sql new file mode 100644 index 00000000..ee0103ed --- /dev/null +++ b/tests/cohorts/reference_outputs/1063.sql @@ -0,0 +1,464 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1721543,35198003,1747032,19041153,1592954,1716721,923081,19050750,1712549,35197938,36878831,40161662,43009030,1743222,35834909,35198165,1789276,1797513,1742253,1716903,35197897,19027679,1733765,1707800)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1721543,35198003,1747032,19041153,1592954,1716721,923081,19050750,1712549,35197938,36878831,40161662,43009030,1743222,35834909,35198165,1789276,1797513,1742253,1716903,35197897,19027679,1733765,1707800)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (42613186,2909524,40161667,40028718,40028720,35860696,35858962,40059607,35861002,40001157,40059318,40057467,40066892,40066893,43695029,40069651,35851732,42961482,42479725,40028359,42629035,43258666,40028361,40160496,35605255,35860990,35144130,40069655,42965658,36269500,35857832,35857838,35860698,35862078,35862084,2052955,43678347,35154779,35141912,35861725,35851383,35851392,35856292)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (42613186,2909524,40161667,40028718,40028720,35860696,35858962,40059607,35861002,40001157,40059318,40057467,40066892,40066893,43695029,40069651,35851732,42961482,42479725,40028359,42629035,43258666,40028361,40160496,35605255,35860990,35144130,40069655,42965658,36269500,35857832,35857838,35860698,35862078,35862084,2052955,43678347,35154779,35141912,35861725,35851383,35851392,35856292)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4318404)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4318404)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46269693,4193174,36712839,4273378,256622)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46269693,4193174,36712839,4273378,256622)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36712839,4193174,256622,46269693,4273378)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36712839,4193174,256622,46269693,4273378)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 9 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 9 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1064.md b/tests/cohorts/reference_outputs/1064.md new file mode 100644 index 00000000..370cc376 --- /dev/null +++ b/tests/cohorts/reference_outputs/1064.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] cephalosporin systematic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Acute Typical Pneumonia + +Entry events with all of the following criteria: + + 1. having at least 1 condition occurrence of 'Acute Typical Pneumonia', starting between 30 days before and 0 days after cohort entry start date. + 2. having no condition occurrences of 'Non Acute Typical Pneumonia', starting between 30 days before and 0 days after cohort entry start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] cephalosporin systematic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1064.sql b/tests/cohorts/reference_outputs/1064.sql new file mode 100644 index 00000000..1e8b6d72 --- /dev/null +++ b/tests/cohorts/reference_outputs/1064.sql @@ -0,0 +1,464 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40798709,1796435,40798704,19072255,43008993,19028286,19072857,1773402,19028288,1774470,1774932,19051271,1775741,43009045,1749008,1738366,43009083,19051345,1776684,35198137,43008994,1749083,1777254,1777806,1778162,1786621,19052683,19086759,19086790,1786842,43009087,1708100,19126622,1768849,1769535,19070174,19070680,40798700,1771162,43009082,43009044,1796458,1747005,19028241)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40798709,1796435,40798704,19072255,43008993,19028286,19072857,1773402,19028288,1774470,1774932,19051271,1775741,43009045,1749008,1738366,43009083,19051345,1776684,35198137,43008994,1749083,1777254,1777806,1778162,1786621,19052683,19086759,19086790,1786842,43009087,1708100,19126622,1768849,1769535,19070174,19070680,40798700,1771162,43009082,43009044,1796458,1747005,19028241)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35129269,35160132,2035392,21132307,40020954)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35129269,35160132,2035392,21132307,40020954)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4318404)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4318404)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46269693,4193174,36712839,4273378,256622)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46269693,4193174,36712839,4273378,256622)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 12 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36712839,4193174,256622,46269693,4273378)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36712839,4193174,256622,46269693,4273378)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 10 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 10 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1065.md b/tests/cohorts/reference_outputs/1065.md new file mode 100644 index 00000000..a5519dc0 --- /dev/null +++ b/tests/cohorts/reference_outputs/1065.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] Trimethoprim systemetic' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Acute Typical Pneumonia + +Entry events with all of the following criteria: + + 1. having at least 1 condition occurrence of 'Acute Typical Pneumonia', starting between 30 days before and 0 days after cohort entry start date. + 2. having no condition occurrences of 'Non Acute Typical Pneumonia', starting between 30 days before and 0 days after cohort entry start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] Trimethoprim systemetic': +allowing 30 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1065.sql b/tests/cohorts/reference_outputs/1065.sql new file mode 100644 index 00000000..7ab81387 --- /dev/null +++ b/tests/cohorts/reference_outputs/1065.sql @@ -0,0 +1,464 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 11 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40081374,36882762,40220482,35153537,40147374,40081379,40081388,1705674)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40081374,36882762,40220482,35153537,40147374,40081379,40081388,1705674)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40073114,40073115,40180925)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40073114,40073115,40180925)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 12 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4318404)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4318404)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46269693,4193174,36712839,4273378,256622)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46269693,4193174,36712839,4273378,256622)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 13 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36712839,4193174,256622,46269693,4273378)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36712839,4193174,256622,46269693,4273378)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 11) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 11 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 11 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 30, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(30 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1066.md b/tests/cohorts/reference_outputs/1066.md new file mode 100644 index 00000000..e1d8f86f --- /dev/null +++ b/tests/cohorts/reference_outputs/1066.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] TNF inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Rheumatoid arthritis + +Entry events with any of the following criteria: + + 1. having at least 1 condition occurrence of '[PL] Rheumatoid arthritis', starting anytime on or before cohort entry start date. + 2. having at least 1 observation of '[PL] Rheumatoid arthritis', starting anytime on or before cohort entry start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] TNF inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1066.sql b/tests/cohorts/reference_outputs/1066.sql new file mode 100644 index 00000000..b1dd917b --- /dev/null +++ b/tests/cohorts/reference_outputs/1066.sql @@ -0,0 +1,429 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (19041065,912263,937368,1151789,1119119)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (19041065,912263,937368,1151789,1119119)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4297650,4334806,46273442,2107572,2107561,4107913,2108721,4102493,80809,2107560,2107558,2107559,4083556,4035611)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4297650,4334806,46273442,2107572,2107561,4107913,2108721,4102493,80809,2107560,2107558,2107559,4083556,4035611)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Observation Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1067.md b/tests/cohorts/reference_outputs/1067.md new file mode 100644 index 00000000..32df0f94 --- /dev/null +++ b/tests/cohorts/reference_outputs/1067.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] JAK inhibitor' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Ulcerative colitis + +Entry events having at least 1 condition occurrence of 'Ulcerative colitis', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] JAK inhibitor': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1067.sql b/tests/cohorts/reference_outputs/1067.sql new file mode 100644 index 00000000..a207900f --- /dev/null +++ b/tests/cohorts/reference_outputs/1067.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1510627,40244464,42904205)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1510627,40244464,42904205)) + +) I +) C UNION ALL +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46273477,46273478,81893,75580,46269847,46269843)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46273477,46273478,81893,75580,46269847,46269843)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 7 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 7 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1068.md b/tests/cohorts/reference_outputs/1068.md new file mode 100644 index 00000000..f4b1c590 --- /dev/null +++ b/tests/cohorts/reference_outputs/1068.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] TNF inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Ulcerative colitis + +Entry events having at least 1 condition occurrence of '[PL] Ulcerative colitis', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] TNF inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1068.sql b/tests/cohorts/reference_outputs/1068.sql new file mode 100644 index 00000000..770927cc --- /dev/null +++ b/tests/cohorts/reference_outputs/1068.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (19041065,912263,937368,1151789,1119119)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (19041065,912263,937368,1151789,1119119)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46273477,46273478,81893,75580,46269847,46269843)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46273477,46273478,81893,75580,46269847,46269843)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1069.md b/tests/cohorts/reference_outputs/1069.md new file mode 100644 index 00000000..f8309e4b --- /dev/null +++ b/tests/cohorts/reference_outputs/1069.md @@ -0,0 +1,24 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] TNF inhibitors' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Crohns disease + +Entry events having at least 1 condition occurrence of 'Crohns disease', starting anytime on or before cohort entry start date. + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] TNF inhibitors': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1069.sql b/tests/cohorts/reference_outputs/1069.sql new file mode 100644 index 00000000..9325885d --- /dev/null +++ b/tests/cohorts/reference_outputs/1069.sql @@ -0,0 +1,405 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (19041065,912263,937368,1151789,1119119)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (19041065,912263,937368,1151789,1119119)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (46269889,201606,4340812)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (46269889,201606,4340812)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 6 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1070.md b/tests/cohorts/reference_outputs/1070.md new file mode 100644 index 00000000..9cfaab2a --- /dev/null +++ b/tests/cohorts/reference_outputs/1070.md @@ -0,0 +1,28 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. drug exposure of '[HowOften] JAK inhibitor' for the first time in the person's history. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. nested in Rheumatoid arthritis + +Entry events with any of the following criteria: + + 1. having at least 1 condition occurrence of '[PL] Rheumatoid arthritis', starting anytime on or before cohort entry start date. + 2. having at least 1 observation of '[PL] Rheumatoid arthritis', starting anytime on or before cohort entry start date. + + +### Cohort Exit + +The cohort end date will be based on a continuous exposure to '[HowOften] JAK inhibitor': +allowing 90 days between exposures, adding 0 days after exposure ends, and using days supply and exposure end date for exposure duration. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1070.sql b/tests/cohorts/reference_outputs/1070.sql new file mode 100644 index 00000000..4de25b7f --- /dev/null +++ b/tests/cohorts/reference_outputs/1070.sql @@ -0,0 +1,429 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (1510627,40244464,42904205)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (1510627,40244464,42904205)) + +) I +) C UNION ALL +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4297650,4334806,46273442,2107572,2107561,4107913,2108721,4102493,80809,2107560,2107558,2107559,4083556,4035611)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4297650,4334806,46273442,2107572,2107561,4107913,2108721,4102493,80809,2107560,2107558,2107559,4083556,4035611)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Drug Exposure Criteria +select C.person_id, C.drug_exposure_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id,C.start_date as sort_date +from +( + select de.person_id,de.drug_exposure_id,de.drug_concept_id,de.visit_occurrence_id,days_supply,quantity,refills,de.drug_exposure_start_date as start_date, COALESCE(de.drug_exposure_end_date, DATEADD(day,de.days_supply,de.drug_exposure_start_date), DATEADD(day,1,de.drug_exposure_start_date)) as end_date , row_number() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date, de.drug_exposure_id) as ordinal + FROM @cdm_database_schema.DRUG_EXPOSURE de +JOIN #Codesets cs on (de.drug_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + +WHERE C.ordinal = 1 +-- End Drug Exposure Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Observation Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results +WHERE Results.ordinal = 1 +; + +-- custom era strategy + +with ctePersons(person_id) as ( + select distinct person_id from #included_events +) + +select person_id, drug_exposure_start_date, drug_exposure_end_date +INTO #drugTarget +FROM ( + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 7 AND de.drug_concept_id = cs.concept_id + + UNION ALL + + select de.PERSON_ID, DRUG_EXPOSURE_START_DATE, COALESCE(DRUG_EXPOSURE_END_DATE, DATEADD(day,DAYS_SUPPLY,DRUG_EXPOSURE_START_DATE), DATEADD(day,1,DRUG_EXPOSURE_START_DATE)) as DRUG_EXPOSURE_END_DATE + FROM @cdm_database_schema.DRUG_EXPOSURE de + JOIN ctePersons p on de.person_id = p.person_id + JOIN #Codesets cs on cs.codeset_id = 7 AND de.drug_source_concept_id = cs.concept_id +) E +; + +select et.event_id, et.person_id, ERAS.era_end_date as end_date +INTO #strategy_ends +from #included_events et +JOIN +( + + select person_id, min(start_date) as era_start_date, DATEADD(day,-1 * 90, max(end_date)) as era_end_date + from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, drug_exposure_start_date as start_date, DATEADD(day,(90 + 0),DRUG_EXPOSURE_END_DATE) as end_date + FROM #drugTarget + ) DT + ) ST + ) GR + group by person_id, group_idx +) ERAS on ERAS.person_id = et.person_id +WHERE et.start_date between ERAS.era_start_date and ERAS.era_end_date; + +TRUNCATE TABLE #drugTarget; +DROP TABLE #drugTarget; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events +UNION ALL +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1071.md b/tests/cohorts/reference_outputs/1071.md new file mode 100644 index 00000000..3a0e4c87 --- /dev/null +++ b/tests/cohorts/reference_outputs/1071.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People with continuous observation of 365 days before event may enter the cohort when observing any of the following: + +1. observation periods, a user defiend start date of January 1, 2022 and end date of January 1, 2022. + +2. observation periods, a user defiend start date of January 1, 2021 and end date of January 1, 2021. + +3. observation periods, a user defiend start date of January 1, 2020 and end date of January 1, 2020. + +4. observation periods, a user defiend start date of January 1, 2019 and end date of January 1, 2019. + +5. observation periods, a user defiend start date of January 1, 2018 and end date of January 1, 2018. + +6. observation periods, a user defiend start date of January 1, 2017 and end date of January 1, 2017. + +7. observation periods, a user defiend start date of January 1, 2016 and end date of January 1, 2016. + +8. observation periods, a user defiend start date of January 1, 2015 and end date of January 1, 2015. + +9. observation periods, a user defiend start date of January 1, 2014 and end date of January 1, 2014. + +10. observation periods, a user defiend start date of January 1, 2013 and end date of January 1, 2013. + +11. observation periods, a user defiend start date of January 1, 2012 and end date of January 1, 2012. + +Restrict entry events to with the following event criteria: who are female or male, between 0 and 100 years old. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1071.sql b/tests/cohorts/reference_outputs/1071.sql new file mode 100644 index 00000000..f19054d2 --- /dev/null +++ b/tests/cohorts/reference_outputs/1071.sql @@ -0,0 +1,815 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + + + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2022, 1, 1) as start_date, DATEFROMPARTS(2022, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2022, 1, 1) and C.end_date >= DATEFROMPARTS(2022, 1, 1) +AND C.start_date <= DATEFROMPARTS(2022, 1, 1) and C.end_date >= DATEFROMPARTS(2022, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2021, 1, 1) as start_date, DATEFROMPARTS(2021, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2021, 1, 1) and C.end_date >= DATEFROMPARTS(2021, 1, 1) +AND C.start_date <= DATEFROMPARTS(2021, 1, 1) and C.end_date >= DATEFROMPARTS(2021, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2020, 1, 1) as start_date, DATEFROMPARTS(2020, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2020, 1, 1) and C.end_date >= DATEFROMPARTS(2020, 1, 1) +AND C.start_date <= DATEFROMPARTS(2020, 1, 1) and C.end_date >= DATEFROMPARTS(2020, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2019, 1, 1) as start_date, DATEFROMPARTS(2019, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2019, 1, 1) and C.end_date >= DATEFROMPARTS(2019, 1, 1) +AND C.start_date <= DATEFROMPARTS(2019, 1, 1) and C.end_date >= DATEFROMPARTS(2019, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2018, 1, 1) as start_date, DATEFROMPARTS(2018, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2018, 1, 1) and C.end_date >= DATEFROMPARTS(2018, 1, 1) +AND C.start_date <= DATEFROMPARTS(2018, 1, 1) and C.end_date >= DATEFROMPARTS(2018, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2017, 1, 1) as start_date, DATEFROMPARTS(2017, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2017, 1, 1) and C.end_date >= DATEFROMPARTS(2017, 1, 1) +AND C.start_date <= DATEFROMPARTS(2017, 1, 1) and C.end_date >= DATEFROMPARTS(2017, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2016, 1, 1) as start_date, DATEFROMPARTS(2016, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2016, 1, 1) and C.end_date >= DATEFROMPARTS(2016, 1, 1) +AND C.start_date <= DATEFROMPARTS(2016, 1, 1) and C.end_date >= DATEFROMPARTS(2016, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2015, 1, 1) as start_date, DATEFROMPARTS(2015, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2015, 1, 1) and C.end_date >= DATEFROMPARTS(2015, 1, 1) +AND C.start_date <= DATEFROMPARTS(2015, 1, 1) and C.end_date >= DATEFROMPARTS(2015, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2014, 1, 1) as start_date, DATEFROMPARTS(2014, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2014, 1, 1) and C.end_date >= DATEFROMPARTS(2014, 1, 1) +AND C.start_date <= DATEFROMPARTS(2014, 1, 1) and C.end_date >= DATEFROMPARTS(2014, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2013, 1, 1) as start_date, DATEFROMPARTS(2013, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2013, 1, 1) and C.end_date >= DATEFROMPARTS(2013, 1, 1) +AND C.start_date <= DATEFROMPARTS(2013, 1, 1) and C.end_date >= DATEFROMPARTS(2013, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2012, 1, 1) as start_date, DATEFROMPARTS(2012, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2012, 1, 1) and C.end_date >= DATEFROMPARTS(2012, 1, 1) +AND C.start_date <= DATEFROMPARTS(2012, 1, 1) and C.end_date >= DATEFROMPARTS(2012, 1, 1) +-- End Observation Period Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2022, 1, 1) as start_date, DATEFROMPARTS(2022, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2022, 1, 1) and C.end_date >= DATEFROMPARTS(2022, 1, 1) +AND C.start_date <= DATEFROMPARTS(2022, 1, 1) and C.end_date >= DATEFROMPARTS(2022, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2021, 1, 1) as start_date, DATEFROMPARTS(2021, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2021, 1, 1) and C.end_date >= DATEFROMPARTS(2021, 1, 1) +AND C.start_date <= DATEFROMPARTS(2021, 1, 1) and C.end_date >= DATEFROMPARTS(2021, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2020, 1, 1) as start_date, DATEFROMPARTS(2020, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2020, 1, 1) and C.end_date >= DATEFROMPARTS(2020, 1, 1) +AND C.start_date <= DATEFROMPARTS(2020, 1, 1) and C.end_date >= DATEFROMPARTS(2020, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2019, 1, 1) as start_date, DATEFROMPARTS(2019, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2019, 1, 1) and C.end_date >= DATEFROMPARTS(2019, 1, 1) +AND C.start_date <= DATEFROMPARTS(2019, 1, 1) and C.end_date >= DATEFROMPARTS(2019, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2018, 1, 1) as start_date, DATEFROMPARTS(2018, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2018, 1, 1) and C.end_date >= DATEFROMPARTS(2018, 1, 1) +AND C.start_date <= DATEFROMPARTS(2018, 1, 1) and C.end_date >= DATEFROMPARTS(2018, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2017, 1, 1) as start_date, DATEFROMPARTS(2017, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2017, 1, 1) and C.end_date >= DATEFROMPARTS(2017, 1, 1) +AND C.start_date <= DATEFROMPARTS(2017, 1, 1) and C.end_date >= DATEFROMPARTS(2017, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2016, 1, 1) as start_date, DATEFROMPARTS(2016, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2016, 1, 1) and C.end_date >= DATEFROMPARTS(2016, 1, 1) +AND C.start_date <= DATEFROMPARTS(2016, 1, 1) and C.end_date >= DATEFROMPARTS(2016, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2015, 1, 1) as start_date, DATEFROMPARTS(2015, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2015, 1, 1) and C.end_date >= DATEFROMPARTS(2015, 1, 1) +AND C.start_date <= DATEFROMPARTS(2015, 1, 1) and C.end_date >= DATEFROMPARTS(2015, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2014, 1, 1) as start_date, DATEFROMPARTS(2014, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2014, 1, 1) and C.end_date >= DATEFROMPARTS(2014, 1, 1) +AND C.start_date <= DATEFROMPARTS(2014, 1, 1) and C.end_date >= DATEFROMPARTS(2014, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2013, 1, 1) as start_date, DATEFROMPARTS(2013, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2013, 1, 1) and C.end_date >= DATEFROMPARTS(2013, 1, 1) +AND C.start_date <= DATEFROMPARTS(2013, 1, 1) and C.end_date >= DATEFROMPARTS(2013, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2012, 1, 1) as start_date, DATEFROMPARTS(2012, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2012, 1, 1) and C.end_date >= DATEFROMPARTS(2012, 1, 1) +AND C.start_date <= DATEFROMPARTS(2012, 1, 1) and C.end_date >= DATEFROMPARTS(2012, 1, 1) +-- End Observation Period Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2022, 1, 1) as start_date, DATEFROMPARTS(2022, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2022, 1, 1) and C.end_date >= DATEFROMPARTS(2022, 1, 1) +AND C.start_date <= DATEFROMPARTS(2022, 1, 1) and C.end_date >= DATEFROMPARTS(2022, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2021, 1, 1) as start_date, DATEFROMPARTS(2021, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2021, 1, 1) and C.end_date >= DATEFROMPARTS(2021, 1, 1) +AND C.start_date <= DATEFROMPARTS(2021, 1, 1) and C.end_date >= DATEFROMPARTS(2021, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2020, 1, 1) as start_date, DATEFROMPARTS(2020, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2020, 1, 1) and C.end_date >= DATEFROMPARTS(2020, 1, 1) +AND C.start_date <= DATEFROMPARTS(2020, 1, 1) and C.end_date >= DATEFROMPARTS(2020, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2019, 1, 1) as start_date, DATEFROMPARTS(2019, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2019, 1, 1) and C.end_date >= DATEFROMPARTS(2019, 1, 1) +AND C.start_date <= DATEFROMPARTS(2019, 1, 1) and C.end_date >= DATEFROMPARTS(2019, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2018, 1, 1) as start_date, DATEFROMPARTS(2018, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2018, 1, 1) and C.end_date >= DATEFROMPARTS(2018, 1, 1) +AND C.start_date <= DATEFROMPARTS(2018, 1, 1) and C.end_date >= DATEFROMPARTS(2018, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2017, 1, 1) as start_date, DATEFROMPARTS(2017, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2017, 1, 1) and C.end_date >= DATEFROMPARTS(2017, 1, 1) +AND C.start_date <= DATEFROMPARTS(2017, 1, 1) and C.end_date >= DATEFROMPARTS(2017, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2016, 1, 1) as start_date, DATEFROMPARTS(2016, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2016, 1, 1) and C.end_date >= DATEFROMPARTS(2016, 1, 1) +AND C.start_date <= DATEFROMPARTS(2016, 1, 1) and C.end_date >= DATEFROMPARTS(2016, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2015, 1, 1) as start_date, DATEFROMPARTS(2015, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2015, 1, 1) and C.end_date >= DATEFROMPARTS(2015, 1, 1) +AND C.start_date <= DATEFROMPARTS(2015, 1, 1) and C.end_date >= DATEFROMPARTS(2015, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2014, 1, 1) as start_date, DATEFROMPARTS(2014, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2014, 1, 1) and C.end_date >= DATEFROMPARTS(2014, 1, 1) +AND C.start_date <= DATEFROMPARTS(2014, 1, 1) and C.end_date >= DATEFROMPARTS(2014, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2013, 1, 1) as start_date, DATEFROMPARTS(2013, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2013, 1, 1) and C.end_date >= DATEFROMPARTS(2013, 1, 1) +AND C.start_date <= DATEFROMPARTS(2013, 1, 1) and C.end_date >= DATEFROMPARTS(2013, 1, 1) +-- End Observation Period Criteria + +UNION ALL +-- Begin Observation Period Criteria +select C.person_id, C.observation_period_id as event_id, DATEFROMPARTS(2012, 1, 1) as start_date, DATEFROMPARTS(2012, 1, 1) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date + +from +( + select op.person_id,op.observation_period_id,op.period_type_concept_id,op.observation_period_start_date as start_date, op.observation_period_end_date as end_date , row_number() over (PARTITION BY op.person_id ORDER BY op.observation_period_start_date) as ordinal + FROM @cdm_database_schema.OBSERVATION_PERIOD op +) C + +WHERE C.start_date <= DATEFROMPARTS(2012, 1, 1) and C.end_date >= DATEFROMPARTS(2012, 1, 1) +AND C.start_date <= DATEFROMPARTS(2012, 1, 1) and C.end_date >= DATEFROMPARTS(2012, 1, 1) +-- End Observation Period Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE (YEAR(E.start_date) - P.year_of_birth >= 0 and YEAR(E.start_date) - P.year_of_birth <= 100) AND P.gender_concept_id in (8532,8507) +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1072.md b/tests/cohorts/reference_outputs/1072.md new file mode 100644 index 00000000..1e0205db --- /dev/null +++ b/tests/cohorts/reference_outputs/1072.md @@ -0,0 +1,71 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'OMOPUveitis Anterior uveitis [conditions]'. + +2. condition occurrences of 'OMOPUveitis Anterior chamber cell [conditions, measurements]'. + +3. measurements of 'OMOPUveitis Anterior chamber cell [conditions, measurements]', numeric value > 0; with value as concept: ">50 cells", "21-50 cells", "11-20 cells", "5-10 cells", "1+", "2+", "3+", "4+", "present + out of ++++", "present ++ out of ++++", "present +++ out of ++++", "++++", "present ++++ out of ++++", "+++", "++", "+", "trace", "trace", "trace", "positive" or "positive". + +4. observations of 'OMOPUveitis Anterior chamber cell [conditions, measurements]'. + +5. condition occurrences of 'OMOPUveitis Anterior vitreous cell [conditions, measurements]'; having at least 1 condition occurrence of 'OMOPUveitis Other anterior segment inflammation [conditions]', at same visit as 'OMOPUveitis Anterior vitreous cell [conditions, measurements]'. + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Evidence of cytomegalovirus infection in the eye: a. Positive PCR for cytomegalovirus on aqueous specimen (observations, measurements) + +Entry events with any of the following criteria: + + 1. having at least 1 specimen of 'OMOPUveitis CMV AC PCR positive [measurements, observations, specimen]', allow events outside observation period; with any of the following criteria: + + 1. having at least 1 measurement of 'OMOPUveitis CMV AC PCR positive [measurements, observations, specimen]', allow events outside observation period. + 2. having at least 1 observation of 'OMOPUveitis CMV AC PCR positive [measurements, observations, specimen]', allow events outside observation period. + + 2. having at least 1 condition occurrence of 'OMOPUveitis CMV Diagnosis [conditions]', allow events outside observation period. + + +#### 2. no retinitis [conditions] + +Entry events having at most 0 condition occurrences of 'OMOPUveitis Retinitis exclusion [conditions]', starting between 30 days before and 30 days after cohort entry start date; at same visit as cohort entry. + +#### 3. no syphilis [measurements] + +Entry events having at most 0 measurements of 'OMOPUveitis Syphilis exclusion [conditions, measurements]', starting between 30 days before and 30 days after cohort entry start date; at same visit as cohort entry; with value as concept: "positive" or "positive". + +#### 4. no sarcoidosis [conditions, observations] + +Entry events with any of the following criteria: + + 1. having at most 0 condition occurrences of 'OMOPUveitis Sarcoidosis exclusion [conditions, observations]', starting between 30 days before and 30 days after cohort entry start date; at same visit as cohort entry. + 2. having at most 0 observations of 'OMOPUveitis Sarcoidosis exclusion [conditions, observations]', starting between 30 days before and 30 days after cohort entry start date; at same visit as cohort entry; with value as concept: "present", "present", "positive" or "positive". + + +#### 5. no HSV AC PCR [measurements] + +Entry events with all of the following criteria: + + 1. having at most 0 measurements of 'OMOPUveitis HSV AC PCR exclusion [measurements, specimen]', starting between 30 days before and 30 days after cohort entry start date; at same visit as cohort entry; with value as concept: "positive" or "positive". + 2. having at most 0 specimens of 'OMOPUveitis HSV AC PCR exclusion [measurements, specimen]', starting between 30 days before and 30 days after cohort entry start date. + + +#### 6. no VZV AC PCR [measurements] + +Entry events with all of the following criteria: + + 1. having at most 0 measurements of 'OMOPUveitis VZV AC PCR exclusion [measurements, specimen]', starting between 30 days before and 30 days after cohort entry start date; at same visit as cohort entry; with value as concept: "positive" or "positive". + 2. having at most 0 specimens of 'OMOPUveitis VZV AC PCR exclusion [measurements, specimen]', starting between 30 days before and 30 days after cohort entry start date. + + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1072.sql b/tests/cohorts/reference_outputs/1072.sql new file mode 100644 index 00000000..77e060a3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1072.sql @@ -0,0 +1,1052 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36309671,4143091,4122252,4140156,3049944,40764963,37073281,3035833,4138900,4146128)) + +) I +) C UNION ALL +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4132792,4176864,36713131,36713119,36713148,438961,45770924,36717362,441283,440716,36713147,36684732,4274964,36684666,36684792,4104039,36713130,433187,434926,434348,434029,4273853,600624,45757573,4109415,761192,37207891,761191,765069,608799,608800,4335981,37312266,37209447,37209448,4291313,4032140,37207951,3657102,3657101,4221343,761325,761324,761318,439300,439299,3656995,4091179,444446,440634,46269950,4166240,3657042,765063,438422,439731,438751,45772123,761321,761320,761319,432632,36686922,4146105,37207997,3656874,45757732,46273126,603297,4072340,45757712,3657100,4173308,3656958,608988,761323,761322,606435,45770915,4102176,3662325,3656908,3657140,35625724,432908,35625723,35625722,434932,37116567,4211939,4132495,37203959,4182267,4259504,4253620,4211649,4256466,3662324,3662323,4190952,3343020,4081011,4218326)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4132792,4176864,36713131,36713119,36713148,438961,45770924,36717362,441283,440716,36713147,36684732,4274964,36684666,36684792,4104039,36713130,433187,434926,434348,434029,4273853,600624,45757573,4109415,761192,37207891,761191,765069,608799,608800,4335981,37312266,37209447,37209448,4291313,4032140,37207951,3657102,3657101,4221343,761325,761324,761318,439300,439299,3656995,4091179,444446,440634,46269950,4166240,3657042,765063,438422,439731,438751,45772123,761321,761320,761319,432632,36686922,4146105,37207997,3656874,45757732,46273126,603297,4072340,45757712,3657100,4173308,3656958,608988,761323,761322,606435,45770915,4102176,3662325,3656908,3657140,35625724,432908,35625723,35625722,434932,37116567,4211939,4132495,37203959,4182267,4259504,4253620,4211649,4256466,3662324,3662323,4190952,3343020,4081011,4218326)) +UNION +select distinct cr.concept_id_1 as concept_id +FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4132792,4176864,36713131,36713119,36713148,438961,45770924,36717362,441283,440716,36713147,36684732,4274964,36684666,36684792,4104039,36713130,433187,434926,434348,434029,4273853,600624,45757573,4109415,761192,37207891,761191,765069,608799,608800,4335981,37312266,37209447,37209448,4291313,4032140,37207951,3657102,3657101,4221343,761325,761324,761318,439300,439299,3656995,4091179,444446,440634,46269950,4166240,3657042,765063,438422,439731,438751,45772123,761321,761320,761319,432632,36686922,4146105,37207997,3656874,45757732,46273126,603297,4072340,45757712,3657100,4173308,3656958,608988,761323,761322,606435,45770915,4102176,3662325,3656908,3657140,35625724,432908,35625723,35625722,434932,37116567,4211939,4132495,37203959,4182267,4259504,4253620,4211649,4256466,3662324,3662323,4190952,3343020,4081011,4218326)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4132792,4176864,36713131,36713119,36713148,438961,45770924,36717362,441283,440716,36713147,36684732,4274964,36684666,36684792,4104039,36713130,433187,434926,434348,434029,4273853,600624,45757573,4109415,761192,37207891,761191,765069,608799,608800,4335981,37312266,37209447,37209448,4291313,4032140,37207951,3657102,3657101,4221343,761325,761324,761318,439300,439299,3656995,4091179,444446,440634,46269950,4166240,3657042,765063,438422,439731,438751,45772123,761321,761320,761319,432632,36686922,4146105,37207997,3656874,45757732,46273126,603297,4072340,45757712,3657100,4173308,3656958,608988,761323,761322,606435,45770915,4102176,3662325,3656908,3657140,35625724,432908,35625723,35625722,434932,37116567,4211939,4132495,37203959,4182267,4259504,4253620,4211649,4256466,3662324,3662323,4190952,3343020,4081011,4218326)) + +) C +join @vocabulary_database_schema.concept_relationship cr on C.concept_id = cr.concept_id_2 and cr.relationship_id = 'Maps to' and cr.invalid_reason IS NULL + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4081011,21491750,21491751,36309475,36310085,36310741,36309345,3023610,3019906,37022902,37053902)) + +) I +) C UNION ALL +SELECT 5 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4080669,4081010,4148212,3657143,37208236,37208235,4160509,440104,439011,4334756)) + +) I +) C UNION ALL +SELECT 6 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4161546,4183040,439014,438411,761352,4265035,761351,761350,761349,761348,3657772,3657771,3657770,37312551,4212319,4104214,4104213,4211820,3657843,3657842,3657841,4234762,4228115,433757,437850,4109410,433765,433762,434274,4152407,4152406,4322865,3657796,3655858,3655856,4338890,3655855,44783667,3655854,3655853,44783669,44783668,4230371,4042904,4198123,4198124,4195053,4195054,3655301,3655813,4224242,4319477,4319476,4187784,4186870,373963,4219534,373972,4213393,608987,608986,4195992,378078,436967,4214437,4330151,434927,4259500,4259502,439017,36676800,40480902,4233536,46273984,37309749,4212083,380721,4335988,4215673,4213114,4090114,4221187,35624273,435541,3657060,4334872,4334873,37207894,4174680,36684637,434033,440715,4102049,4102047,37207954,37311893,4167058,3663239,36684701,439736,4162559,4087293,3662320,434638,4213641,3662329,3662328,438740,761311,3662319,3662318,3655660,443867,3657173,37208019,761315,761314,761313,44783425,432621,761312,44783424,4215212,432630,36684767,432631,4253619,761343,761342,37208000,37208014,4307553,4338889,37310633,44783671,4108960,4150996,4150995,4196116,1340301,4109407,4338888,438971,4259505,4079919,4217692,4152067,4216286,4213657,4253622)) + +) I +) C UNION ALL +SELECT 7 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (3016587,3022622,3039384,3041149,3010487,3009946,40766194,3018457,3015378,3032397,3030785,3043653,3049422,3007258,3023161,42869548,3007932,3045488,3019539,3010055,4305738,3044651,3031591,3021604,3042468,3019832,3005626,3051954,3011981,37051410,37024028,1617714,37053343,3048453,3024286,3014044,40760151,3040021,3050642,37069707,3029998,3030893,37046128,3040742,3004772,1617619,3029371,1617345,37056367,3015923,3004786,3005900,3039946,3020488,3011520,37064901,3028061,3017178,37035328,1616997,3019603,4247368,1617166,1618180,37076241,37051934,3051627,43533776,40771087,37050546,3019428,3049377,1616824,1616562,3029634,37063672,1616440,3001356,37062153,1616967,3002446,1617505,1618534,37044896,3006157,1618170,1991140,3052315,40761135,3046248,42868435,3019960)) + +) I +) C UNION ALL +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4130903,4163983,4322821,4281245,4081069,4338094)) + +) I +) C UNION ALL +SELECT 10 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4082268,4317991,4082269,3019458,3004523)) + +) I +) C UNION ALL +SELECT 12 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4122252,37394108,4163737)) + +) I +) C UNION ALL +SELECT 13 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4122252,44808404,4046130)) + +) I +) C UNION ALL +SELECT 15 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35205780,35205781,440032)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35205780,35205781,440032)) +UNION +select distinct cr.concept_id_1 as concept_id +FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (35205780,35205781,440032)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (35205780,35205781,440032)) + +) C +join @vocabulary_database_schema.concept_relationship cr on C.concept_id = cr.concept_id_2 and cr.relationship_id = 'Maps to' and cr.invalid_reason IS NULL + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.value_as_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + +WHERE C.value_as_number > 0.0000 +AND C.value_as_concept_id in (36309345,36310085,36309475,36310741,45878548,45881916,45876467,45881623,3459354,3474574,3437429,4126674,3470980,4125547,4126673,4123508,9192,3472281,45881796,9191,45884084) +-- End Measurement Criteria + +UNION ALL +-- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Observation Criteria + +UNION ALL +select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 10) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 5) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.visit_occurrence_id = P.visit_occurrence_id ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Specimen Criteria +select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.specimen_date as sort_date +from +( + select s.* + FROM @cdm_database_schema.SPECIMEN s +where s.specimen_concept_id in (SELECT concept_id from #Codesets where codeset_id = 1) +) C + + +-- End Specimen Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Specimen Criteria +select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.specimen_date as sort_date +from +( + select s.* + FROM @cdm_database_schema.SPECIMEN s +where s.specimen_concept_id in (SELECT concept_id from #Codesets where codeset_id = 1) +) C + + +-- End Specimen Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Specimen Criteria +select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.specimen_date as sort_date +from +( + select s.* + FROM @cdm_database_schema.SPECIMEN s +where s.specimen_concept_id in (SELECT concept_id from #Codesets where codeset_id = 1) +) C + + +-- End Specimen Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Measurement Criteria + +) A on A.person_id = P.person_id ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Specimen Criteria +select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.specimen_date as sort_date +from +( + select s.* + FROM @cdm_database_schema.SPECIMEN s +where s.specimen_concept_id in (SELECT concept_id from #Codesets where codeset_id = 1) +) C + + +-- End Specimen Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Observation Criteria + +) A on A.person_id = P.person_id ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 15) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 6) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) AND A.visit_occurrence_id = P.visit_occurrence_id ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.value_as_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 7) +) C + +WHERE C.value_as_concept_id in (9191,45884084) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) AND A.visit_occurrence_id = P.visit_occurrence_id ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) AND A.visit_occurrence_id = P.visit_occurrence_id ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Observation Criteria +select C.person_id, C.observation_id as event_id, C.start_date, C.END_DATE, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select o.person_id,o.observation_id,o.observation_concept_id,o.visit_occurrence_id,o.value_as_number,o.value_as_concept_id,o.observation_date as start_date, DATEADD(day,1,o.observation_date) as end_date + FROM @cdm_database_schema.OBSERVATION o +JOIN #Codesets cs on (o.observation_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + +WHERE C.value_as_concept_id in (4181412,45879438,45884084,9191) +-- End Observation Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) AND A.visit_occurrence_id = P.visit_occurrence_id ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 4 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_4 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.value_as_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + +WHERE C.value_as_concept_id in (9191,45884084) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) AND A.visit_occurrence_id = P.visit_occurrence_id ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Specimen Criteria +select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.specimen_date as sort_date +from +( + select s.* + FROM @cdm_database_schema.SPECIMEN s +where s.specimen_concept_id in (SELECT concept_id from #Codesets where codeset_id = 12) +) C + + +-- End Specimen Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 5 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_5 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.value_as_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + +WHERE C.value_as_concept_id in (45884084,9191) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) AND A.visit_occurrence_id = P.visit_occurrence_id ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Specimen Criteria +select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.specimen_date as sort_date +from +( + select s.* + FROM @cdm_database_schema.SPECIMEN s +where s.specimen_concept_id in (SELECT concept_id from #Codesets where codeset_id = 13) +) C + + +-- End Specimen Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) <= 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_4 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_5) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + +TRUNCATE TABLE #Inclusion_4; +DROP TABLE #Inclusion_4; + +TRUNCATE TABLE #Inclusion_5; +DROP TABLE #Inclusion_5; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{6 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),6)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 6 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence UNION ALL SELECT CAST(4 as int) as rule_sequence UNION ALL SELECT CAST(5 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1073.md b/tests/cohorts/reference_outputs/1073.md new file mode 100644 index 00000000..f0a22cf5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1073.md @@ -0,0 +1,23 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Serious Infections '; with any of the following criteria: + + 1. having at least 1 visit occurrence of 'Inpatient or ER visit', starting anytime on or before 'Serious Infections ' start date and ending between 0 days before and all days after 'Serious Infections ' start date. + 2. having at least 1 death of any form, starting between 0 days before and 30 days after 'Serious Infections ' start date. + + +2. condition occurrences of 'Opportunistic Infections with tuberculosis'. + +3. condition occurrences of 'Other infections of interest'. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 30 days. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 90 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1073.sql b/tests/cohorts/reference_outputs/1073.sql new file mode 100644 index 00000000..2a34387e --- /dev/null +++ b/tests/cohorts/reference_outputs/1073.sql @@ -0,0 +1,479 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203,9201)) + +) I +) C UNION ALL +SELECT 12 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4326255,193522,4326601,4050869,132736,436339,435613,193814,195453,435318,4345447,378143,441589,4101468,256036,45770836,76034,195317,4231983,4262720,434866,4027461,435785,141663,373412,438350,255848,444099,36712850,192670,433957,253954,198199,196328,132797,196236,195461,4091167,4206579)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4326255,193522,4326601,4050869,132736,436339,435613,193814,195453,435318,4345447,378143,441589,4101468,256036,45770836,76034,195317,4231983,4262720,434866,4027461,435785,141663,373412,438350,255848,444099,36712850,192670,433957,253954,198199,196328,132797,196236,195461,4091167,4206579)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4324289,4176250,4094215,192674,4068969,443406,4098889,195306,4273378,42872891,4169568)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4324289,4176250,4094215,192674,4068969,443406,4098889,195306,4273378,42872891,4169568)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 13 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4087776,434281,440330,433146,433415,260041,28974,260034,437217,440035,4329093,4029319,4205455,45757252,4051338,443943,138682,4045976,45770836,437489,440323,436336,440329,433134,436040,438077,4097550,438059,440631,4174281,373412,438350,256909,433957,443741,434859,434557,4211951)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4087776,434281,440330,433146,433415,260041,28974,260034,437217,440035,4329093,4029319,4205455,45757252,4051338,443943,138682,4045976,45770836,437489,440323,436336,440329,433134,436040,438077,4097550,438059,440631,4174281,373412,438350,256909,433957,443741,434859,434557,4211951)) + +) I +) C UNION ALL +SELECT 14 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (192549,43530817,444249,436020,437899,435563,198978,4001819,374947,4115044,374925,4307774,4051332,133002,135350,4001282,141662,141944,141666,133570,4087776,4280571,196735,4158412,257011,258453,4331815,194560,76022,437936,4188108,37108588,192259,434281,439730,4167984,4196020,4197765,193402,441500,436339,4094504,438064,432545,436091,258458,257315,442574,4200680,4150302,4084966,4199600,372247,433968,260041,29735,133414,28974,80951,198363,4212079,4069115,444418,200171,438066,72245,4126282,4127408,437221,4344638,4021397,260730,201503,193132,135722,380407,198671,4344376,373200,4110056,134735,137077,46271951,134454,4122186,134141,46270395,137367,260034,4096917,377886,4269363,199872,375290,42537043,4307981,193688,437217,433401,4241576,372241,260134,432310,440035,4276193,200017,140654,137213,135473,137497,432251,435742,443739,432250,4347525,4154415,434570,4346971,374352,4238808,261883,198334,443462,199718,197223,4345206,4345354,138346,135745,199067,4161947,4220002,4238732,4324705,198822,4106878,132391,4071026,759835,436188,37396146,79732,77340,81357,80778,74415,437202,45757250,199726,260754,437538,194087,378078,433134,373972,443204,140480,4160460,4340497,40480515,43021258,43021283,40478938,40481816,4200532,434872,4309542,441786,443535,440320,4157605,432249,4050438,436180,4176170,72410,40483549,40481969,40481970,40480731,40485376,4067312,201093,4159147,4063038,4060295,4060296,198337,4180167,192964,4214438,440716,4262590,40481620,40483813,4177365,40481619,37117135,4180873,40483847,4119460,76508,4001126,4001124,381859,443410,441799,260936,134284,137441,192815,195462,198678,4214519,438077,4137770,4346970,4092828,4112820,443600,4141757,440638,440473,438067,437881,443291,436621,440940,434559,376422,440631,436900,440431,433701,133566,4047937,375738,4030846,201792,194685,4174281,137425,136575,201136,140648,432248,141663,133853,138847,137648,140191,134137,195901,133003,133296,4001298,373412,378753,195460,137057,40480261,436897,132835,139737,257778,440328,258785,438350,254066,257908,260430,258180,4299862,253790,46270027,46274035,252351,261324,261053,259048,437474,4308715,36712821,4153877,199863,435457,256909,432541,433405,260026,4245409,443741,258684,256622,253954,437943,432621,376712,198189,198199,133547,72988,4188413,73838,81099,78829,80177,36715557,4174994,4323342,45771090,261774,196328,141213,4030847,312823,132797,40486631,40486629,40487064,40493038,40486059,40491960,40491961,40493415,40487059,40489907,40489908,40489910,40489912,40487616,196236,37394658,440647,201780,434575,4009329,195461,435459,259852,132392,437779,28060,4212727,4143698,4120302,4284844,73068,77156,436285,441170,4077081,80482,318689,373962,4224968,4160328,4084964,80946,134865,4163280,133141,201214,4090114,194871,434557,198674,374267,134851,260630,256018,260315,4153291,192819,4181583,197919,4146482,81902,78073,440158,440029,433960,132834,4154776,4344398)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (132797,440029)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 12) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Death Criteria +select C.person_id, C.person_id as event_id, C.start_date, c.end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date +from +( + select d.person_id,d.cause_concept_id,d.death_date as start_date, DATEADD(day,1,d.death_date) as end_date + FROM @cdm_database_schema.DEATH d + +) C + + +-- End Death Criteria + + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 13) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 14) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,30,start_date) > op_end_date then op_end_date else DATEADD(day,30,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 90, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,90,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1074.md b/tests/cohorts/reference_outputs/1074.md new file mode 100644 index 00000000..a3655176 --- /dev/null +++ b/tests/cohorts/reference_outputs/1074.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Serious Infections '. + +Restrict entry events to with any of the following criteria: + + 1. having at least 1 visit occurrence of 'Inpatient or ER visit', starting anytime on or before cohort entry start date and ending between 0 days before and all days after cohort entry start date. + 2. having at least 1 death of any form, starting between 0 days before and 30 days after cohort entry start date. + + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 30 days. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 90 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1074.sql b/tests/cohorts/reference_outputs/1074.sql new file mode 100644 index 00000000..367d266c --- /dev/null +++ b/tests/cohorts/reference_outputs/1074.sql @@ -0,0 +1,463 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 8 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203,9201)) + +) I +) C UNION ALL +SELECT 9 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4326255,193522,4326601,4050869,132736,436339,435613,193814,195453,435318,4345447,378143,441589,4101468,256036,45770836,76034,195317,4231983,4262720,434866,4027461,435785,141663,373412,438350,255848,444099,36712850,192670,433957,253954,198199,196328,132797,196236,195461,4091167,4206579)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4326255,193522,4326601,4050869,132736,436339,435613,193814,195453,435318,4345447,378143,441589,4101468,256036,45770836,76034,195317,4231983,4262720,434866,4027461,435785,141663,373412,438350,255848,444099,36712850,192670,433957,253954,198199,196328,132797,196236,195461,4091167,4206579)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4324289,4176250,4094215,192674,4068969,443406,4098889,195306,4273378,42872891,4169568)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4324289,4176250,4094215,192674,4068969,443406,4098889,195306,4273378,42872891,4169568)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 8) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 9) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Death Criteria +select C.person_id, C.person_id as event_id, C.start_date, c.end_date, + CAST(NULL as bigint) as visit_occurrence_id, C.start_date as sort_date +from +( + select d.person_id,d.cause_concept_id,d.death_date as start_date, DATEADD(day,1,d.death_date) as end_date + FROM @cdm_database_schema.DEATH d + +) C + + +-- End Death Criteria + + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,30,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,30,start_date) > op_end_date then op_end_date else DATEADD(day,30,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 90, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,90,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1075.md b/tests/cohorts/reference_outputs/1075.md new file mode 100644 index 00000000..0cc71bbe --- /dev/null +++ b/tests/cohorts/reference_outputs/1075.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Narcolepsy'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Narcolepsy', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1075.sql b/tests/cohorts/reference_outputs/1075.sql new file mode 100644 index 00000000..2a91cb5d --- /dev/null +++ b/tests/cohorts/reference_outputs/1075.sql @@ -0,0 +1,352 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (437854,436100)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (437854,436100)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1076.md b/tests/cohorts/reference_outputs/1076.md new file mode 100644 index 00000000..a8d0ce3a --- /dev/null +++ b/tests/cohorts/reference_outputs/1076.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Anaphylaxis or Anaphylactic shock due to serum'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 30 days + +Entry events having no condition occurrences of 'Anaphylaxis or Anaphylactic shock due to serum', starting in the 30 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1076.sql b/tests/cohorts/reference_outputs/1076.sql new file mode 100644 index 00000000..d17d1280 --- /dev/null +++ b/tests/cohorts/reference_outputs/1076.sql @@ -0,0 +1,352 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (441202,442038)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (442038)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1077.md b/tests/cohorts/reference_outputs/1077.md new file mode 100644 index 00000000..30ee3552 --- /dev/null +++ b/tests/cohorts/reference_outputs/1077.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Anaphylaxis broad'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 30 days + +Entry events having no condition occurrences of 'Anaphylaxis broad', starting in the 30 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1077.sql b/tests/cohorts/reference_outputs/1077.sql new file mode 100644 index 00000000..767cbc31 --- /dev/null +++ b/tests/cohorts/reference_outputs/1077.sql @@ -0,0 +1,363 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4032658,4084639,4221182,4193788,441202,42536383)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4032658,4084639,4193788,42536383)) + +) I +) C UNION ALL +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201,9203)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-30,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1078.md b/tests/cohorts/reference_outputs/1078.md new file mode 100644 index 00000000..e55c51e5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1078.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Bell's palsy'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' 183 days + +Entry events having no condition occurrences of 'Bell's palsy', starting in the 183 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1078.sql b/tests/cohorts/reference_outputs/1078.sql new file mode 100644 index 00000000..9b5c2744 --- /dev/null +++ b/tests/cohorts/reference_outputs/1078.sql @@ -0,0 +1,363 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4091559)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4091559)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4048018,36716396)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4048018,36716396)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-183,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1079.md b/tests/cohorts/reference_outputs/1079.md new file mode 100644 index 00000000..fdb33319 --- /dev/null +++ b/tests/cohorts/reference_outputs/1079.md @@ -0,0 +1,23 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Encephalomyelitis'. + +Restrict entry events to having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before cohort entry start date and ending between 0 days before and all days after cohort entry start date. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' 183 days + +Entry events having no condition occurrences of 'Encephalomyelitis', starting in the 183 days prior to cohort entry start date; allow events outside observation period; having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before 'Encephalomyelitis' start date and ending between 0 days before and all days after 'Encephalomyelitis' start date. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1079.sql b/tests/cohorts/reference_outputs/1079.sql new file mode 100644 index 00000000..09585465 --- /dev/null +++ b/tests/cohorts/reference_outputs/1079.sql @@ -0,0 +1,531 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (372615,378143,4147498,373189,4190307,379792,4330496,138965)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (372615,4147498,373189,379792,4330496)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-183,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1080.md b/tests/cohorts/reference_outputs/1080.md new file mode 100644 index 00000000..5f672a5e --- /dev/null +++ b/tests/cohorts/reference_outputs/1080.md @@ -0,0 +1,23 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Guillian-Barre syndrome'. + +Restrict entry events to having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before cohort entry start date and ending between 0 days before and all days after cohort entry start date. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' + +Entry events having no condition occurrences of 'Guillian-Barre syndrome', starting in the 365 days prior to cohort entry start date; allow events outside observation period; having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before 'Guillian-Barre syndrome' start date and ending between 0 days before and all days after 'Guillian-Barre syndrome' start date. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1080.sql b/tests/cohorts/reference_outputs/1080.sql new file mode 100644 index 00000000..53af1a2d --- /dev/null +++ b/tests/cohorts/reference_outputs/1080.sql @@ -0,0 +1,531 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (374925,4164770,4070552)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (374925,4164770,4070552)) + +) I +) C UNION ALL +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1081.md b/tests/cohorts/reference_outputs/1081.md new file mode 100644 index 00000000..d32f4f61 --- /dev/null +++ b/tests/cohorts/reference_outputs/1081.md @@ -0,0 +1,23 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Myocardial Infarction and complication'. + +Restrict entry events to having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before cohort entry start date and ending between 0 days before and all days after cohort entry start date. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Myocardial Infarction and complication', starting in the 365 days prior to cohort entry start date; allow events outside observation period; having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before 'Myocardial Infarction and complication' start date and ending between 0 days before and all days after 'Myocardial Infarction and complication' start date. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1081.sql b/tests/cohorts/reference_outputs/1081.sql new file mode 100644 index 00000000..384f9a5b --- /dev/null +++ b/tests/cohorts/reference_outputs/1081.sql @@ -0,0 +1,542 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4329847,4108680,4108678,438172,4124687,45766212,37109910,37109911,37109912)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4329847,4108680,4108678,438172,4124687,45766212,37109910,37109911,37109912)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (314666)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (314666)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1082.md b/tests/cohorts/reference_outputs/1082.md new file mode 100644 index 00000000..a2adb3be --- /dev/null +++ b/tests/cohorts/reference_outputs/1082.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Myocarditis Pericarditis'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Myocarditis Pericarditis', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1082.sql b/tests/cohorts/reference_outputs/1082.sql new file mode 100644 index 00000000..4ac0d530 --- /dev/null +++ b/tests/cohorts/reference_outputs/1082.sql @@ -0,0 +1,352 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4289908,4138837,314383,4149913,318072,44782774)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4289908,4138837,314383,4149913,318072,44782774)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1083.md b/tests/cohorts/reference_outputs/1083.md new file mode 100644 index 00000000..59af5bee --- /dev/null +++ b/tests/cohorts/reference_outputs/1083.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Idiopathic and Immune Thrombocytopenia'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Idiopathic and Immune Thrombocytopenia', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1083.sql b/tests/cohorts/reference_outputs/1083.sql new file mode 100644 index 00000000..54ccfb53 --- /dev/null +++ b/tests/cohorts/reference_outputs/1083.sql @@ -0,0 +1,352 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4159749,4103532,4119134)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4159749,4103532,4119134)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1084.md b/tests/cohorts/reference_outputs/1084.md new file mode 100644 index 00000000..2d51b82a --- /dev/null +++ b/tests/cohorts/reference_outputs/1084.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Disseminated intravascular coagulation'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Disseminated intravascular coagulation', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1084.sql b/tests/cohorts/reference_outputs/1084.sql new file mode 100644 index 00000000..e6aaaf8b --- /dev/null +++ b/tests/cohorts/reference_outputs/1084.sql @@ -0,0 +1,363 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C UNION ALL +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (436093)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (436093)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1085.md b/tests/cohorts/reference_outputs/1085.md new file mode 100644 index 00000000..53ec4f4f --- /dev/null +++ b/tests/cohorts/reference_outputs/1085.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Appendicitis'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Appendicitis', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1085.sql b/tests/cohorts/reference_outputs/1085.sql new file mode 100644 index 00000000..3d63bc17 --- /dev/null +++ b/tests/cohorts/reference_outputs/1085.sql @@ -0,0 +1,363 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (440448)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (440448)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1086.md b/tests/cohorts/reference_outputs/1086.md new file mode 100644 index 00000000..029ecede --- /dev/null +++ b/tests/cohorts/reference_outputs/1086.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Transverse Myelitis'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Transverse Myelitis', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1086.sql b/tests/cohorts/reference_outputs/1086.sql new file mode 100644 index 00000000..5a5abf46 --- /dev/null +++ b/tests/cohorts/reference_outputs/1086.sql @@ -0,0 +1,352 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443904)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443904)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1087.md b/tests/cohorts/reference_outputs/1087.md new file mode 100644 index 00000000..7cc1bd2d --- /dev/null +++ b/tests/cohorts/reference_outputs/1087.md @@ -0,0 +1,23 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Hemorrhagic stroke subarachnoid intracerebral subdural'. + +Restrict entry events to having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before cohort entry start date and ending between 0 days before and all days after cohort entry start date. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Hemorrhagic stroke subarachnoid intracerebral subdural', starting in the 365 days prior to cohort entry start date; allow events outside observation period; having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before 'Hemorrhagic stroke subarachnoid intracerebral subdural' start date and ending between 0 days before and all days after 'Hemorrhagic stroke subarachnoid intracerebral subdural' start date. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1087.sql b/tests/cohorts/reference_outputs/1087.sql new file mode 100644 index 00000000..f0343e61 --- /dev/null +++ b/tests/cohorts/reference_outputs/1087.sql @@ -0,0 +1,537 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C UNION ALL +SELECT 4 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (439847,432923,4148906,4144154,4111709,42535426,43530728,43530727)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (376713,4174299,36716544,4345688)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4174299,36716544,4345688)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 4) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1088.md b/tests/cohorts/reference_outputs/1088.md new file mode 100644 index 00000000..7f68f62d --- /dev/null +++ b/tests/cohorts/reference_outputs/1088.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Deep Vein Thrombosis broad'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Deep Vein Thrombosis broad', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1088.sql b/tests/cohorts/reference_outputs/1088.sql new file mode 100644 index 00000000..3e67710f --- /dev/null +++ b/tests/cohorts/reference_outputs/1088.sql @@ -0,0 +1,363 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4133004,4149782,444247,40481089,435565,193512,44782752,44782751)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4133004,40481089,435565,193512,44782752,44782751)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (77310,36712971,435887,438820,4179911)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (77310,36712971,435887,438820)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1089.md b/tests/cohorts/reference_outputs/1089.md new file mode 100644 index 00000000..09677605 --- /dev/null +++ b/tests/cohorts/reference_outputs/1089.md @@ -0,0 +1,23 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'cerebral infarction FDA conceptset proxy'. + +Restrict entry events to having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before cohort entry start date and ending between 0 days before and all days after cohort entry start date. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'cerebral infarction FDA conceptset proxy', starting in the 365 days prior to cohort entry start date; allow events outside observation period; having at least 1 visit occurrence of 'Inpatient or Inpatient/ER visit', starting anytime on or before 'cerebral infarction FDA conceptset proxy' start date and ending between 0 days before and all days after 'cerebral infarction FDA conceptset proxy' start date. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1089.sql b/tests/cohorts/reference_outputs/1089.sql new file mode 100644 index 00000000..42526673 --- /dev/null +++ b/tests/cohorts/reference_outputs/1089.sql @@ -0,0 +1,542 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9201)) + +) I +) C UNION ALL +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443454)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443454)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40479572,4046360)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40479572,4046360)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,0,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1090.md b/tests/cohorts/reference_outputs/1090.md new file mode 100644 index 00000000..6dbce039 --- /dev/null +++ b/tests/cohorts/reference_outputs/1090.md @@ -0,0 +1,21 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'Pulmonary Embolism FDA concept proxy'. + +### Inclusion Criteria + +#### 1. has no events in prior 'clean window' - 365 days + +Entry events having no condition occurrences of 'Pulmonary Embolism FDA concept proxy', starting in the 365 days prior to cohort entry start date; allow events outside observation period. + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1090.sql b/tests/cohorts/reference_outputs/1090.sql new file mode 100644 index 00000000..dcec93ee --- /dev/null +++ b/tests/cohorts/reference_outputs/1090.sql @@ -0,0 +1,363 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (254662,36713113,440417)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (254662,36713113,440417)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790,444247,44782732,40479606)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790,444247,44782732,40479606)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{1 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),1)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 1 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1091.md b/tests/cohorts/reference_outputs/1091.md new file mode 100644 index 00000000..3e9030d3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1091.md @@ -0,0 +1,72 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. condition occurrences of 'cerebral venous sinus thrombosis (CVST narrow)'. + +2. condition occurrences of 'Deep Vein Thrombosis (narrow)'. + +3. condition occurrences of 'Pulmonary Embolism'. + +4. condition occurrences of 'Intraabdominal thrombosis - hepatic thrombosis '. + +5. condition occurrences of 'Intraabdominal- splenic infacrtion and thrombosis '. + +6. condition occurrences of 'Portal Vein thrombosis (include visceral, mesenteric)'. + +7. condition occurrences of 'other Intraabdominal thrombosis'. + +8. condition occurrences of 'Intestinal infarction'. + +9. condition occurrences of 'Cerebral infarction'. + +10. condition occurrences of 'Hemorrhagic stroke'. + +11. condition occurrences of 'Myocardial Infarction and complication'. + +### Inclusion Criteria + +#### 1. Thrombocytopenia within 7 days of thrombosis with no such event in the past 90 days (clean window) + +Entry events with all of the following criteria: + + + 1. with any of the following criteria: + + 1. having at least 1 measurement of 'Platelet measurement', starting between 7 days before and 7 days after cohort entry start date; numeric value between 10 and 150; unit: "cubic millimeter", "per cubic millimeter", "thousand per microliter", "thousand per cubic millimeter", "billion per liter", "per liter" or "million per milliliter". + 2. having at least 1 measurement of 'Platelet measurement', starting between 7 days before and 7 days after cohort entry start date; numeric value between 10 and 150; low range between 130 and 170. + 3. having at least 1 condition occurrence of 'Thrombocytopenia (narrow)', starting between 7 days before and 7 days after cohort entry start date. + + 2. with all of the following criteria: + + 1. having no measurements of 'Platelet measurement', starting between 90 days before and 7 days before cohort entry start date; numeric value between 10 and 150; unit: "cubic millimeter", "per cubic millimeter", "thousand per microliter", "thousand per cubic millimeter", "billion per liter", "per liter" or "million unit per milliliter". + 2. having no measurements of 'Platelet measurement', starting between 90 days before and 7 days before cohort entry start date; numeric value between 10 and 150; low range between 130 and 170. + 3. having no condition occurrences of 'Thrombocytopenia (broad)', starting between 90 days before and 7 days before cohort entry start date. + + +#### 2. Thrombosis clean window period (-365 days) + +Entry events with all of the following criteria: + + 1. having no condition occurrences of 'cerebral venous sinus thrombosis (CVST broad)', starting in the 365 days prior to cohort entry start date. + 2. having no condition occurrences of 'Deep Vein Thrombosis (broad)', starting in the 365 days prior to cohort entry start date. + 3. having no condition occurrences of 'Pulmonary Embolism', starting in the 365 days prior to cohort entry start date. + 4. having no condition occurrences of 'Intraabdominal thrombosis - hepatic thrombosis ', starting in the 365 days prior to cohort entry start date. + 5. having no condition occurrences of 'Intraabdominal- splenic infacrtion and thrombosis ', starting in the 365 days prior to cohort entry start date. + 6. having no condition occurrences of 'Portal Vein thrombosis (include visceral, mesenteric)', starting in the 365 days prior to cohort entry start date. + 7. having no condition occurrences of 'other Intraabdominal thrombosis', starting in the 365 days prior to cohort entry start date. + 8. having no condition occurrences of 'Intestinal infarction', starting in the 365 days prior to cohort entry start date. + 9. having no condition occurrences of 'Cerebral infarction', starting in the 365 days prior to cohort entry start date. + 10. having no condition occurrences of 'Hemorrhagic stroke', starting in the 365 days prior to cohort entry start date. + 11. having no condition occurrences of 'Myocardial Infarction and complication', starting in the 365 days prior to cohort entry start date. + + +### Cohort Exit + +The cohort end date will be offset from index event's start date plus 1 day. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1091.sql b/tests/cohorts/reference_outputs/1091.sql new file mode 100644 index 00000000..ad0eb953 --- /dev/null +++ b/tests/cohorts/reference_outputs/1091.sql @@ -0,0 +1,1228 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (37397537,432870)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (37397537,432870)) + +) I +) C UNION ALL +SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (3007461,3031586,3024929,3039827,3024386,4267147,37393863)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (3007461,3031586,3024929,3039827,3024386,4267147,37393863)) + +) I +) C UNION ALL +SELECT 31 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (44782752,435565,40481089,193512,4133004,4149782,44782762,762049,762048,46271900,4317289,4124856,4318407,4055089,45757410,45757409,4203836,44782759,4205652,762046,762051,44811347,4033521,45773536,4203618,762047,36712892,4096099)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (44782752,40481089,4133004)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36712971,435887,4179911,435031,4062264,438820,4089917,4269051)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36712971,435887,435031,4062264,438820)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 34 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (320741,4096099,44782752,44811347,45757409,4203836,4205652,4124856,4203618,4318407,762047,44782762,435565,45757410,4033521,762049,4055089,440738,444247,40481089,193512,45773536,36712892,4234997,439838,4133004,44782759,444097,4327889,4149782,762048,4317289)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (44782752,40481089,4133004)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36712971,435887,438820,4179911,4089917)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36712971,435887,438820,4089917)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 35 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (254662,36713113,440417,4236271)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (254662,36713113,440417)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790,444247,44782732,40479606,4240832)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790,444247,44782732,40479606)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 40 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (443454)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (443454)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (40479572,4046360,372435,377254,379778,443790,443864,444091,4046089,4046090,4129534)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (40479572,4046360)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 41 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (439847,432923,4148906,4144154,4111709,42535426,43530728,43530727,4108952,4111708,35609033)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (376713,4174299,36716544,4345688)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4174299,36716544,4345688)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4329847,4108680,4108678,438172,4124687,45766212,37109910,37109911,37109912)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4329847,4108680,4108678,438172,4124687,45766212,37109910,37109911,37109912)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (314666)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (314666)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 44 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4195665,4148299,4173167,4317289,4319280,4144032,45757410,45757409,44811741,44811740,37117790,37016198,35622081,35622080,4345926,4342767,4341648,4341646,4340939,4340378,4340375,4318537,4318407,4240850,4239942,4237654,4215949,4214720,4192856,4188336,4174014,4149013,4148257,4148256,4124856,4055089,4055025,4045408,201894,192673)) + +) I +) C UNION ALL +SELECT 47 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (432870)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (432870)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (37397537,36713112,40321716,435076,4239484,137829,4133981,436956,4316372,42536958,4247776,440982,42537688,437242,4221109,432881,4119134)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (37397537,36713112,435076,4239484,137829,4133981,436956,4316372,42536958,4247776,440982,42537688,437242,4221109,432881)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 49 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4223098,4301208,4111853,196715,4277276)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4223098,4301208,4111853,4277276)) + +) I +) C UNION ALL +SELECT 50 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (199837,37111372,4223670,196715,36717492,45757410,45757409,4124856,4173167,4144032,4055089,4318407,4317289)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (199837,37111372,4223670)) + +) I +) C UNION ALL +SELECT 52 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (36712891,4033521,35615064,36712892,4044745,4048527)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (36712891,4033521,35615064,36712892,4044745)) + +) I +) C UNION ALL +SELECT 55 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4111714,4179912)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4111714,4179912)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4061473,4273550,45765438,36717594,4223544)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4061473,4273550,45765438,36717594,4223544)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 56 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (318137,4111714,4045733,4179912)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (318137,4111714,4179912)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4061473,4273550,45765438,36717594,4223544)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4061473,4273550,45765438,36717594,4223544)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C UNION ALL +SELECT 57 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4049318,4223670,444264,4207615,4273526)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4049318,4223670,444264,4207615,4273526)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (196715,199837,4317289,195294,4033521,4301208,4092406)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (196715,199837,4317289,195294,4033521,4301208,4092406)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 55) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 31) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 35) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 49) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 52) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 50) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 57) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 44) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 40) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 41) +) C + + +-- End Condition Occurrence Criteria + +UNION ALL +-- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.unit_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000) +AND C.unit_concept_id in (8686,8785,8848,8961,9444,9254,8816) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-7,P.START_DATE) AND A.START_DATE <= DATEADD(day,7,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000) +AND (C.range_low >= 130.0000 and C.range_low <= 170.0000) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-7,P.START_DATE) AND A.START_DATE <= DATEADD(day,7,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 47) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-7,P.START_DATE) AND A.START_DATE <= DATEADD(day,7,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) > 0 +) G +-- End Criteria Group + +UNION ALL +-- Begin Criteria Group +select 1 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.unit_concept_id,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000) +AND C.unit_concept_id in (8686,8785,8848,8961,9444,9254,45890995) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-90,P.START_DATE) AND A.START_DATE <= DATEADD(day,-7,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Measurement Criteria +select C.person_id, C.measurement_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select m.person_id,m.measurement_id,m.measurement_concept_id,m.visit_occurrence_id,m.value_as_number,m.range_high,m.range_low,m.measurement_date as start_date, DATEADD(day,1,m.measurement_date) as end_date + FROM @cdm_database_schema.MEASUREMENT m +JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2) +) C + +WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000) +AND (C.range_low >= 130.0000 and C.range_low <= 170.0000) +-- End Measurement Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-90,P.START_DATE) AND A.START_DATE <= DATEADD(day,-7,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 1) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-90,P.START_DATE) AND A.START_DATE <= DATEADD(day,-7,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 3 +) G +-- End Criteria Group + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 2 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 56) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 1 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 34) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 2 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 35) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 3 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 49) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 4 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 52) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 5 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 50) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 6 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 57) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 7 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 44) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 8 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 40) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 9 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 41) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + +UNION ALL +-- Begin Correlated Criteria +select 10 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 11 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{2 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),2)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 2 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1093.md b/tests/cohorts/reference_outputs/1093.md new file mode 100644 index 00000000..7422bcea --- /dev/null +++ b/tests/cohorts/reference_outputs/1093.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'AAA repair (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'AAA repair (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1093.sql b/tests/cohorts/reference_outputs/1093.sql new file mode 100644 index 00000000..4c5c3217 --- /dev/null +++ b/tests/cohorts/reference_outputs/1093.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 84 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2002250,2730049,2730053,42894733,42894737,2725615,2725619,2729915,2730103,2729917,2730105,2729916,2730104,2002063,2002084,2736486,2736490,2736494,42897039,42897078,42897085,2730884,2730887)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 84) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 84) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1094.md b/tests/cohorts/reference_outputs/1094.md new file mode 100644 index 00000000..412bc25a --- /dev/null +++ b/tests/cohorts/reference_outputs/1094.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Lower Extremity Bypass (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Lower Extremity Bypass (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1094.sql b/tests/cohorts/reference_outputs/1094.sql new file mode 100644 index 00000000..2aa460ec --- /dev/null +++ b/tests/cohorts/reference_outputs/1094.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 85 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2002187,2729943,2730416,2729923,2730209,2730169,2730456,2729963,2730436,2730189,2730476,2729949,2730422,2729929,2730215,2730175,2730462,2729969,2730442,2730195,2730668,2729952,2730425,2729932,2730218,2730178,2730465,2729972,2730445,2730198,2730671,2729946,2730419,2729926,2730212,2730172,2730459,2729966,2730439,2730192,2730665,2729942,2730415,2729922,2730208,2730168,2730455,2729962,2730435,2730188,2730475,2729948,2730421,2729928,2730214,2730174,2730461,2729968,2730441,2730194,2730667,2729951,2730424,2729931,2730217,2730177,2730464,2729971,2730444,2730197,2730670,2729945,2730418,2729925,2730211,2730171,2730458,2729965,2730438,2730191,2730664,2729954,2730427,2729934,2730220,2730180,2730467,2729974,2730447,2730200,2730673,2729953,2730426,2729933,2730219,2730179,2730466,2729973,2730446,2730199,2730672,2729941,2730414,2729921,2730207,2730167,2730454,2729961,2730434,2730187,2730474,2729947,2730420,2729927,2730213,2730173,2730460,2729967,2730440,2730193,2730666,2729950,2730423,2729930,2730216,2730176,2730463,2729970,2730443,2730196,2730669,2729944,2730417,2729924,2730210,2730170,2730457,2729964,2730437,2730190,2730663,2735223,2735420,2735221,2735227,2735222,2735228,2735225,2735422,2735224,2735421,2735226,2735423,2727323,2727307,2726917,2727339,2726933,2727329,2727313,2726923,2727345,2726939,2727320,2727304,2726914,2727336,2726930,2727326,2727310,2726920,2727342,2726936,2727333,2727317,2726927,2727349,2726943,2727322,2727306,2726916,2727338,2726932,2727328,2727312,2726922,2727344,2726938,2727319,2727303,2726913,2727335,2726929,2727325,2727309,2726919,2727341,2726935,2727331,2727315,2726925,2727347,2726941,2727332,2727316,2726926,2727348,2726942,2727321,2727305,2726915,2727337,2726931,2727327,2727311,2726921,2727343,2726937,2727318,2727302,2726912,2727334,2726928,2727324,2727308,2726918,2727340,2726934,2727330,2727314,2726924,2727346,2726940,2727618,2727617,2727620,2727619,2727621,2734546,2734552,2734544,2734550,2734545,2734551,2734548,2734554,2734547,2734553,2734549,2734555,2727352,2727836,2727384,2727368,2727400,2727358,2727842,2727390,2727374,2727406,2727849,2727833,2727381,2727365,2727397,2727355,2727839,2727387,2727371,2727403,2727362,2727846,2727394,2727378,2727410,2727351,2727835,2727383,2727367,2727399,2727357,2727841,2727389,2727373,2727405,2727848,2727832,2727380,2727364,2727396,2727354,2727838,2727386,2727370,2727402,2727360,2727844,2727392,2727376,2727408,2727361,2727845,2727393,2727377,2727409,2727350,2727834,2727382,2727366,2727398,2727356,2727840,2727388,2727372,2727404,2727847,2727831,2727379,2727363,2727395,2727353,2727837,2727385,2727369,2727401,2727359,2727843,2727391,2727375,2727407,2734060,2734066,2734058,2734064,2734059,2734065,2734062,2734068,2734061,2734067,2734063,2734069,2734295,2734301,2734293,2734299,2734294,2734300,2734297,2734303,2734296,2734302,2734298,2734304,2727436,2727432,2727444,2727440,2727448,2727435,2727431,2727443,2727439,2727447,2727438,2727434,2727446,2727442,2727450,2727437,2727433,2727445,2727441,2727449,2734084,2734090,2734082,2734088,2734083,2734089,2734086,2734092,2734085,2734091,2734087,2734093,2734319,2734325,2734317,2734323,2734318,2734324,2734321,2734327,2734320,2734326,2734322,2734328,2727635,2727633,2727639,2727637,2727641,2731688,2732163,2731668,2731955,2731915,2732203,2731708,2732183,2731935,2732412,2731687,2732162,2731667,2731954,2731914,2732202,2731707,2732182,2731934,2732411,2731686,2732161,2731666,2731953,2731913,2732201,2731706,2732181,2731933,2732410,2735929,2735935,2735927,2735933,2735928,2735934,2735931,2735937,2735930,2735936,2735932,2735938,2727658,2727657,2727660,2727659,2727661,2729777,2730019,2729766,2730008,2729986,2730229,2729788,2730030,2729997,2730240,2729776,2730018,2729765,2730007,2729985,2730228,2729787,2730029,2729996,2730239,2729775,2730017,2729764,2730006,2729984,2730227,2729786,2730028,2729995,2730238,2735953,2735959,2735951,2735957,2735952,2735958,2735955,2735961,2735954,2735960,2735956,2735962,2734594,2734789,2734592,2734787,2734593,2734788,2734596,2734791,2734595,2734790,2734597,2734792,2734831,2734837,2734829,2734835,2734830,2734836,2734833,2734839,2734832,2734838,2734834,2734840,2730531,2730763,2730522,2730754,2730736,2730781,2730727,2730772,2730745,2730977,2730535,2730767,2730526,2730758,2730740,2730785,2730731,2730776,2730749,2730981,2730530,2730762,2730521,2730753,2730735,2730780,2730726,2730771,2730744,2730976,2730536,2730768,2730527,2730759,2730741,2730786,2730732,2730777,2730750,2730982,2730537,2730769,2730528,2730760,2730742,2730787,2730733,2730778,2730751,2730983,2730533,2730765,2730524,2730756,2730738,2730783,2730729,2730774,2730747,2730979,2730532,2730764,2730523,2730755,2730737,2730782,2730728,2730773,2730746,2730978,2730534,2730766,2730525,2730757,2730739,2730784,2730730,2730775,2730748,2730980,2730529,2730761,2730520,2730752,2730734,2730779,2730538,2730770,2730743,2730788,2736186,2736192,2736184,2736190,2736185,2736191,2736188,2736194,2736187,2736193,2736189,2736195,43015480,43015495,43015477,43015492,43015486,43015501,43015483,43015498,43015489,43015504,43015481,43015496,43015478,43015493,43015487,43015502,43015484,43015499,43015490,43015505,43015482,43015497,43015479,43015494,43015488,43015503,43015485,43015500,43015491,43015506,2736443,2736449,2736441,2736447,2736442,2736448,2736445,2736451,2736444,2736450,2736446,2736452,2734343,2734540,2734341,2734538,2734342,2734539,2734536,2734542,2734344,2734541,2734537,2734543,2727648,2727647,2727650,2727649,2727651,2732922,2733166,2732911,2732966,2732944,2733188,2732933,2733177,2732955,2733199,2732921,2733165,2732910,2732965,2732943,2733187,2732932,2733176,2732954,2733198,2732920,2733164,2732909,2732964,2732942,2733186,2732931,2733175,2732953,2733197,2734570,2734576,2734568,2734574,2734569,2734575,2734572,2734578,2734571,2734577,2734573,2734579,43015420,43015435,43015417,43015432,43015426,43015441,43015423,43015438,43015429,43015444,43015421,43015436,43015418,43015433,43015427,43015442,43015424,43015439,43015430,43015445,43015422,43015437,43015419,43015434,43015428,43015443,43015425,43015440,43015431,43015446,2731225,2731250,2731036,2731245,2731235,2731260,2731230,2731255,2731240,2731265,2731226,2731251,2731037,2731246,2731236,2731261,2731231,2731256,2731241,2731266,2731227,2731252,2731038,2731247,2731237,2731262,2731232,2731257,2731242,2731267,2731224,2731249,2731035,2731244,2731234,2731259,2731229,2731254,2731239,2731264,2731223,2731248,2731034,2731243,2731233,2731258,2731228,2731253,2731238,2731263,2727609,2727607,2727613,2727611,2727615,2727610,2727608,2727614,2727612,2727616,2736210,2736216,2736208,2736214,2736209,2736215,2736212,2736218,2736211,2736217,2736213,2736219,2727057,2727039,2727093,2727075,2727738,2727063,2727045,2727726,2727081,2727744,2727054,2727036,2727090,2727072,2727735,2727060,2727042,2727096,2727078,2727741,2727067,2727049,2727730,2727085,2727748,2727056,2727038,2727092,2727074,2727737,2727062,2727044,2727098,2727080,2727743,2727053,2727035,2727089,2727071,2727734,2727059,2727041,2727095,2727077,2727740,2727065,2727047,2727728,2727083,2727746,2727066,2727048,2727729,2727084,2727747,2727055,2727037,2727091,2727073,2727736,2727061,2727043,2727097,2727079,2727742,2727052,2727034,2727088,2727070,2727733,2727058,2727040,2727094,2727076,2727739,2727064,2727046,2727727,2727082,2727745,2727463,2727461,2727467,2727465,2727469,2727464,2727462,2727468,2727466,2727470,2734807,2734813,2734805,2734811,2734806,2734812,2734809,2734815,2734808,2734814,2734810,2734816,2727772,2727756,2727804,2727788,2727820,2727778,2727762,2727810,2727794,2727826,2727769,2727753,2727801,2727785,2727817,2727775,2727759,2727807,2727791,2727823,2727782,2727766,2727814,2727798,2727830,2727771,2727755,2727803,2727787,2727819,2727777,2727761,2727809,2727793,2727825,2727768,2727752,2727800,2727784,2727816,2727774,2727758,2727806,2727790,2727822,2727780,2727764,2727812,2727796,2727828,2727781,2727765,2727813,2727797,2727829,2727770,2727754,2727802,2727786,2727818,2727776,2727760,2727808,2727792,2727824,2727767,2727751,2727799,2727783,2727815,2727773,2727757,2727805,2727789,2727821,2727779,2727763) or concept_id in (2727811,2727795,2727827,2734048,2734054,2734046,2734052,2734047,2734053,2734050,2734056,2734049,2734055,2734051,2734057,2734283,2734289,2734094,2734287,2734282,2734288,2734285,2734291,2734284,2734290,2734286,2734292,2727418,2727414,2727426,2727422,2727430,2727416,2727412,2727424,2727420,2727428,2727415,2727411,2727423,2727419,2727427,2727417,2727413,2727425,2727421,2727429,2734072,2734078,2734070,2734076,2734071,2734077,2734074,2734080,2734073,2734079,2734075,2734081,2734307,2734313,2734305,2734311,2734306,2734312,2734309,2734315,2734308,2734314,2734310,2734316,2727625,2727623,2727629,2727627,2727631,2730928,2731214,2730721,2731194,2730968,2731443,2730948,2731423,2731174,2731463,2730927,2731213,2730720,2731193,2730967,2731442,2730947,2731422,2731173,2731462,2730926,2731212,2730719,2731192,2730966,2731441,2730946,2731421,2731172,2731461,2735727,2735733,2735725,2735731,2735726,2735732,2735729,2735735,2735728,2735734,2735730,2735926,2727653,2727652,2727655,2727654,2727656,2733410,2733465,2733210,2733454,2733432,2729744,2733421,2729733,2733443,2729755,2733220,2733464,2733209,2733453,2733431,2729743,2733420,2729732,2733442,2729754,2733219,2733463,2733208,2733452,2733430,2729742,2733419,2729731,2733441,2729753,2735941,2735947,2735939,2735945,2735940,2735946,2735943,2735949,2735942,2735948,2735944,2735950,2734582,2734588,2734580,2734586,2734581,2734587,2734584,2734590,2734583,2734589,2734585,2734591,2734819,2734825,2734817,2734823,2734818,2734824,2734821,2734827,2734820,2734826,2734822,2734828,2730254,2730486,2730245,2730477,2730272,2730504,2730263,2730495,2730281,2730513,2730258,2730490,2730249,2730481,2730276,2730508,2730267,2730499,2730285,2730517,2730253,2730485,2730244,2730289,2730271,2730503,2730262,2730494,2730280,2730512,2730259,2730491,2730250,2730482,2730277,2730509,2730268,2730500,2730286,2730518,2730260,2730492,2730251,2730483,2730278,2730510,2730269,2730501,2730287,2730519,2730256,2730488,2730247,2730479,2730274,2730506,2730265,2730497,2730283,2730515,2730255,2730487,2730246,2730478,2730273,2730505,2730264,2730496,2730282,2730514,2730257,2730489,2730248,2730480,2730275,2730507,2730266,2730498,2730284,2730516,2730252,2730484,2730243,2730288,2730270,2730502,2730261,2730493,2730279,2730511,2736174,2736180,2735987,2736178,2736173,2736179,2736176,2736182,2736175,2736181,2736177,2736183,43015450,43015465,43015447,43015462,43015456,43015471,43015453,43015468,43015459,43015474,43015451,43015466,43015448,43015463,43015457,43015472,43015454,43015469,43015460,43015475,43015452,43015467,43015449,43015464,43015458,43015473,43015455,43015470,43015461,43015476,2736431,2736437,2736429,2736435,2736430,2736436,2736433,2736439,2736432,2736438,2736434,2736440,2734331,2734337,2734329,2734335,2734330,2734336,2734333,2734339,2734332,2734338,2734334,2734340,2735965,2735971,2735963,2735969,2735964,2735970,2735967,2735973,2735966,2735972,2735968,2735974,2727643,2727642,2727645,2727644,2727646,2732434,2732678,2732423,2732667,2732456,2732700,2732445,2732689,2732467,2732711,2732433,2732677,2732422,2732666,2732455,2732699,2732444,2732688,2732466,2732710,2732432,2732676,2732421,2732665,2732454,2732698,2732443,2732687,2732465,2732709,2734558,2734564,2734556,2734562,2734557,2734563,2734560,2734566,2734559,2734565,2734561,2734567,43015390,43015405,43015387,43015402,43015396,43015411,43015393,43015408,43015399,43015414,43015391,43015406,43015388,43015403,43015397,43015412,43015394,43015409,43015400,43015415,43015392,43015407,43015389,43015404,43015398,43015413,43015395,43015410,43015401,43015416,2730991,2731016,2730986,2731011,2731001,2731026,2730996,2731021,2731006,2731031,2730992,2731017,2730987,2731012,2731002,2731027,2730997,2731022,2731007,2731032,2730993,2731018,2730988,2731013,2731003,2731028,2730998,2731023,2731008,2731033,2730990,2731015,2730985,2731010,2731000,2731025,2730995,2731020,2731005,2731030,2730989,2731014,2730984,2731009,2730999,2731024,2730994,2731019,2731004,2731029,2727474,2727472,2727604,2727602,2727606,2727473,2727471,2727603,2727601,2727605,2736198,2736204,2736196,2736202,2736197,2736203,2736200,2736206,2736199,2736205,2736201,2736207,2726967,2726949,2727003,2726985,2727021,2726973,2726955,2727009,2726991,2727027,2726964,2726946,2727000,2726982,2727018,2726970,2726952,2727006,2726988,2727024,2726977,2726959,2727013,2726995,2727031,2726966,2726948,2727002,2726984,2727020,2726972,2726954,2727008,2726990,2727026,2726963,2726945,2726999,2726981,2727017,2726969,2726951,2727005,2726987,2727023,2726975,2726957,2727011,2726993,2727029,2726976,2726958,2727012,2726994,2727030,2726965,2726947,2727001,2726983,2727019,2726971,2726953,2727007,2726989,2727025,2726962,2726944,2726998,2726980,2727016,2726968,2726950,2727004,2726986,2727022,2726974,2726956,2727010,2726992,2727028,2727454,2727452,2727458,2727456,2727460,2727453,2727451,2727457,2727455,2727459,2734795,2734801,2734793,2734799,2734794,2734800,2734797,2734803,2734796,2734802,2734798,2734804,2002191)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 85) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 85) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1095.md b/tests/cohorts/reference_outputs/1095.md new file mode 100644 index 00000000..2e1cdb6c --- /dev/null +++ b/tests/cohorts/reference_outputs/1095.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Carotid Endarterectomy (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Carotid Endarterectomy (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1095.sql b/tests/cohorts/reference_outputs/1095.sql new file mode 100644 index 00000000..2053f32b --- /dev/null +++ b/tests/cohorts/reference_outputs/1095.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 86 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2002027,2728555,2728556,2728557,2728410,2728412,2728546,2728548,2728540,2728542,2728561,2728562,2728563,2728567,2728568,2728569,2728552,2728554,2728407,2728409,2728543,2728545,2728413,2728539,2728558,2728559,2728560,2728564,2728565,2728566,2728549,2728551,2000061)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 86) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 86) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1097.md b/tests/cohorts/reference_outputs/1097.md new file mode 100644 index 00000000..db2963c6 --- /dev/null +++ b/tests/cohorts/reference_outputs/1097.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Esophagectomy (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Esophagectomy (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1097.sql b/tests/cohorts/reference_outputs/1097.sql new file mode 100644 index 00000000..2a3e3888 --- /dev/null +++ b/tests/cohorts/reference_outputs/1097.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 88 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2002489,2002487,2002485,2002486,2748708,2748729,2748718,2748739,2748713,2748728,2748734,2748723,2748744,2748710,2748731,2748948,2748720,2748741,2748958,2748715,2748736,2748953,2748725,2748943,2748963,2748712,2748733,2748950,2748722,2748743,2748960,2748717,2748738,2748955,2748727,2748945,2748965,2748711,2748732,2748949,2748721,2748742,2748959,2748716,2748737,2748954,2748726,2748944,2748964,2748709,2748730,2748947,2748719,2748740,2748957,2748714,2748735,2748952,2748724,2748942,2748962,2002462,2746751,2746753,2746757,2746786,2746788,2746790,2746792,2746794,2002470,2002468,2002482,2002466,2002467,2002502,2002491,2002490,2002488,2002483,2002471,2002469,2002463,2753144,2753145,2753146,2753147,2002464,2752710,2752711,2752708,2752709,2752706,2752707)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 88) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 88) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1098.md b/tests/cohorts/reference_outputs/1098.md new file mode 100644 index 00000000..1ff7a753 --- /dev/null +++ b/tests/cohorts/reference_outputs/1098.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Pancreatectomy (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Pancreatectomy (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1098.sql b/tests/cohorts/reference_outputs/1098.sql new file mode 100644 index 00000000..72b56ee4 --- /dev/null +++ b/tests/cohorts/reference_outputs/1098.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 84 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2003348,2750943,2750945,2750947,43017182,2003350,2003347,2003362,2003349,2753534,2753535,2003351)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 84) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 84) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1099.md b/tests/cohorts/reference_outputs/1099.md new file mode 100644 index 00000000..29d77761 --- /dev/null +++ b/tests/cohorts/reference_outputs/1099.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Colectomy (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Colectomy (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1099.sql b/tests/cohorts/reference_outputs/1099.sql new file mode 100644 index 00000000..8881c74e --- /dev/null +++ b/tests/cohorts/reference_outputs/1099.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 83 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (43016394,2747030,2747032,2747034,2747036,2747038,43016392,43016398,43016393,2000811,2000834,2000810,2000833,2000832,2000835,2002768,2002751,2002764,2002750,2002763,2002762,2002765,2002769,2002766,2002770,2000836,2753386,2753378,2753379,2753380,2753381,43017217,2753176,2753177,2753368,2753369,2753374,2753375,2753376,2753377,43017215,2753370,2753371,2753372,2753373,2753398,2753399,2753400,2753401,43017218,2753390,2753391,2753392,2753393,43017216)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 83) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 83) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/11.md b/tests/cohorts/reference_outputs/11.md new file mode 100644 index 00000000..ee0f33be --- /dev/null +++ b/tests/cohorts/reference_outputs/11.md @@ -0,0 +1,15 @@ +### Cohort Entry Events + +People enter the cohort when observing any of the following: + +1. condition occurrences of 'Malaise or Fatigue or (Malaise and Fatigue)'. + +### Cohort Exit + +The cohort end date will be offset from index event's end date plus 14 days. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/11.sql b/tests/cohorts/reference_outputs/11.sql new file mode 100644 index 00000000..3fc17d59 --- /dev/null +++ b/tests/cohorts/reference_outputs/11.sql @@ -0,0 +1,304 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 3 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4223659,4272240,4309912)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4223659,4272240,4309912)) + +) I +LEFT JOIN +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (4158491,37396808,4219363,4221911,37205051,37205052,45772721,4225027,40484614,4092860,4090207,44782753)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (4158491,37396808,4219363,4221911,37205051,37205052,45772721,4225027,40484614,4092860,4090207,44782753)) + +) E ON I.concept_id = E.concept_id +WHERE E.concept_id is null +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 3) +) C + + +-- End Condition Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P + +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +create table #inclusion_events (inclusion_rule_id bigint, + person_id bigint, + event_id bigint +); + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{0 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),0)-1) +} +) Results + +; + +-- date offset strategy + +select event_id, person_id, + case when DATEADD(day,14,end_date) > op_end_date then op_end_date else DATEADD(day,14,end_date) end as end_date +INTO #strategy_ends +from #included_events; + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- End Date Strategy +SELECT event_id, person_id, end_date from #strategy_ends + + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 0 != 0}?{ + +CREATE TABLE #inclusion_rules (rule_sequence int); + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + +TRUNCATE TABLE #strategy_ends; +DROP TABLE #strategy_ends; + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1100.md b/tests/cohorts/reference_outputs/1100.md new file mode 100644 index 00000000..bda1a05a --- /dev/null +++ b/tests/cohorts/reference_outputs/1100.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Cystectomy (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Cystectomy (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1100.sql b/tests/cohorts/reference_outputs/1100.sql new file mode 100644 index 00000000..47255295 --- /dev/null +++ b/tests/cohorts/reference_outputs/1100.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 85 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2773930,2773932,2773934,2003806,2003803,2003805,2780485,2780486,2776775,2776776,2776777,2776778,2780477,2780478,2780479,2780480,2776783,2776972,2776973,2776974)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 85) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 85) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/cohorts/reference_outputs/1101.md b/tests/cohorts/reference_outputs/1101.md new file mode 100644 index 00000000..98576bc3 --- /dev/null +++ b/tests/cohorts/reference_outputs/1101.md @@ -0,0 +1,37 @@ +### Cohort Entry Events + +People may enter the cohort when observing any of the following: + +1. procedure occurrences of 'Nephrectomy (Bucher et al)'. + +2. procedure occurrences of any procedure (including 'Nephrectomy (Bucher et al)' source concepts). + +Limit cohort entry events to the earliest event per person. + +### Inclusion Criteria + +#### 1. Age above 18 years + +Entry events with the following event criteria: who are >= 18 years old. + +#### 2. Inpatient visit on day of surgery without ER visit immediately on or prior + +Entry events having at least 1 visit occurrence of 'Inpatient visit', starting between 1 days before and 0 days before cohort entry start date and ending 1 days after cohort entry start date; having no visit occurrences of 'Emergency or ER / Inpatient', starting between 2 days before and 0 days after 'Inpatient visit' start date. + +#### 3. Atrial fibrillation (any) within 14d of surgery + +Entry events having at least 1 condition occurrence of 'Atrial Fibrillation (any)', starting between 0 days after and 14 days after cohort entry start date. + +#### 4. No prior atrial fibrillation + +Entry events having no condition occurrences of 'Atrial Fibrillation (any)', starting anytime prior to cohort entry start date. + +### Cohort Exit + +The person exits the cohort at the end of continuous observation. + +### Cohort Eras + +Remaining events will be combined into cohort eras if they are within 0 days of each other. + + diff --git a/tests/cohorts/reference_outputs/1101.sql b/tests/cohorts/reference_outputs/1101.sql new file mode 100644 index 00000000..0aa54fb5 --- /dev/null +++ b/tests/cohorts/reference_outputs/1101.sql @@ -0,0 +1,620 @@ +CREATE TABLE #Codesets ( + codeset_id int NOT NULL, + concept_id bigint NOT NULL +) +; + +INSERT INTO #Codesets (codeset_id, concept_id) +SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (9201)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (9201)) + +) I +) C UNION ALL +SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (262,9203)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (262,9203)) + +) I +) C UNION ALL +SELECT 81 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (313217)) +UNION select c.concept_id + from @vocabulary_database_schema.CONCEPT c + join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id + WHERE c.invalid_reason is null + and (ca.ancestor_concept_id in (313217)) + +) I +) C UNION ALL +SELECT 84 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM +( + select concept_id from @vocabulary_database_schema.CONCEPT where (concept_id in (2003623,2773711,2773713,2773715,2773717,2773719,2773691,2773693,2773695,2773697,2773699,2773701,2773703,2773705,2773707,2773709,2773681,2773683,2773685,2773687,2773689,2003611,2003610,2003608,2003622,2776763,2776764,2776765,2776766,2776755,2776756,2776759,2776760,2776761,2776762,2776753,2776754)) + +) I +) C; + +UPDATE STATISTICS #Codesets; + + +SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id +INTO #qualified_events +FROM +( + select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id + FROM (-- Begin Primary Events +select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id +FROM +( + select E.person_id, E.start_date, E.end_date, + row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC, E.event_id) ordinal, + OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id + FROM + ( + -- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cs on (po.procedure_concept_id = cs.concept_id and cs.codeset_id = 84) +) C + + +-- End Procedure Occurrence Criteria + +UNION ALL +-- Begin Procedure Occurrence Criteria +select C.person_id, C.procedure_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select po.person_id,po.procedure_occurrence_id,po.procedure_concept_id,po.visit_occurrence_id,po.quantity,po.procedure_date as start_date, DATEADD(day,1,po.procedure_date) as end_date + FROM @cdm_database_schema.PROCEDURE_OCCURRENCE po +JOIN #Codesets cns on (po.procedure_source_concept_id = cns.concept_id and cns.codeset_id = 84) +) C + + +-- End Procedure Occurrence Criteria + + ) E + JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date + WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE +) P +WHERE P.ordinal = 1 +-- End Primary Events +) pe + +) QE + +; + +--- Inclusion Rule Inserts + +select 0 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_0 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Demographic Criteria +SELECT 0 as index_id, e.person_id, e.event_id +FROM #qualified_events E +JOIN @cdm_database_schema.PERSON P ON P.PERSON_ID = E.PERSON_ID +WHERE YEAR(E.start_date) - P.year_of_birth >= 18 +GROUP BY e.person_id, e.event_id +-- End Demographic Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 1 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_1 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + select PE.person_id, PE.event_id, PE.start_date, PE.end_date, PE.visit_occurrence_id, PE.sort_date FROM ( +-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria + +) PE +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM (SELECT Q.person_id, Q.event_id, Q.start_date, Q.end_date, Q.visit_occurrence_id, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date +FROM (-- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 0) +) C + + +-- End Visit Occurrence Criteria +) Q +JOIN @cdm_database_schema.OBSERVATION_PERIOD OP on Q.person_id = OP.person_id + and OP.observation_period_start_date <= Q.start_date and OP.observation_period_end_date >= Q.start_date +) P +JOIN ( + -- Begin Visit Occurrence Criteria +select C.person_id, C.visit_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +from +( + select vo.person_id,vo.visit_occurrence_id,vo.visit_concept_id,vo.visit_start_date as start_date, vo.visit_end_date as end_date + FROM @cdm_database_schema.VISIT_OCCURRENCE vo +JOIN #Codesets cs on (vo.visit_concept_id = cs.concept_id and cs.codeset_id = 43) +) C + + +-- End Visit Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-2,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id and AC.event_id = pe.event_id + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-1,P.START_DATE) AND A.START_DATE <= DATEADD(day,0,P.START_DATE) AND A.END_DATE >= DATEADD(day,1,P.START_DATE) AND A.END_DATE <= P.OP_END_DATE ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 2 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_2 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, cc.person_id, cc.event_id +from (SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,0,P.START_DATE) AND A.START_DATE <= DATEADD(day,14,P.START_DATE) ) cc +GROUP BY cc.person_id, cc.event_id +HAVING COUNT(cc.event_id) >= 1 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +select 3 as inclusion_rule_id, person_id, event_id +INTO #Inclusion_3 +FROM +( + select pe.person_id, pe.event_id + FROM #qualified_events pe + +JOIN ( +-- Begin Criteria Group +select 0 as index_id, person_id, event_id +FROM +( + select E.person_id, E.event_id + FROM #qualified_events E + INNER JOIN + ( + -- Begin Correlated Criteria +select 0 as index_id, p.person_id, p.event_id +from #qualified_events p +LEFT JOIN ( +SELECT p.person_id, p.event_id +FROM #qualified_events P +JOIN ( + -- Begin Condition Occurrence Criteria +SELECT C.person_id, C.condition_occurrence_id as event_id, C.start_date, C.end_date, + C.visit_occurrence_id, C.start_date as sort_date +FROM +( + SELECT co.person_id,co.condition_occurrence_id,co.condition_concept_id,co.visit_occurrence_id,co.condition_start_date as start_date, COALESCE(co.condition_end_date, DATEADD(day,1,co.condition_start_date)) as end_date + FROM @cdm_database_schema.CONDITION_OCCURRENCE co + JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 81) +) C + + +-- End Condition Occurrence Criteria + +) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id +GROUP BY p.person_id, p.event_id +HAVING COUNT(cc.event_id) = 0 +-- End Correlated Criteria + + ) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id + GROUP BY E.person_id, E.event_id + HAVING COUNT(index_id) = 1 +) G +-- End Criteria Group +) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id +) Results +; + +SELECT inclusion_rule_id, person_id, event_id +INTO #inclusion_events +FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_1 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_2 +UNION ALL +select inclusion_rule_id, person_id, event_id from #Inclusion_3) I; +TRUNCATE TABLE #Inclusion_0; +DROP TABLE #Inclusion_0; + +TRUNCATE TABLE #Inclusion_1; +DROP TABLE #Inclusion_1; + +TRUNCATE TABLE #Inclusion_2; +DROP TABLE #Inclusion_2; + +TRUNCATE TABLE #Inclusion_3; +DROP TABLE #Inclusion_3; + + +select event_id, person_id, start_date, end_date, op_start_date, op_end_date +into #included_events +FROM ( + SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal + from + ( + select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id + GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date + ) MG -- matching groups +{4 != 0}?{ + -- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask + WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),4)-1) +} +) Results +WHERE Results.ordinal = 1 +; + + + +-- generate cohort periods into #final_cohort +select person_id, start_date, end_date +INTO #cohort_rows +from ( -- first_ends + select F.person_id, F.start_date, F.end_date + FROM ( + select I.event_id, I.person_id, I.start_date, CE.end_date, row_number() over (partition by I.person_id, I.event_id order by CE.end_date) as ordinal + from #included_events I + join ( -- cohort_ends +-- cohort exit dates +-- By default, cohort exit at the event's op end date +select event_id, person_id, op_end_date as end_date from #included_events + ) CE on I.event_id = CE.event_id and I.person_id = CE.person_id and CE.end_date >= I.start_date + ) F + WHERE F.ordinal = 1 +) FE; + + +select person_id, min(start_date) as start_date, DATEADD(day,-1 * 0, max(end_date)) as end_date +into #final_cohort +from ( + select person_id, start_date, end_date, sum(is_start) over (partition by person_id order by start_date, is_start desc rows unbounded preceding) group_idx + from ( + select person_id, start_date, end_date, + case when max(end_date) over (partition by person_id order by start_date rows between unbounded preceding and 1 preceding) >= start_date then 0 else 1 end is_start + from ( + select person_id, start_date, DATEADD(day,0,end_date) as end_date + from #cohort_rows + ) CR + ) ST +) GR +group by person_id, group_idx; + +DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; +INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) +select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date +FROM #final_cohort CO +; + +{1 != 0}?{ +-- BEGIN: Censored Stats + +delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id; + +-- END: Censored Stats +} +{1 != 0 & 4 != 0}?{ + +-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis + +select cast(rule_sequence as int) as rule_sequence +into #inclusion_rules +from ( + SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence UNION ALL SELECT CAST(2 as int) as rule_sequence UNION ALL SELECT CAST(3 as int) as rule_sequence +) IR; + + +-- Find the event that is the 'best match' per person. +-- the 'best match' is defined as the event that satisfies the most inclusion rules. +-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest. + +select q.person_id, q.event_id +into #best_events +from #qualified_events Q +join ( + SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value + FROM ( + SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date + FROM #qualified_events Q + LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id, Q.start_date + ) R +) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id +WHERE ranked.rank_value = 1 +; + +-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column) +-- 0: all events +-- 1: best event + + +-- BEGIN: Inclusion Impact Analysis - event +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #qualified_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #qualified_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id +FROM +(select count_big(event_id) as total from #qualified_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - event + +-- BEGIN: Inclusion Impact Analysis - person +-- calculte matching group counts +delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id) +select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id +from +( + select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask + from #best_events Q + LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id + GROUP BY Q.person_id, Q.event_id +) MG -- matching groups +group by inclusion_rule_mask +; + +-- calculate gain counts +delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id) +select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id +from #inclusion_rules ir +left join +( + select i.inclusion_rule_id, count_big(i.event_id) as person_count + from #best_events Q + JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id + group by i.inclusion_rule_id +) T on ir.rule_sequence = T.inclusion_rule_id +CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal +CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal +LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule' +; + +-- calculate totals +delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1; +insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id) +select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id +FROM +(select count_big(event_id) as total from #best_events) PC, +(select sum(sr.person_count) as total + from @results_database_schema.cohort_inclusion_result sr + CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal + where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1 +) FC +; + +-- END: Inclusion Impact Analysis - person + +TRUNCATE TABLE #best_events; +DROP TABLE #best_events; + +TRUNCATE TABLE #inclusion_rules; +DROP TABLE #inclusion_rules; +} + + + +TRUNCATE TABLE #cohort_rows; +DROP TABLE #cohort_rows; + +TRUNCATE TABLE #final_cohort; +DROP TABLE #final_cohort; + +TRUNCATE TABLE #inclusion_events; +DROP TABLE #inclusion_events; + +TRUNCATE TABLE #qualified_events; +DROP TABLE #qualified_events; + +TRUNCATE TABLE #included_events; +DROP TABLE #included_events; + +TRUNCATE TABLE #Codesets; +DROP TABLE #Codesets; + diff --git a/tests/eunomia.duckdb b/tests/eunomia.duckdb new file mode 100644 index 00000000..85a96e87 Binary files /dev/null and b/tests/eunomia.duckdb differ