diff --git a/.Rbuildignore b/.Rbuildignore
index 095d8991..5c3fc844 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -1,11 +1,12 @@
^.*\.Rproj$
^\.Rproj\.user$
-^\.github$
-^LICENSE$
-_pkgdown.yml/*
-compare_versions
+extras
+^\.git
+man-roxygen
+_pkgdown.yml
deploy.sh
-docs/*
-extras/*
-^doc$
-^Meta$
+compare_versions
+.github
+docs
+^LICENSE$
+^inst/doc/.*\.pdf$
\ No newline at end of file
diff --git a/DESCRIPTION b/DESCRIPTION
index 42ffb66f..aee1eb0f 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Package: DataQualityDashboard
Type: Package
Title: Execute and View Data Quality Checks on OMOP CDM Database
-Version: 2.3.0
-Date: 2023-05-21
+Version: 2.4.0
+Date: 2023-07-26
Authors@R: c(
person("Katy", "Sadowski", email = "sadowski@ohdsi.org", role = c("aut", "cre")),
person("Clair", "Blacketer", role = c("aut")),
@@ -15,7 +15,9 @@ Authors@R: c(
Maintainer: Katy Sadowski
Description: An R package for assessing data quality in standardized OMOP Common Data Model data sources.
License: Apache License (>= 2)
+Config/build/clean-inst-doc: FALSE
VignetteBuilder: knitr
+Config/testthat/edition: 3
URL: https://github.com/OHDSI/DataQualityDashboard
BugReports: https://github.com/OHDSI/DataQualityDashboard/issues
Depends:
diff --git a/DataQualityDashboard.Rproj b/DataQualityDashboard.Rproj
index 1788e686..5a4617f3 100644
--- a/DataQualityDashboard.Rproj
+++ b/DataQualityDashboard.Rproj
@@ -13,6 +13,5 @@ RnwWeave: Sweave
LaTeX: pdfLaTeX
BuildType: Package
-PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
-PackageRoxygenize: rd,collate,namespace,vignette
+PackageRoxygenize: rd,collate,namespace
diff --git a/NEWS.md b/NEWS.md
index 05d569ec..62533c1f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,23 @@
+DataQualityDashboard 2.4.0
+==========================
+This release includes:
+
+### Threshold file updates
+**The following changes involve updates to the default data quality check threshold files. If you are currently using an older version of DQD and update to v2.4.0, you may see changes in your DQD results. The failure threshold changes are fixes to incorrect thresholds in the v5.4 files and thus should result in more accurate, easier to interpret results. The unit concept ID changes ensure that long-invalid concepts will no longer be accepted as plausible measurement units.**
+
+- The incorrect failure thresholds for `measurePersonCompleteness` and `measureValueCompleteness` were fixed in the v5.4 table & field level threshold files. This issue has existed since v5.4 support was initially added in March 2022
+ - Many `measurePersonCompleteness` checks had a threshold of 0 when it should have been 95 or 100
+ - Many `measureValueCompleteness` checks had a threshold of 100 when it should have been 0, and many had no threshold (defaulting to 0) when it should have been 100
+ - The thresholds have now been updated to match expectations for required/non-required tables/fields
+- In the v5.2, v5.3, and v5.4 table level threshold files, `measurePersonCompleteness` for the DEATH table has been toggled to `Yes`, with a threshold of 100
+- In the v5.2, v5.3, and v5.4 concept level threshold files, all references to unit concept 9117 in `plausibleUnitConceptIds` have been updated to 720870. Concept 9117 became non-standard and was replaced with concept 720870, on 28-Mar-2022
+- In the v5.2, v5.3, and v5.4 concept level threshold files, all references to unit concepts 9258 and 9259 in `plausibleUnitConceptIds` have been removed. These concepts were deprecated on 05-May-2022
+
+### Bugfix
+- Call to new function `convertJsonResultsFileCase` in Shiny app was appended with `DataQualityDashboard::`. This prevents potential issues related to package loading and function naming conflicts
+
+Some minor refactoring of testthat files and package build configuration and some minor documentation updates were also added in this release.
+
DataQualityDashboard 2.3.0
==========================
This release includes:
@@ -78,6 +98,10 @@ This release includes:
- The `outputFolder` parameter for the `executeDqChecks` function is now REQUIRED and no longer has a default value. **This may be a breaking change for users who have not specified this parameter in their script to run DQD.**
+### Removal of measurement plausibility checks
+
+ - Most plausibleValueLow and plausibleValueHigh measurement values were removed from the concept check threshold files, due to feedback from the community that many of these ranges included plausible values and as such were causing unexpected check failures. An initiative is planned to reinterrogate these ranges and add them back once the team has higher confidence that they will only flag legitimately implausible values
+
### Integrated testing was also added and the package was refactored on the backend
DataQualityDashboard 1.4.1
diff --git a/R/convertResultsCase.R b/R/convertResultsCase.R
index b6d4f357..0668b211 100644
--- a/R/convertResultsCase.R
+++ b/R/convertResultsCase.R
@@ -15,7 +15,7 @@
# limitations under the License.
#' @title Convert JSON results file case
-#'
+#'
#' @description Convert a DQD JSON results file between camelcase and (all-caps) snakecase. Enables viewing of pre-v.2.1.0 results files in later DQD versions, and vice versa
#'
#' @param jsonFilePath Path to the JSON results file to be converted
diff --git a/R/evaluateThresholds.R b/R/evaluateThresholds.R
index ff395e75..55b57891 100644
--- a/R/evaluateThresholds.R
+++ b/R/evaluateThresholds.R
@@ -195,7 +195,7 @@
dplyr::filter(checkResults, .data$checkName == "measureValueCompleteness" &
.data$numDenominatorRows == .data$numViolatedRows &
is.na(.data$tableIsMissing) & is.na(.data$fieldIsMissing) & is.na(.data$tableIsEmpty)),
- .data$cdmTableName, .data$cdmFieldName
+ "cdmTableName", "cdmFieldName"
)
if (nrow(emptyFields) > 0) {
emptyFields$fieldIsEmpty <- 1
diff --git a/README.md b/README.md
index fdd1d407..dc3c21e8 100644
--- a/README.md
+++ b/README.md
@@ -88,6 +88,16 @@ User Documentation
==================
Documentation can be found on the [package website](https://ohdsi.github.io/DataQualityDashboard/index.html).
+PDF versions of the documentation are also available:
+
+* Vignette: [Add a New Data Quality Check](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/AddNewCheck.pdf)
+* Vignette: [Check Status Descriptions](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/CheckStatusDefinitions.pdf)
+* Vignette: [Data Quality Check Type Descriptions](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/CheckTypeDescriptions.pdf)
+* Vignette: [Running the DQD on a Cohort](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/DqdForCohorts.pdf)
+* Vignette: [Failure Thresholds and How to Change Them](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/Thresholds.pdf)
+* Vignette: [SqlOnly Mode](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/SqlOnly.pdf)
+* Package manual: [DataQualityDashboard manual](https://github.com/OHDSI/DataQualityDashboard/raw/main/inst/doc/DataQualityDashboard.pdf)
+
Support
=======
diff --git a/docs/404.html b/docs/404.html
index 7188b296..08b81bfe 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -32,7 +32,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html
index 8a7fd530..e17e3b8a 100644
--- a/docs/LICENSE-text.html
+++ b/docs/LICENSE-text.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/articles/AddNewCheck.html b/docs/articles/AddNewCheck.html
index 5769a243..0deb430c 100644
--- a/docs/articles/AddNewCheck.html
+++ b/docs/articles/AddNewCheck.html
@@ -33,7 +33,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -108,7 +108,7 @@
Add a New Data Quality Check
Don Torok
- 2023-05-21
+ 2023-07-26
Source: vignettes/AddNewCheck.rmd
AddNewCheck.rmd
@@ -184,15 +184,15 @@
-
@@ -109,7 +109,7 @@ Data Quality Check Type Definitions
Clair
Blacketer
- 2023-05-21
+ 2023-07-26
Source: vignettes/CheckTypeDescriptions.rmd
CheckTypeDescriptions.rmd
diff --git a/docs/articles/DataQualityDashboard.html b/docs/articles/DataQualityDashboard.html
index 48f7a11b..9fed8026 100644
--- a/docs/articles/DataQualityDashboard.html
+++ b/docs/articles/DataQualityDashboard.html
@@ -33,7 +33,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -109,7 +109,7 @@ Getting Started
Clair
Blacketer
- 2023-05-21
+ 2023-07-26
Source: vignettes/DataQualityDashboard.rmd
DataQualityDashboard.rmd
diff --git a/docs/articles/DqdForCohorts.html b/docs/articles/DqdForCohorts.html
index beb2486f..af81a451 100644
--- a/docs/articles/DqdForCohorts.html
+++ b/docs/articles/DqdForCohorts.html
@@ -33,7 +33,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -109,7 +109,7 @@ Running the DQD on a Cohort
Clair
Blacketer
- 2023-05-21
+ 2023-07-26
Source: vignettes/DqdForCohorts.rmd
DqdForCohorts.rmd
diff --git a/docs/articles/SqlOnly.html b/docs/articles/SqlOnly.html
index 1a3c3721..999ee7db 100644
--- a/docs/articles/SqlOnly.html
+++ b/docs/articles/SqlOnly.html
@@ -33,7 +33,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -109,7 +109,7 @@ SqlOnly
Maxim
Moinat
- 2023-05-21
+ 2023-07-26
Source: vignettes/SqlOnly.rmd
SqlOnly.rmd
@@ -126,7 +126,7 @@ 2023-05-21
Description
This article describes how to use DQD to generate only the SQL that
-executes all DataQualityDashoard checks, without actually executing
+executes all DataQualityDashboard checks, without actually executing
them. There are a few main advantages of running DQD in Sql-only
mode:
diff --git a/docs/articles/Thresholds.html b/docs/articles/Thresholds.html
index 1e7693a1..d8327119 100644
--- a/docs/articles/Thresholds.html
+++ b/docs/articles/Thresholds.html
@@ -33,7 +33,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -109,7 +109,7 @@ Failure Thresholds and How to Change Them
Clair
Blacketer
- 2023-05-21
+ 2023-07-26
Source: vignettes/Thresholds.rmd
Thresholds.rmd
@@ -183,8 +183,8 @@ Step 1: Find and copy the contro
a location the R instance can access. An example of this file is seen in
figure 1 below.
-
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 4a799f32..13de8fdd 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/authors.html b/docs/authors.html
index d98f6bef..06995b97 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/index.html b/docs/index.html
index 2dd5cdbf..1f06facc 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -33,7 +33,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -240,6 +240,23 @@
Documentation can be found on the package website.
+PDF versions of the documentation are also available:
+
Support
diff --git a/docs/news/index.html b/docs/news/index.html
index aa51707f..4221e1c5 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
@@ -84,13 +84,34 @@ Changelog
Source: NEWS.md
+
+
+
This release includes:
+
+
Threshold file updates
+
The following changes involve updates to the default data quality check threshold files. If you are currently using an older version of DQD and update to v2.4.0, you may see changes in your DQD results. The failure threshold changes are fixes to incorrect thresholds in the v5.4 files and thus should result in more accurate, easier to interpret results. The unit concept ID changes ensure that long-invalid concepts will no longer be accepted as plausible measurement units.
+
- The incorrect failure thresholds for
measurePersonCompleteness
and measureValueCompleteness
were fixed in the v5.4 table & field level threshold files. This issue has existed since v5.4 support was initially added in March 2022
+- Many
measurePersonCompleteness
checks had a threshold of 0 when it should have been 95 or 100
+- Many
measureValueCompleteness
checks had a threshold of 100 when it should have been 0, and many had no threshold (defaulting to 0) when it should have been 100
+- The thresholds have now been updated to match expectations for required/non-required tables/fields
+
+- In the v5.2, v5.3, and v5.4 table level threshold files,
measurePersonCompleteness
for the DEATH table has been toggled to Yes
, with a threshold of 100
+- In the v5.2, v5.3, and v5.4 concept level threshold files, all references to unit concept 9117 in
plausibleUnitConceptIds
have been updated to 720870. Concept 9117 became non-standard and was replaced with concept 720870, on 28-Mar-2022
+- In the v5.2, v5.3, and v5.4 concept level threshold files, all references to unit concepts 9258 and 9259 in
plausibleUnitConceptIds
have been removed. These concepts were deprecated on 05-May-2022
+
+
+
Bugfix
+
- Call to new function
convertJsonResultsFileCase
in Shiny app was appended with DataQualityDashboard::
. This prevents potential issues related to package loading and function naming conflicts
+
Some minor refactoring of testthat files and package build configuration and some minor documentation updates were also added in this release.
+
+
This release includes:
New features
-
-New SQL-only Mode: Setting
sqlOnly
and sqlOnlyIncrementalInsert
to TRUE in executeDqChecks
will return (but not run) a set of SQL queries that, when executed, will calculate the results of the DQ checks and insert them into a database table. Additionally, sqlOnlyUnionCount
can be used to specify a number of SQL queries to union for each check type, allowing for parallel execution of these queries and potentially large performance gains. See the SqlOnly vignette for details
+New SQL-only Mode: Setting sqlOnly
and sqlOnlyIncrementalInsert
to TRUE in executeDqChecks
will return (but not run) a set of SQL queries that, when executed, will calculate the results of the DQ checks and insert them into a database table. Additionally, sqlOnlyUnionCount
can be used to specify a number of SQL queries to union for each check type, allowing for parallel execution of these queries and potentially large performance gains. See the SqlOnly vignette for details
-
Results File Case Converter: The new function
convertJsonResultsFileCase
can be used to convert the keys in a DQD results JSON file between snakecase and camelcase. This allows reading of v2.1.0+ JSON files in older DQD versions, and other conversions which may be necessary for secondary use of the DQD results file. See function documentation for details
@@ -170,6 +191,10 @@
+
Removal of measurement plausibility checks
+
- Most plausibleValueLow and plausibleValueHigh measurement values were removed from the concept check threshold files, due to feedback from the community that many of these ranges included plausible values and as such were causing unexpected check failures. An initiative is planned to reinterrogate these ranges and add them back once the team has higher confidence that they will only flag legitimately implausible values
+
+
Integrated testing was also added and the package was refactored on the backend
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 7982666c..f8935271 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -1,4 +1,4 @@
-pandoc: 2.19.2
+pandoc: 3.1.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles:
@@ -9,5 +9,5 @@ articles:
DqdForCohorts: DqdForCohorts.html
SqlOnly: SqlOnly.html
Thresholds: Thresholds.html
-last_built: 2023-05-21T18:40Z
+last_built: 2023-07-26T22:27Z
diff --git a/docs/pull_request_template.html b/docs/pull_request_template.html
index 73f4a6b2..3b09607c 100644
--- a/docs/pull_request_template.html
+++ b/docs/pull_request_template.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/convertJsonResultsFileCase.html b/docs/reference/convertJsonResultsFileCase.html
index 9cd0e651..f500b713 100644
--- a/docs/reference/convertJsonResultsFileCase.html
+++ b/docs/reference/convertJsonResultsFileCase.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-evaluateThresholds.html b/docs/reference/dot-evaluateThresholds.html
index f2b5a00b..a2a4a2aa 100644
--- a/docs/reference/dot-evaluateThresholds.html
+++ b/docs/reference/dot-evaluateThresholds.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-getCheckId.html b/docs/reference/dot-getCheckId.html
index 062d8cc0..05ebe3d2 100644
--- a/docs/reference/dot-getCheckId.html
+++ b/docs/reference/dot-getCheckId.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-processCheck.html b/docs/reference/dot-processCheck.html
index 10fcaa63..1512a950 100644
--- a/docs/reference/dot-processCheck.html
+++ b/docs/reference/dot-processCheck.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-recordResult.html b/docs/reference/dot-recordResult.html
index ca5dd5c1..05f65915 100644
--- a/docs/reference/dot-recordResult.html
+++ b/docs/reference/dot-recordResult.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-runCheck.html b/docs/reference/dot-runCheck.html
index 9f3d02cc..a0fe4284 100644
--- a/docs/reference/dot-runCheck.html
+++ b/docs/reference/dot-runCheck.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-summarizeResults.html b/docs/reference/dot-summarizeResults.html
index 1cb3b6a9..c446b8a6 100644
--- a/docs/reference/dot-summarizeResults.html
+++ b/docs/reference/dot-summarizeResults.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-writeResultsToCsv.html b/docs/reference/dot-writeResultsToCsv.html
index 7ea3836b..f7eb0746 100644
--- a/docs/reference/dot-writeResultsToCsv.html
+++ b/docs/reference/dot-writeResultsToCsv.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-writeResultsToJson.html b/docs/reference/dot-writeResultsToJson.html
index a0f1bd76..7f72e2ce 100644
--- a/docs/reference/dot-writeResultsToJson.html
+++ b/docs/reference/dot-writeResultsToJson.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/dot-writeResultsToTable.html b/docs/reference/dot-writeResultsToTable.html
index 1944a661..e9b772dc 100644
--- a/docs/reference/dot-writeResultsToTable.html
+++ b/docs/reference/dot-writeResultsToTable.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/executeDqChecks.html b/docs/reference/executeDqChecks.html
index d06ea101..b0aa1a39 100644
--- a/docs/reference/executeDqChecks.html
+++ b/docs/reference/executeDqChecks.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/index.html b/docs/reference/index.html
index f8d63ac3..0c6d792b 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/listDqChecks.html b/docs/reference/listDqChecks.html
index 9aa42f06..fa949f69 100644
--- a/docs/reference/listDqChecks.html
+++ b/docs/reference/listDqChecks.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/reEvaluateThresholds.html b/docs/reference/reEvaluateThresholds.html
index b15a7fcb..c23b381b 100644
--- a/docs/reference/reEvaluateThresholds.html
+++ b/docs/reference/reEvaluateThresholds.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/viewDqDashboard.html b/docs/reference/viewDqDashboard.html
index 7ee8d4be..b8e38e32 100644
--- a/docs/reference/viewDqDashboard.html
+++ b/docs/reference/viewDqDashboard.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/writeJsonResultsToCsv.html b/docs/reference/writeJsonResultsToCsv.html
index cea6f937..904f171f 100644
--- a/docs/reference/writeJsonResultsToCsv.html
+++ b/docs/reference/writeJsonResultsToCsv.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/docs/reference/writeJsonResultsToTable.html b/docs/reference/writeJsonResultsToTable.html
index 55e340e7..8f1cff77 100644
--- a/docs/reference/writeJsonResultsToTable.html
+++ b/docs/reference/writeJsonResultsToTable.html
@@ -17,7 +17,7 @@
DataQualityDashboard
- 2.3.0
+ 2.4.0
diff --git a/extras/DataQualityDashboard.pdf b/extras/DataQualityDashboard.pdf
index 34e136a4..71a5842d 100644
Binary files a/extras/DataQualityDashboard.pdf and b/extras/DataQualityDashboard.pdf differ
diff --git a/extras/PackageMaintenance.R b/extras/PackageMaintenance.R
index 547a0555..88af7e66 100644
--- a/extras/PackageMaintenance.R
+++ b/extras/PackageMaintenance.R
@@ -70,6 +70,12 @@ rmarkdown::render("vignettes/Thresholds.Rmd",
number_sections = TRUE))
unlink("inst/doc/Thresholds.tex")
+rmarkdown::render("vignettes/SqlOnly.Rmd",
+ output_file = "../inst/doc/SqlOnly.pdf",
+ rmarkdown::pdf_document(latex_engine = "pdflatex",
+ toc = TRUE,
+ number_sections = TRUE))
+unlink("inst/doc/SqlOnly.tex")
pkgdown::build_site()
OhdsiRTools::fixHadesLogo()
diff --git a/inst/csv/OMOP_CDMv5.2_Concept_Level.csv b/inst/csv/OMOP_CDMv5.2_Concept_Level.csv
index 405fa404..c1706046 100644
--- a/inst/csv/OMOP_CDMv5.2_Concept_Level.csv
+++ b/inst/csv/OMOP_CDMv5.2_Concept_Level.csv
@@ -462,7 +462,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3047107,Calcium [Mass/volume] corrected for a
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050166,Trypsinogen I Free [Mass/volume] in DBS,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493466,Plesiomonas shigelloides DNA [Presence] in Stool by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493469,Vibrio cholerae DNA [Presence] in Stool by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,36306178,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,36306178,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760892,CBC W Ordered Manual Differential panel - Blood,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764568,How often did your fatigue make it difficult to organize your thoughts when doing things at work (include work at home) in past 7 days [PROMIS],,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40767693,Vaccine funding program eligibility category,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -843,7 +843,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050920,Urate [Mass/volume] in Body fluid,,,,
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051923,Hemoglobin disorders newborn screen interpretation,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493338,Parainfluenza virus 2 RNA [Presence] in Nasopharynx by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,36203231,Streptococcus pneumoniae Danish serotype 12F IgG Ab [Mass/volume] in Serum,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,36303797,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,36303797,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760007,HIV 1+2 Ab+HIV1 p24 Ag [Presence] in Serum or Plasma by Immunoassay,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3000571,Amphetamine [Mass/volume] in Urine,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3001137,Triple phosphate crystals [Presence] in Urine sediment by Light microscopy,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1114,7 +1114,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3026796,Spermatozoa [Presence] in Urine sedim
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027475,Erythrocytes [#/volume] in Cerebral spinal fluid,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027694,Calcium.ionized [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3028193,Bilirubin.total [Mass/volume] in Body fluid,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030354,Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum or Plasma by Creatinine-based formula (MDRD),,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030354,Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum or Plasma by Creatinine-based formula (MDRD),,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030612,Hemoglobin S/Hemoglobin.total in Blood by Electrophoresis,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030687,Bacterial susceptibility panel by Minimum inhibitory concentration (MIC),,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3032084,Eosinophils [#/volume] in Body fluid,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1160,7 +1160,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3041642,Human coronavirus 229E RNA [Presence]
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3044938,Influenza virus A RNA [Presence] in Specimen by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3045262,"Creatinine and Glomerular filtration rate.predicted panel - Serum, Plasma or Blood",,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3047117,Bordetella pertussis DNA [Presence] in Nasopharynx by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3049187,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3049187,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050099,BK virus DNA [#/volume] (viral load) in Specimen by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051205,Crystals [#/area] in Urine sediment by Microscopy high power field,,,,,,,,,,,,,,,,,,,,,8786,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051596,Benzodiazepines [Presence] in Serum or Plasma by Screen method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1177,7 +1177,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3001612,Ticarcillin+Clavulanate [Susceptibili
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3002030,Lymphocytes/100 leukocytes in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3003311,Nucleated erythrocytes/100 leukocytes [Ratio] in Blood by Manual count,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005044,Rubella virus IgG Ab [Interpretation] in Serum,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005424,Body surface area,,,,,,,,,,,,,,,,,,,,,"8617,9258,9259,9284,9401,9403,9404,9406,9408,9411,9417,9453,9456,9483,9572",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005424,Body surface area,,,,,,,,,,,,,,,,,,,,,"8617,9284,9401,9403,9404,9406,9408,9411,9417,9453,9456,9483,9572",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3006906,Calcium [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3006957,Toxoplasma gondii IgG Ab [Units/volume] in Serum or Plasma by Immunoassay,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3007435,Base excess in Venous cord blood by calculation,,,,,,,,,,,,,,,,,,,,,"8729,8736,8745,8749,8753,8839,8843,8875,9440,9490,9491,9501,9553,9557,9559,9575,9586,9587,9588,9591,9608,9621,9631,9632,9654,9673,45891014",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1532,7 +1532,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027315,Oxygen [Partial pressure] in Blood,,,
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027572,Xanthochromia [Presence] of Cerebral spinal fluid Qualitative,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027944,Amphetamines [Presence] in Urine,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027953,Aldolase [Enzymatic activity/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8645,8645,8719,8719,8750,8750,8763,8763,8810,8810,8860,8860,8923,8923,8924,8924,8985,8985,9040,9040,9058,9058,9093,9093,9332,9332,9525,9525,9550,9550,44777568,44777568,44777578,44777578,44777583,44777583",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3029859,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Cystatin-based formula",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3029859,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Cystatin-based formula",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3032459,Ketones [Mass/volume] in Urine,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3033281,Carbapenem resistance blaKPC gene [Presence] by Molecular method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3035740,Bacteria identified in Throat by Aerobe culture,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1637,7 +1637,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760857,Erythrocytes [#/volume] in Urine by
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760861,Hemoglobin [Presence] in Urine by Automated test strip,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40763912,Albumin [Mass/volume] in Serum or Plasma by Bromocresol green (BCG) dye binding method,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764997,Pyridoxal phosphate [Moles/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8729,8736,8745,8749,8753,8839,8843,8875,9440,9490,9491,9501,9553,9557,9559,9575,9586,9587,9588,9591,9608,9621,9631,9632,9654,9673,45891014",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764999,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764999,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40765636,PhenX - pain protocol 170401,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42868460,FEF 25-75% Predicted,,,,,,,,,,,,,,,,,,,,,"8698,8795,8857,8930,32700,44777523,44777603,44777613,44777614,44777664",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,757685,SARS-CoV+SARS-CoV-2 (COVID-19) Ag [Presence] in Respiratory specimen by Rapid immunoassay,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -2261,14 +2261,14 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3044649,Blood type and Indirect antibody scre
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3045646,Triple phosphate crystals [#/area] in Urine sediment by Microscopy high power field,,,,,,,,,,,,,,,,,,,,,8786,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3048230,Gestational age in weeks,,,,,,,,,,,,,,,,,,,,,"8505,8511,8512,8550,8555,9399,9448,9449,9450,9451,9537,9580,9581,9582,9583,9592,9593,9616,9634,9676,32960,32961,44777661",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050675,Wet mount panel - Vaginal fluid,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3053283,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3053283,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40757378,Drug screen comment [Interpretation] in Urine,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40761484,Norfentanyl [Mass/volume] in Urine by Confirmatory method,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40771527,Human papilloma virus E6+E7 mRNA [Presence] in Cervix by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42868623,Benzodiazepines [Presence] in Urine by Screen method >200 ng/mL,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42869588,Hematocrit [Pure volume fraction] of Blood by Automated count,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42870589,Drugs of abuse panel - Urine by Screen method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,46236952,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,46236952,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3018010,Neutrophils/100 leukocytes in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3018738,Hemoglobin F/Hemoglobin.total in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3020460,C reactive protein [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
diff --git a/inst/csv/OMOP_CDMv5.2_Field_Level.csv b/inst/csv/OMOP_CDMv5.2_Field_Level.csv
index 11beaf5d..d9c978a5 100644
--- a/inst/csv/OMOP_CDMv5.2_Field_Level.csv
+++ b/inst/csv/OMOP_CDMv5.2_Field_Level.csv
@@ -298,7 +298,7 @@ CONDITION_ERA,CDM,condition_occurrence_count,No,,,integer,0,,,,No,,,No,,,,,,,,,,
DEATH,cdm,cause_concept_id,No,,,integer,0,,"This is the Standard Concept representing the Person's cause of death, if available.","There is no specified domain for this concept, just choose the Standard Concept Id that best represents the person's cause of death.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
DEATH,cdm,cause_source_concept_id,No,,,integer,0,,,If the cause of death was coded using a Vocabulary present in the OMOP Vocabularies put the CONCEPT_ID representing the cause of death here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DEATH,cdm,cause_source_value,No,,,varchar(50),0,,,"If available, put the source code representing the cause of death here. ",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,CAUSE_SOURCE_CONCEPT_ID,,,,,,,,,,,,,,,Yes,,,
-DEATH,cdm,death_date,Yes,0,,date,0,,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
+DEATH,cdm,death_date,Yes,0,,date,0,,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
DEATH,cdm,death_datetime,No,,,datetime,0,,,If not available set time to midnight (00:00:00),No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
DEATH,cdm,death_type_concept_id,No,,,integer,0,,"This is the provenance of the death record, i.e., where it came from. It is possible that an administrative claims database would source death information from a government file so do not assume the Death Type is the same as the Visit Type, etc.",Use the type concept that be reflects the source of the death record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
-DEATH,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
\ No newline at end of file
+DEATH,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
diff --git a/inst/csv/OMOP_CDMv5.2_Table_Level.csv b/inst/csv/OMOP_CDMv5.2_Table_Level.csv
index a91c6625..9b000195 100644
--- a/inst/csv/OMOP_CDMv5.2_Table_Level.csv
+++ b/inst/csv/OMOP_CDMv5.2_Table_Level.csv
@@ -20,4 +20,4 @@ COST,CDM,No,,No,,,No,,,,,,
DRUG_ERA,CDM,No,,Yes,95,,No,,,,,,
DOSE_ERA,CDM,No,,Yes,100,,No,,,,,,
CONDITION_ERA,CDM,No,,Yes,95,,Yes,0,,,,,
-DEATH,CDM,No,,No,,,No,,,,,,
\ No newline at end of file
+DEATH,CDM,No,,Yes,100,,No,,,,,,
diff --git a/inst/csv/OMOP_CDMv5.3_Concept_Level.csv b/inst/csv/OMOP_CDMv5.3_Concept_Level.csv
index 599b40a3..43c8eb98 100644
--- a/inst/csv/OMOP_CDMv5.3_Concept_Level.csv
+++ b/inst/csv/OMOP_CDMv5.3_Concept_Level.csv
@@ -471,7 +471,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3047107,Calcium [Mass/volume] corrected for a
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050166,Trypsinogen I Free [Mass/volume] in DBS,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493466,Plesiomonas shigelloides DNA [Presence] in Stool by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493469,Vibrio cholerae DNA [Presence] in Stool by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,36306178,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,36306178,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760892,CBC W Ordered Manual Differential panel - Blood,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764568,How often did your fatigue make it difficult to organize your thoughts when doing things at work (include work at home) in past 7 days [PROMIS],,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40767693,Vaccine funding program eligibility category,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -852,7 +852,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050920,Urate [Mass/volume] in Body fluid,,,,
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051923,Hemoglobin disorders newborn screen interpretation,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493338,Parainfluenza virus 2 RNA [Presence] in Nasopharynx by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,36203231,Streptococcus pneumoniae Danish serotype 12F IgG Ab [Mass/volume] in Serum,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,36303797,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,36303797,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760007,HIV 1+2 Ab+HIV1 p24 Ag [Presence] in Serum or Plasma by Immunoassay,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3000571,Amphetamine [Mass/volume] in Urine,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3001137,Triple phosphate crystals [Presence] in Urine sediment by Light microscopy,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1123,7 +1123,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3026796,Spermatozoa [Presence] in Urine sedim
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027475,Erythrocytes [#/volume] in Cerebral spinal fluid,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027694,Calcium.ionized [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3028193,Bilirubin.total [Mass/volume] in Body fluid,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030354,Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum or Plasma by Creatinine-based formula (MDRD),,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030354,Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum or Plasma by Creatinine-based formula (MDRD),,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030612,Hemoglobin S/Hemoglobin.total in Blood by Electrophoresis,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030687,Bacterial susceptibility panel by Minimum inhibitory concentration (MIC),,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3032084,Eosinophils [#/volume] in Body fluid,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1169,7 +1169,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3041642,Human coronavirus 229E RNA [Presence]
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3044938,Influenza virus A RNA [Presence] in Specimen by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3045262,"Creatinine and Glomerular filtration rate.predicted panel - Serum, Plasma or Blood",,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3047117,Bordetella pertussis DNA [Presence] in Nasopharynx by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3049187,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3049187,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050099,BK virus DNA [#/volume] (viral load) in Specimen by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051205,Crystals [#/area] in Urine sediment by Microscopy high power field,,,,,,,,,,,,,,,,,,,,,8786,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051596,Benzodiazepines [Presence] in Serum or Plasma by Screen method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1186,7 +1186,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3001612,Ticarcillin+Clavulanate [Susceptibili
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3002030,Lymphocytes/100 leukocytes in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3003311,Nucleated erythrocytes/100 leukocytes [Ratio] in Blood by Manual count,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005044,Rubella virus IgG Ab [Interpretation] in Serum,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005424,Body surface area,,,,,,,,,,,,,,,,,,,,,"8617,9258,9259,9284,9401,9403,9404,9406,9408,9411,9417,9453,9456,9483,9572",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005424,Body surface area,,,,,,,,,,,,,,,,,,,,,"8617,9284,9401,9403,9404,9406,9408,9411,9417,9453,9456,9483,9572",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3006906,Calcium [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3006957,Toxoplasma gondii IgG Ab [Units/volume] in Serum or Plasma by Immunoassay,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3007435,Base excess in Venous cord blood by calculation,,,,,,,,,,,,,,,,,,,,,"8729,8736,8745,8749,8753,8839,8843,8875,9440,9490,9491,9501,9553,9557,9559,9575,9586,9587,9588,9591,9608,9621,9631,9632,9654,9673,45891014",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1541,7 +1541,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027315,Oxygen [Partial pressure] in Blood,,,
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027572,Xanthochromia [Presence] of Cerebral spinal fluid Qualitative,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027944,Amphetamines [Presence] in Urine,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027953,Aldolase [Enzymatic activity/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8645,8645,8719,8719,8750,8750,8763,8763,8810,8810,8860,8860,8923,8923,8924,8924,8985,8985,9040,9040,9058,9058,9093,9093,9332,9332,9525,9525,9550,9550,44777568,44777568,44777578,44777578,44777583,44777583",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3029859,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Cystatin-based formula",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3029859,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Cystatin-based formula",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3032459,Ketones [Mass/volume] in Urine,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3033281,Carbapenem resistance blaKPC gene [Presence] by Molecular method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3035740,Bacteria identified in Throat by Aerobe culture,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1646,7 +1646,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760857,Erythrocytes [#/volume] in Urine by
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760861,Hemoglobin [Presence] in Urine by Automated test strip,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40763912,Albumin [Mass/volume] in Serum or Plasma by Bromocresol green (BCG) dye binding method,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764997,Pyridoxal phosphate [Moles/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8729,8736,8745,8749,8753,8839,8843,8875,9440,9490,9491,9501,9553,9557,9559,9575,9586,9587,9588,9591,9608,9621,9631,9632,9654,9673,45891014",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764999,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764999,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40765636,PhenX - pain protocol 170401,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42868460,FEF 25-75% Predicted,,,,,,,,,,,,,,,,,,,,,"8698,8795,8857,8930,32700,44777523,44777603,44777613,44777614,44777664",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,757685,SARS-CoV+SARS-CoV-2 (COVID-19) Ag [Presence] in Respiratory specimen by Rapid immunoassay,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -2270,14 +2270,14 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3044649,Blood type and Indirect antibody scre
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3045646,Triple phosphate crystals [#/area] in Urine sediment by Microscopy high power field,,,,,,,,,,,,,,,,,,,,,8786,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3048230,Gestational age in weeks,,,,,,,,,,,,,,,,,,,,,"8505,8511,8512,8550,8555,9399,9448,9449,9450,9451,9537,9580,9581,9582,9583,9592,9593,9616,9634,9676,32960,32961,44777661",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050675,Wet mount panel - Vaginal fluid,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3053283,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3053283,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40757378,Drug screen comment [Interpretation] in Urine,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40761484,Norfentanyl [Mass/volume] in Urine by Confirmatory method,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40771527,Human papilloma virus E6+E7 mRNA [Presence] in Cervix by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42868623,Benzodiazepines [Presence] in Urine by Screen method >200 ng/mL,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42869588,Hematocrit [Pure volume fraction] of Blood by Automated count,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42870589,Drugs of abuse panel - Urine by Screen method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,46236952,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,46236952,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3018010,Neutrophils/100 leukocytes in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3018738,Hemoglobin F/Hemoglobin.total in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3020460,C reactive protein [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
diff --git a/inst/csv/OMOP_CDMv5.3_Field_Level.csv b/inst/csv/OMOP_CDMv5.3_Field_Level.csv
index 35ee6b4b..8cccd425 100644
--- a/inst/csv/OMOP_CDMv5.3_Field_Level.csv
+++ b/inst/csv/OMOP_CDMv5.3_Field_Level.csv
@@ -335,7 +335,7 @@ CONDITION_ERA,cdm,condition_occurrence_count,No,,,integer,0,,,,No,,,No,,,,,,,,,,
DEATH,cdm,cause_concept_id,No,,,integer,0,,"This is the Standard Concept representing the Person's cause of death, if available.","There is no specified domain for this concept, just choose the Standard Concept Id that best represents the person's cause of death.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
DEATH,cdm,cause_source_concept_id,No,,,integer,0,,,If the cause of death was coded using a Vocabulary present in the OMOP Vocabularies put the CONCEPT_ID representing the cause of death here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DEATH,cdm,cause_source_value,No,,,varchar(50),0,,,"If available, put the source code representing the cause of death here. ",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,CAUSE_SOURCE_CONCEPT_ID,,,,,,,,,,,,,,,Yes,,,
-DEATH,cdm,death_date,Yes,0,,date,0,,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
+DEATH,cdm,death_date,Yes,0,,date,0,,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
DEATH,cdm,death_datetime,No,,,datetime,0,,,If not available set time to midnight (00:00:00),No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
DEATH,cdm,death_type_concept_id,No,,,integer,0,,"This is the provenance of the death record, i.e., where it came from. It is possible that an administrative claims database would source death information from a government file so do not assume the Death Type is the same as the Visit Type, etc.",Use the type concept that be reflects the source of the death record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
-DEATH,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
\ No newline at end of file
+DEATH,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
diff --git a/inst/csv/OMOP_CDMv5.3_Table_Level.csv b/inst/csv/OMOP_CDMv5.3_Table_Level.csv
index 0de6279b..f984dee4 100644
--- a/inst/csv/OMOP_CDMv5.3_Table_Level.csv
+++ b/inst/csv/OMOP_CDMv5.3_Table_Level.csv
@@ -21,4 +21,4 @@ COST,CDM,No,,No,,,No,,,,,,
DRUG_ERA,CDM,No,,Yes,95,,No,,,,,,
DOSE_ERA,CDM,No,,Yes,100,,No,,,,,,
CONDITION_ERA,CDM,No,,Yes,95,,Yes,0,,,,,
-DEATH,CDM,No,,No,,,No,,,,,,
\ No newline at end of file
+DEATH,CDM,No,,Yes,100,,No,,,,,,
diff --git a/inst/csv/OMOP_CDMv5.4_Concept_Level.csv b/inst/csv/OMOP_CDMv5.4_Concept_Level.csv
index 9c9d3a1f..c07d738c 100644
--- a/inst/csv/OMOP_CDMv5.4_Concept_Level.csv
+++ b/inst/csv/OMOP_CDMv5.4_Concept_Level.csv
@@ -471,7 +471,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3047107,Calcium [Mass/volume] corrected for a
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050166,Trypsinogen I Free [Mass/volume] in DBS,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493466,Plesiomonas shigelloides DNA [Presence] in Stool by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493469,Vibrio cholerae DNA [Presence] in Stool by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,36306178,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,36306178,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760892,CBC W Ordered Manual Differential panel - Blood,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764568,How often did your fatigue make it difficult to organize your thoughts when doing things at work (include work at home) in past 7 days [PROMIS],,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40767693,Vaccine funding program eligibility category,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -852,7 +852,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050920,Urate [Mass/volume] in Body fluid,,,,
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051923,Hemoglobin disorders newborn screen interpretation,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,21493338,Parainfluenza virus 2 RNA [Presence] in Nasopharynx by NAA with non-probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,36203231,Streptococcus pneumoniae Danish serotype 12F IgG Ab [Mass/volume] in Serum,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,36303797,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,36303797,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760007,HIV 1+2 Ab+HIV1 p24 Ag [Presence] in Serum or Plasma by Immunoassay,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3000571,Amphetamine [Mass/volume] in Urine,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3001137,Triple phosphate crystals [Presence] in Urine sediment by Light microscopy,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1123,7 +1123,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3026796,Spermatozoa [Presence] in Urine sedim
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027475,Erythrocytes [#/volume] in Cerebral spinal fluid,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027694,Calcium.ionized [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3028193,Bilirubin.total [Mass/volume] in Body fluid,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030354,Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum or Plasma by Creatinine-based formula (MDRD),,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030354,Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum or Plasma by Creatinine-based formula (MDRD),,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030612,Hemoglobin S/Hemoglobin.total in Blood by Electrophoresis,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3030687,Bacterial susceptibility panel by Minimum inhibitory concentration (MIC),,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3032084,Eosinophils [#/volume] in Body fluid,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1169,7 +1169,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3041642,Human coronavirus 229E RNA [Presence]
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3044938,Influenza virus A RNA [Presence] in Specimen by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3045262,"Creatinine and Glomerular filtration rate.predicted panel - Serum, Plasma or Blood",,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3047117,Bordetella pertussis DNA [Presence] in Nasopharynx by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3049187,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3049187,"Glomerular filtration rate/1.73 sq M.predicted among non-blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050099,BK virus DNA [#/volume] (viral load) in Specimen by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051205,Crystals [#/area] in Urine sediment by Microscopy high power field,,,,,,,,,,,,,,,,,,,,,8786,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3051596,Benzodiazepines [Presence] in Serum or Plasma by Screen method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1186,7 +1186,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3001612,Ticarcillin+Clavulanate [Susceptibili
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3002030,Lymphocytes/100 leukocytes in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3003311,Nucleated erythrocytes/100 leukocytes [Ratio] in Blood by Manual count,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005044,Rubella virus IgG Ab [Interpretation] in Serum,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005424,Body surface area,,,,,,,,,,,,,,,,,,,,,"8617,9258,9259,9284,9401,9403,9404,9406,9408,9411,9417,9453,9456,9483,9572",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3005424,Body surface area,,,,,,,,,,,,,,,,,,,,,"8617,9284,9401,9403,9404,9406,9408,9411,9417,9453,9456,9483,9572",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3006906,Calcium [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3006957,Toxoplasma gondii IgG Ab [Units/volume] in Serum or Plasma by Immunoassay,,,,,,,,,,,,,,,,,,,,,"8647,8695,8712,8734,8784,8785,8799,8815,8816,8829,8848,8888,8931,8938,8961,8980,9156,9157,9158,9245,9254,9257,9423,9426,9435,9436,9442,9444,9445,9446,32706,44777520,44777558,44777561,44777562,44777569,44777575,44777580,44777588,45891003",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3007435,Base excess in Venous cord blood by calculation,,,,,,,,,,,,,,,,,,,,,"8729,8736,8745,8749,8753,8839,8843,8875,9440,9490,9491,9501,9553,9557,9559,9575,9586,9587,9588,9591,9608,9621,9631,9632,9654,9673,45891014",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1541,7 +1541,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027315,Oxygen [Partial pressure] in Blood,,,
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027572,Xanthochromia [Presence] of Cerebral spinal fluid Qualitative,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027944,Amphetamines [Presence] in Urine,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3027953,Aldolase [Enzymatic activity/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8645,8645,8719,8719,8750,8750,8763,8763,8810,8810,8860,8860,8923,8923,8924,8924,8985,8985,9040,9040,9058,9058,9093,9093,9332,9332,9525,9525,9550,9550,44777568,44777568,44777578,44777578,44777583,44777583",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3029859,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Cystatin-based formula",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3029859,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Cystatin-based formula",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3032459,Ketones [Mass/volume] in Urine,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3033281,Carbapenem resistance blaKPC gene [Presence] by Molecular method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3035740,Bacteria identified in Throat by Aerobe culture,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -1646,7 +1646,7 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760857,Erythrocytes [#/volume] in Urine by
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40760861,Hemoglobin [Presence] in Urine by Automated test strip,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40763912,Albumin [Mass/volume] in Serum or Plasma by Bromocresol green (BCG) dye binding method,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764997,Pyridoxal phosphate [Moles/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8729,8736,8745,8749,8753,8839,8843,8875,9440,9490,9491,9501,9553,9557,9559,9575,9586,9587,9588,9591,9608,9621,9631,9632,9654,9673,45891014",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764999,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,40764999,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (CKD-EPI)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40765636,PhenX - pain protocol 170401,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42868460,FEF 25-75% Predicted,,,,,,,,,,,,,,,,,,,,,"8698,8795,8857,8930,32700,44777523,44777603,44777613,44777614,44777664",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,757685,SARS-CoV+SARS-CoV-2 (COVID-19) Ag [Presence] in Respiratory specimen by Rapid immunoassay,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
@@ -2270,14 +2270,14 @@ MEASUREMENT,MEASUREMENT_CONCEPT_ID,3044649,Blood type and Indirect antibody scre
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3045646,Triple phosphate crystals [#/area] in Urine sediment by Microscopy high power field,,,,,,,,,,,,,,,,,,,,,8786,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3048230,Gestational age in weeks,,,,,,,,,,,,,,,,,,,,,"8505,8511,8512,8550,8555,9399,9448,9449,9450,9451,9537,9580,9581,9582,9583,9592,9593,9616,9634,9676,32960,32961,44777661",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3050675,Wet mount panel - Vaginal fluid,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,3053283,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,3053283,"Glomerular filtration rate/1.73 sq M.predicted among blacks [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40757378,Drug screen comment [Interpretation] in Urine,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40761484,Norfentanyl [Mass/volume] in Urine by Confirmatory method,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,40771527,Human papilloma virus E6+E7 mRNA [Presence] in Cervix by NAA with probe detection,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42868623,Benzodiazepines [Presence] in Urine by Screen method >200 ng/mL,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42869588,Hematocrit [Pure volume fraction] of Blood by Automated count,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,42870589,Drugs of abuse panel - Urine by Screen method,,,,,,,,,,,,,,,,,,,,,,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
-MEASUREMENT,MEASUREMENT_CONCEPT_ID,46236952,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,9117,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
+MEASUREMENT,MEASUREMENT_CONCEPT_ID,46236952,"Glomerular filtration rate/1.73 sq M.predicted [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)",,,,,,,,,,,,,,,,,,,,,720870,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3018010,Neutrophils/100 leukocytes in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3018738,Hemoglobin F/Hemoglobin.total in Blood,,,,,,,,,,,,,,,,,,,,,8554,5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
MEASUREMENT,MEASUREMENT_CONCEPT_ID,3020460,C reactive protein [Mass/volume] in Serum or Plasma,,,,,,,,,,,,,,,,,,,,,"8636,8713,8725,8748,8751,8817,8820,8837,8840,8842,8845,8859,8861,8950,9028,9503,9514,9530,9532,9560,9564,9625,32964,32965,44777535,44777592,44777638,45956701",5,Approved UNIT_CONCEPT_IDs for the given MEASUREMENT_CONCEPT_ID
diff --git a/inst/csv/OMOP_CDMv5.4_Field_Level.csv b/inst/csv/OMOP_CDMv5.4_Field_Level.csv
index 5f25dc46..c0b04622 100644
--- a/inst/csv/OMOP_CDMv5.4_Field_Level.csv
+++ b/inst/csv/OMOP_CDMv5.4_Field_Level.csv
@@ -1,135 +1,135 @@
cdmTableName,databaseSchema,cdmFieldName,isRequired,isRequiredThreshold,isRequiredNotes,cdmDatatype,cdmDatatypeThreshold,cdmDatatypeNotes,userGuidance,etlConventions,isPrimaryKey,isPrimaryKeyThreshold,isPrimaryKeyNotes,isForeignKey,isForeignKeyThreshold,isForeignKeyNotes,fkTableName,fkFieldName,fkDomain,fkDomainThreshold,fkDomainNotes,fkClass,fkClassThreshold,fkClassNotes,isStandardValidConcept,isStandardValidConceptThreshold,isStandardValidConceptNotes,measureValueCompleteness,measureValueCompletenessThreshold,measureValueCompletenessNotes,standardConceptRecordCompleteness,standardConceptRecordCompletenessThreshold,standardConceptRecordCompletenessNotes,sourceConceptRecordCompleteness,sourceConceptRecordCompletenessThreshold,sourceConceptRecordCompletenessNotes,sourceValueCompleteness,sourceValueCompletenessThreshold,sourceValueCompletenessNotes,standardConceptFieldName,plausibleValueLow,plausibleValueLowThreshold,plausibleValueLowNotes,plausibleValueHigh,plausibleValueHighThreshold,plausibleValueHighNotes,plausibleTemporalAfter,plausibleTemporalAfterTableName,plausibleTemporalAfterFieldName,plausibleTemporalAfterThreshold,plausibleTemporalAfterNotes,plausibleDuringLife,plausibleDuringLifeThreshold,plausibleDuringLifeNotes,runForCohort,withinVisitDates,withinVisitDatesThreshold,withinVisitDatesNotes
-CARE_SITE,cdm,care_site_id,Yes,0,,integer,0,,,Assign an id to each unique combination of location_id and place_of_service_source_value,Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+CARE_SITE,cdm,care_site_id,Yes,0,,integer,0,,,Assign an id to each unique combination of location_id and place_of_service_source_value,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
CARE_SITE,cdm,care_site_name,No,,,varchar(255),0,,The name of the care_site as it appears in the source data,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
CARE_SITE,cdm,care_site_source_value,No,,,varchar(50),0,,The identifier of the care_site as it appears in the source data. This could be an identifier separate from the name of the care_site.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
CARE_SITE,cdm,location_id,No,,,integer,0,,The location_id from the LOCATION table representing the physical location of the care_site.,,No,,,Yes,0,,LOCATION,LOCATION_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
CARE_SITE,cdm,place_of_service_concept_id,No,,,integer,0,,"This is a high-level way of characterizing a Care Site. Typically, however, Care Sites can provide care in multiple settings (inpatient, outpatient, etc.) and this granularity should be reflected in the visit.","Choose the concept in the visit domain that best represents the setting in which healthcare is provided in the Care Site. If most visits in a Care Site are Inpatient, then the place_of_service_concept_id should represent Inpatient. If information is present about a unique Care Site (e.g. Pharmacy) then a Care Site record should be created. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=2&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
CARE_SITE,cdm,place_of_service_source_value,No,,,varchar(50),0,,,Put the place of service of the care_site as it appears in the source data.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
CDM_SOURCE,cdm,cdm_etl_reference,No,,,varchar(255),0,,,Put the link to the CDM version used.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CDM_SOURCE,cdm,cdm_holder,Yes,0,,varchar(255),0,,The holder of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CDM_SOURCE,cdm,cdm_release_date,Yes,0,,date,0,,The release data of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'20000101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,CDM_SOURCE,SOURCE_RELEASE_DATE,0,,,,,,,,
-CDM_SOURCE,cdm,cdm_source_abbreviation,Yes,0,,varchar(25),0,,The abbreviation of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CDM_SOURCE,cdm,cdm_source_name,Yes,0,,varchar(255),0,,The name of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CDM_SOURCE,cdm,cdm_holder,Yes,0,,varchar(255),0,,The holder of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CDM_SOURCE,cdm,cdm_release_date,Yes,0,,date,0,,The release data of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'20000101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,CDM_SOURCE,SOURCE_RELEASE_DATE,0,,,,,,,,
+CDM_SOURCE,cdm,cdm_source_abbreviation,Yes,0,,varchar(25),0,,The abbreviation of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CDM_SOURCE,cdm,cdm_source_name,Yes,0,,varchar(255),0,,The name of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CDM_SOURCE,cdm,cdm_version,No,,,varchar(10),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CDM_SOURCE,cdm,cdm_version_concept_id,Yes,0,,integer,0,,The Concept Id representing the version of the CDM.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Metadata,0,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CDM_SOURCE,cdm,cdm_version_concept_id,Yes,0,,integer,0,,The Concept Id representing the version of the CDM.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Metadata,0,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CDM_SOURCE,cdm,source_description,No,,,varchar(MAX),0,,The description of the CDM instance.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CDM_SOURCE,cdm,source_documentation_reference,No,,,varchar(255),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CDM_SOURCE,cdm,source_release_date,Yes,0,,date,0,,The release date of the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'20000101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,,,,,,,
-CDM_SOURCE,cdm,vocabulary_version,Yes,0,,varchar(20),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT,cohort,cohort_definition_id,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT,cohort,cohort_end_date,Yes,0,,date,0,,,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,,,,,,,
-COHORT,cohort,cohort_start_date,Yes,0,,date,0,,,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,,,,,,,
-COHORT,cohort,subject_id,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,cohort_definition_description,No,,,varchar(MAX),0,,A complete description of the cohort.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,cohort_definition_id,Yes,0,,integer,0,,"This is the identifier given to the cohort, usually by the ATLAS application",,No,,,Yes,0,,COHORT,COHORT_DEFINITION_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,cohort_definition_name,Yes,0,,varchar(255),0,,A short description of the cohort,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,cohort_definition_syntax,No,,,varchar(MAX),0,,Syntax or code to operationalize the Cohort Definition.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,cohort_initiation_date,No,,,date,0,,A date to indicate when the Cohort was initiated in the COHORT table.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,definition_type_concept_id,Yes,0,,integer,0,,Type defining what kind of Cohort Definition the record represents and how the syntax may be executed.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COHORT_DEFINITION,cohort,subject_concept_id,Yes,0,,integer,0,,"This field contains a Concept that represents the domain of the subjects that are members of the cohort (e.g., Person, Provider, Visit).",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CDM_SOURCE,cdm,source_release_date,Yes,0,,date,0,,The release date of the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'20000101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,,,,,,,
+CDM_SOURCE,cdm,vocabulary_version,Yes,0,,varchar(20),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT,cohort,cohort_definition_id,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT,cohort,cohort_end_date,Yes,0,,date,0,,,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,,,,,,,
+COHORT,cohort,cohort_start_date,Yes,0,,date,0,,,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,,,,,,,
+COHORT,cohort,subject_id,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,cohort_definition_description,No,,,varchar(MAX),0,,A complete description of the cohort.,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,cohort_definition_id,Yes,0,,integer,0,,"This is the identifier given to the cohort, usually by the ATLAS application",,No,,,Yes,0,,COHORT,COHORT_DEFINITION_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,cohort_definition_name,Yes,0,,varchar(255),0,,A short description of the cohort,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,cohort_definition_syntax,No,,,varchar(MAX),0,,Syntax or code to operationalize the Cohort Definition.,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,cohort_initiation_date,No,,,date,0,,A date to indicate when the Cohort was initiated in the COHORT table.,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,definition_type_concept_id,Yes,0,,integer,0,,Type defining what kind of Cohort Definition the record represents and how the syntax may be executed.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COHORT_DEFINITION,cohort,subject_concept_id,Yes,0,,integer,0,,"This field contains a Concept that represents the domain of the subjects that are members of the cohort (e.g., Person, Provider, Visit).",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT,vocab,concept_class_id,Yes,0,,varchar(20),0,,"The attribute or concept class of the
Concept. Examples are 'Clinical Drug',
-'Ingredient', 'Clinical Finding' etc.",,No,,,Yes,0,,CONCEPT_CLASS,CONCEPT_CLASS_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+'Ingredient', 'Clinical Finding' etc.",,No,,,Yes,0,,CONCEPT_CLASS,CONCEPT_CLASS_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT,vocab,concept_code,Yes,0,,varchar(50),0,,"The concept code represents the identifier
of the Concept in the source vocabulary,
such as SNOMED-CT concept IDs,
RxNorm RXCUIs etc. Note that concept
-codes are not unique across vocabularies.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT,vocab,concept_id,Yes,0,,integer,0,,A unique identifier for each Concept across all domains.,,Yes,0,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT,vocab,concept_name,Yes,0,,varchar(255),0,,"An unambiguous, meaningful and descriptive name for the Concept.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT,vocab,domain_id,Yes,0,,varchar(20),0,,A foreign key to the [DOMAIN](https://ohdsi.github.io/CommonDataModel/cdm531.html#domain) table the Concept belongs to.,,No,,,Yes,0,,DOMAIN,DOMAIN_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+codes are not unique across vocabularies.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT,vocab,concept_id,Yes,0,,integer,0,,A unique identifier for each Concept across all domains.,,Yes,0,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT,vocab,concept_name,Yes,0,,varchar(255),0,,"An unambiguous, meaningful and descriptive name for the Concept.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT,vocab,domain_id,Yes,0,,varchar(20),0,,A foreign key to the [DOMAIN](https://ohdsi.github.io/CommonDataModel/cdm531.html#domain) table the Concept belongs to.,,No,,,Yes,0,,DOMAIN,DOMAIN_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the Concept was invalidated.
Possible values are D (deleted), U
(replaced with an update) or NULL when
-valid_end_date has the default value.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+valid_end_date has the default value.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT,vocab,standard_concept,No,,,varchar(1),0,,"This flag determines where a Concept is
a Standard Concept, i.e. is used in the
data, a Classification Concept, or a
non-standard Source Concept. The
allowable values are 'S' (Standard
Concept) and 'C' (Classification
-Concept), otherwise the content is NULL.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+Concept), otherwise the content is NULL.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT,vocab,valid_end_date,Yes,0,,date,0,,"The date when the Concept became
invalid because it was deleted or
superseded (updated) by a new concept.
The default value is 31-Dec-2099,
meaning, the Concept is valid until it
-becomes deprecated.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,Yes,CONCEPT,VALID_START_DATE,0,,,,,,,,
+becomes deprecated.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,Yes,CONCEPT,VALID_START_DATE,0,,,,,,,,
CONCEPT,vocab,valid_start_date,Yes,0,,date,0,,"The date when the Concept was first
recorded. The default value is
1-Jan-1970, meaning, the Concept has no
-(known) date of inception.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+(known) date of inception.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT,vocab,vocabulary_id,Yes,0,,varchar(20),0,,"A foreign key to the [VOCABULARY](https://ohdsi.github.io/CommonDataModel/cdm531.html#vocabulary)
table indicating from which source the
-Concept has been adapted.",,No,,,Yes,0,,VOCABULARY,VOCABULARY_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+Concept has been adapted.",,No,,,Yes,0,,VOCABULARY,VOCABULARY_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT_ANCESTOR,vocab,ancestor_concept_id,Yes,0,,integer,0,,"The Concept Id for the higher-level concept
-that forms the ancestor in the relationship.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+that forms the ancestor in the relationship.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT_ANCESTOR,vocab,descendant_concept_id,Yes,0,,integer,0,,"The Concept Id for the lower-level concept
that forms the descendant in the
-relationship.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+relationship.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT_ANCESTOR,vocab,max_levels_of_separation,Yes,0,,integer,0,,"The maximum separation in number of
levels of hierarchy between ancestor and
descendant concepts. This is an attribute
-that is used to simplify hierarchic analysis.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+that is used to simplify hierarchic analysis.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT_ANCESTOR,vocab,min_levels_of_separation,Yes,0,,integer,0,,"The minimum separation in number of
levels of hierarchy between ancestor and
descendant concepts. This is an attribute
-that is used to simplify hierarchic analysis.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_CLASS,vocab,concept_class_concept_id,Yes,0,,integer,0,,A Concept that represents the Concept Class.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_CLASS,vocab,concept_class_id,Yes,0,,varchar(20),0,,A unique key for each class.,,Yes,0,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+that is used to simplify hierarchic analysis.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_CLASS,vocab,concept_class_concept_id,Yes,0,,integer,0,,A Concept that represents the Concept Class.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_CLASS,vocab,concept_class_id,Yes,0,,varchar(20),0,,A unique key for each class.,,Yes,0,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONCEPT_CLASS,vocab,concept_class_name,Yes,0,,varchar(255),0,,"The name describing the Concept Class, e.g.
-Clinical Finding, Ingredient, etc.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_RELATIONSHIP,vocab,concept_id_1,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_RELATIONSHIP,vocab,concept_id_2,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_RELATIONSHIP,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the relationship was invalidated. Possible values are 'D' (deleted), 'U' (updated) or NULL. ",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_RELATIONSHIP,vocab,relationship_id,Yes,0,,varchar(20),0,,The relationship between CONCEPT_ID_1 and CONCEPT_ID_2. Please see the [Vocabulary Conventions](https://ohdsi.github.io/CommonDataModel/dataModelConventions.html#concept_relationships). for more information. ,,No,,,Yes,0,,RELATIONSHIP,RELATIONSHIP_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_RELATIONSHIP,vocab,valid_end_date,Yes,0,,date,0,,The date when the relationship is invalidated.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,Yes,CONCEPT_RELATIONSHIP,VALID_START_DATE,0,,,,,,,,
-CONCEPT_RELATIONSHIP,vocab,valid_start_date,Yes,0,,date,0,,The date when the relationship is first recorded.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_SYNONYM,vocab,concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_SYNONYM,vocab,concept_synonym_name,Yes,0,,varchar(1000),0,,,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONCEPT_SYNONYM,vocab,language_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-CONDITION_ERA,cdm,condition_concept_id,Yes,0,,integer,0,,The Concept Id representing the Condition.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Condition,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+Clinical Finding, Ingredient, etc.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_RELATIONSHIP,vocab,concept_id_1,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_RELATIONSHIP,vocab,concept_id_2,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_RELATIONSHIP,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the relationship was invalidated. Possible values are 'D' (deleted), 'U' (updated) or NULL.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_RELATIONSHIP,vocab,relationship_id,Yes,0,,varchar(20),0,,The relationship between CONCEPT_ID_1 and CONCEPT_ID_2. Please see the [Vocabulary Conventions](https://ohdsi.github.io/CommonDataModel/dataModelConventions.html#concept_relationships). for more information.,,No,,,Yes,0,,RELATIONSHIP,RELATIONSHIP_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_RELATIONSHIP,vocab,valid_end_date,Yes,0,,date,0,,The date when the relationship is invalidated.,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,Yes,CONCEPT_RELATIONSHIP,VALID_START_DATE,0,,,,,,,,
+CONCEPT_RELATIONSHIP,vocab,valid_start_date,Yes,0,,date,0,,The date when the relationship is first recorded.,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_SYNONYM,vocab,concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_SYNONYM,vocab,concept_synonym_name,Yes,0,,varchar(1000),0,,,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONCEPT_SYNONYM,vocab,language_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONDITION_ERA,cdm,condition_concept_id,Yes,0,,integer,0,,The Concept Id representing the Condition.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Condition,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_ERA,cdm,condition_era_end_date,Yes,0,,datetime,0,,"The end date for the Condition Era
constructed from the individual
instances of Condition Occurrences.
It is the end date of the final
continuously recorded instance of the
-Condition.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,CONDITION_ERA,CONDITION_ERA_START_DATE,1,,No,,,Yes,,,
-CONDITION_ERA,cdm,condition_era_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+Condition.",,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,CONDITION_ERA,CONDITION_ERA_START_DATE,1,,No,,,Yes,,,
+CONDITION_ERA,cdm,condition_era_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_ERA,cdm,condition_era_start_date,Yes,0,,datetime,0,,"The start date for the Condition Era
constructed from the individual
instances of Condition Occurrences.
It is the start date of the very first
chronologically recorded instance of
-the condition with at least 31 days since any prior record of the same Condition. ",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+the condition with at least 31 days since any prior record of the same Condition.",,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
CONDITION_ERA,cdm,condition_occurrence_count,No,,,integer,0,,"The number of individual Condition
Occurrences used to construct the
condition era.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
-CONDITION_ERA,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-CONDITION_OCCURRENCE,cdm,condition_concept_id,Yes,0,,integer,0,,"The CONDITION_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source value which represents a condition","The CONCEPT_ID that the CONDITION_SOURCE_VALUE maps to. Only records whose source values map to concepts with a domain of ""Condition"" should go in this table. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Condition&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Condition,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+CONDITION_ERA,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+CONDITION_OCCURRENCE,cdm,condition_concept_id,Yes,0,,integer,0,,"The CONDITION_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source value which represents a condition","The CONCEPT_ID that the CONDITION_SOURCE_VALUE maps to. Only records whose source values map to concepts with a domain of ""Condition"" should go in this table. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Condition&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Condition,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_OCCURRENCE,cdm,condition_end_date,No,,,date,0,,Use this date to determine the end date of the condition,"Most often data sources do not have the idea of a start date for a condition. Rather, if a source only has one date associated with a condition record it is acceptable to use that date for both the CONDITION_START_DATE and the CONDITION_END_DATE.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,CONDITION_OCCURRENCE,CONDITION_START_DATE,1,,Yes,1,,Yes,,,
CONDITION_OCCURRENCE,cdm,condition_end_datetime,No,,,datetime,0,,,If a source does not specify datetime the convention is to set the time to midnight (00:00:0000),No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,CONDITION_OCCURRENCE,CONDITION_START_DATETIME,1,,Yes,1,,Yes,,,
-CONDITION_OCCURRENCE,cdm,condition_occurrence_id,Yes,0,,integer,0,,The unique key given to a condition record for a person. Refer to the ETL for how duplicate conditions during the same visit were handled.,"Each instance of a condition present in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same condition within the same visit. It is valid to keep these duplicates and assign them individual, unique, CONDITION_OCCURRENCE_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONDITION_OCCURRENCE,cdm,condition_occurrence_id,Yes,0,,integer,0,,The unique key given to a condition record for a person. Refer to the ETL for how duplicate conditions during the same visit were handled.,"Each instance of a condition present in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same condition within the same visit. It is valid to keep these duplicates and assign them individual, unique, CONDITION_OCCURRENCE_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONDITION_OCCURRENCE,cdm,condition_source_concept_id,No,,,integer,0,,"This is the concept representing the condition source value and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Condition necessary for a given analytic use case. Consider using CONDITION_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the CONDITION_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_OCCURRENCE,cdm,condition_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the condition that occurred. For example, this could be an ICD10 or Read code.",This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,CONDITION_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-CONDITION_OCCURRENCE,cdm,condition_start_date,Yes,0,,date,0,,Use this date to determine the start date of the condition,"Most often data sources do not have the idea of a start date for a condition. Rather, if a source only has one date associated with a condition record it is acceptable to use that date for both the CONDITION_START_DATE and the CONDITION_END_DATE.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
+CONDITION_OCCURRENCE,cdm,condition_start_date,Yes,0,,date,0,,Use this date to determine the start date of the condition,"Most often data sources do not have the idea of a start date for a condition. Rather, if a source only has one date associated with a condition record it is acceptable to use that date for both the CONDITION_START_DATE and the CONDITION_END_DATE.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
CONDITION_OCCURRENCE,cdm,condition_start_datetime,No,,,datetime,0,,,If a source does not specify datetime the convention is to set the time to midnight (00:00:0000),No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-CONDITION_OCCURRENCE,cdm,condition_status_concept_id,No,,,integer,0,,"This concept represents the point during the visit the diagnosis was given (admitting diagnosis, final diagnosis), whether the diagnosis was determined due to laboratory findings, if the diagnosis was exclusionary, or if it was a preliminary diagnosis, among others. ","Choose the Concept in the Condition Status domain that best represents the point during the visit when the diagnosis was given. These can include admitting diagnosis, principal diagnosis, and secondary diagnosis. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Condition+Status&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Condition Status,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONDITION_OCCURRENCE,cdm,condition_status_concept_id,No,,,integer,0,,"This concept represents the point during the visit the diagnosis was given (admitting diagnosis, final diagnosis), whether the diagnosis was determined due to laboratory findings, if the diagnosis was exclusionary, or if it was a preliminary diagnosis, among others.","Choose the Concept in the Condition Status domain that best represents the point during the visit when the diagnosis was given. These can include admitting diagnosis, principal diagnosis, and secondary diagnosis. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Condition+Status&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Condition Status,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONDITION_OCCURRENCE,cdm,condition_status_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the condition status.,This information may be called something different in the source data but the field is meant to contain a value indicating when and how a diagnosis was given to a patient. This source value is mapped to a standard concept which is stored in the CONDITION_STATUS_CONCEPT_ID field.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,CONDITION_STATUS_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-CONDITION_OCCURRENCE,cdm,condition_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Condition record, as in whether the condition was from an EHR system, insurance claim, registry, or other sources.",Choose the CONDITION_TYPE_CONCEPT_ID that best represents the provenance of the record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-CONDITION_OCCURRENCE,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the PERSON for whom the condition is recorded.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+CONDITION_OCCURRENCE,cdm,condition_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Condition record, as in whether the condition was from an EHR system, insurance claim, registry, or other sources.",Choose the CONDITION_TYPE_CONCEPT_ID that best represents the provenance of the record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+CONDITION_OCCURRENCE,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the PERSON for whom the condition is recorded.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
CONDITION_OCCURRENCE,cdm,provider_id,No,,,integer,0,,"The provider associated with condition record, e.g. the provider who made the diagnosis or the provider who recorded the symptom.","The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record, for example the admitting vs attending physician on an EHR record.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_OCCURRENCE,cdm,stop_reason,No,,,varchar(20),0,,The Stop Reason indicates why a Condition is no longer valid with respect to the purpose within the source data. Note that a Stop Reason does not necessarily imply that the condition is no longer occurring.,This information is often not populated in source data and it is a valid etl choice to leave it blank if the information does not exist.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_OCCURRENCE,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the condition occurred. For example, if the person was in the ICU at the time of the diagnosis the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
CONDITION_OCCURRENCE,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the condition occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If a CONDITION_START_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the Visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the CONDITION_OCCURRENCE record.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
COST,cdm,amount_allowed,No,,,float,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COST,cdm,cost_domain_id,Yes,0,,varchar(20),0,,,,No,,,Yes,0,,DOMAIN,DOMAIN_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COST,cdm,cost_event_id,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COST,cdm,cost_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-COST,cdm,cost_type_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+COST,cdm,cost_domain_id,Yes,0,,varchar(20),0,,,,No,,,Yes,0,,DOMAIN,DOMAIN_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COST,cdm,cost_event_id,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COST,cdm,cost_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COST,cdm,cost_type_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
COST,cdm,currency_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
COST,cdm,drg_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-COST,cdm,drg_source_value,No,,,varchar(3),0,,Diagnosis Related Groups are US codes used to classify hospital cases into one of approximately 500 groups. ,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+COST,cdm,drg_source_value,No,,,varchar(3),0,,Diagnosis Related Groups are US codes used to classify hospital cases into one of approximately 500 groups.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
COST,cdm,paid_by_patient,No,,,float,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
COST,cdm,paid_by_payer,No,,,float,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
COST,cdm,paid_by_primary,No,,,float,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
@@ -146,65 +146,65 @@ COST,cdm,total_cost,No,,,float,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No
COST,cdm,total_paid,No,,,float,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
DEATH,cdm,cause_concept_id,No,,,integer,0,,"This is the Standard Concept representing the Person's cause of death, if available.","There is no specified domain for this concept, just choose the Standard Concept Id that best represents the person's cause of death.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
DEATH,cdm,cause_source_concept_id,No,,,integer,0,,,If the cause of death was coded using a Vocabulary present in the OMOP Vocabularies put the CONCEPT_ID representing the cause of death here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DEATH,cdm,cause_source_value,No,,,varchar(50),0,,,"If available, put the source code representing the cause of death here. ",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,CAUSE_SOURCE_CONCEPT_ID,,,,,,,,,,,,,,,Yes,,,
-DEATH,cdm,death_date,Yes,0,,date,0,,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
+DEATH,cdm,cause_source_value,No,,,varchar(50),0,,,"If available, put the source code representing the cause of death here.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,CAUSE_SOURCE_CONCEPT_ID,,,,,,,,,,,,,,,Yes,,,
+DEATH,cdm,death_date,Yes,0,,date,0,,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
DEATH,cdm,death_datetime,No,,,datetime,0,,,If not available set time to midnight (00:00:00),No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,,,,Yes,,,
DEATH,cdm,death_type_concept_id,No,,,integer,0,,"This is the provenance of the death record, i.e., where it came from. It is possible that an administrative claims database would source death information from a government file so do not assume the Death Type is the same as the Visit Type, etc.",Use the type concept that be reflects the source of the death record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
-DEATH,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
-DEVICE_EXPOSURE,cdm,device_concept_id,Yes,0,,integer,0,,"The DEVICE_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source concept id which represents a foreign object or instrument the person was exposed to. ",The CONCEPT_ID that the DEVICE_SOURCE_VALUE maps to. ,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Device,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DEATH,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,Yes,,,
+DEVICE_EXPOSURE,cdm,device_concept_id,Yes,0,,integer,0,,"The DEVICE_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source concept id which represents a foreign object or instrument the person was exposed to.",The CONCEPT_ID that the DEVICE_SOURCE_VALUE maps to.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Device,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DEVICE_EXPOSURE,cdm,device_exposure_end_date,No,,,date,0,,"The DEVICE_EXPOSURE_END_DATE denotes the day the device exposure ended for the patient, if given.",Put the end date or discontinuation date as it appears from the source data or leave blank if unavailable.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DEVICE_EXPOSURE,DEVICE_EXPOSURE_START_DATE,1,,Yes,1,,Yes,,,
DEVICE_EXPOSURE,cdm,device_exposure_end_datetime,No,,,datetime,0,,,If a source does not specify datetime the convention is to set the time to midnight (00:00:0000),No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DEVICE_EXPOSURE,DEVICE_EXPOSURE_START_DATETIME,1,,Yes,1,,Yes,,,
-DEVICE_EXPOSURE,cdm,device_exposure_id,Yes,0,,integer,0,,The unique key given to records a person's exposure to a foreign physical object or instrument.,Each instance of an exposure to a foreign object or device present in the source data should be assigned this unique key. ,Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DEVICE_EXPOSURE,cdm,device_exposure_start_date,Yes,0,,date,0,,Use this date to determine the start date of the device record.,"Valid entries include a start date of a procedure to implant a device, the date of a prescription for a device, or the date of device administration. ",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
+DEVICE_EXPOSURE,cdm,device_exposure_id,Yes,0,,integer,0,,The unique key given to records a person's exposure to a foreign physical object or instrument.,Each instance of an exposure to a foreign object or device present in the source data should be assigned this unique key.,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DEVICE_EXPOSURE,cdm,device_exposure_start_date,Yes,0,,date,0,,Use this date to determine the start date of the device record.,"Valid entries include a start date of a procedure to implant a device, the date of a prescription for a device, or the date of device administration.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
DEVICE_EXPOSURE,cdm,device_exposure_start_datetime,No,,,datetime,0,,,"This is not required, though it is in v6. If a source does not specify datetime the convention is to set the time to midnight (00:00:0000)",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
DEVICE_EXPOSURE,cdm,device_source_concept_id,No,,,integer,0,,"This is the concept representing the device source value and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Device necessary for a given analytic use case. Consider using DEVICE_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the DEVICE_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DEVICE_EXPOSURE,cdm,device_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the device exposure that occurred. For example, this could be an NDC or Gemscript code.",This code is mapped to a Standard Device Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,DEVICE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-DEVICE_EXPOSURE,cdm,device_type_concept_id,Yes,0,,integer,0,,"You can use the TYPE_CONCEPT_ID to denote the provenance of the record, as in whether the record is from administrative claims or EHR. ","Choose the drug_type_concept_id that best represents the provenance of the record, for example whether it came from a record of a prescription written or physician administered drug. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DEVICE_EXPOSURE,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DEVICE_EXPOSURE,cdm,device_type_concept_id,Yes,0,,integer,0,,"You can use the TYPE_CONCEPT_ID to denote the provenance of the record, as in whether the record is from administrative claims or EHR.","Choose the drug_type_concept_id that best represents the provenance of the record, for example whether it came from a record of a prescription written or physician administered drug. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DEVICE_EXPOSURE,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
DEVICE_EXPOSURE,cdm,production_id,No,,,varchar(255),0,,This is the Production Identifier (UDI-PI) portion of the Unique Device Identification.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
DEVICE_EXPOSURE,cdm,provider_id,No,,,integer,0,,"The Provider associated with device record, e.g. the provider who wrote the prescription or the provider who implanted the device.",The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DEVICE_EXPOSURE,cdm,quantity,No,,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
-DEVICE_EXPOSURE,cdm,unique_device_id,No,,,varchar(255),0,,"This is the Unique Device Identification (UDI-DI) number for devices regulated by the FDA, if given. ","For medical devices that are regulated by the FDA, a Unique Device Identification (UDI) is provided if available in the data source and is recorded in the UNIQUE_DEVICE_ID field.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DEVICE_EXPOSURE,cdm,unit_concept_id,No,,,integer,0,,UNIT_SOURCE_VALUES should be mapped to a Standard Concept in the Unit domain that best represents the unit as given in the source data. ,"There is no standardization requirement for units associated with DEVICE_CONCEPT_IDs, however, it is the responsibility of the ETL to choose the most plausible unit. If there is no unit associated with a Device record, set to NULL.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DEVICE_EXPOSURE,cdm,unit_source_concept_id,No,,,integer,0,,"This is the concept representing the UNIT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Unit necessary for a given analytic use case. Consider using UNIT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the UNIT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here. ,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DEVICE_EXPOSURE,cdm,unit_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the unit of the Device. For example, blood transfusions are considered devices and can be given in mL quantities. ","This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference. Using the blood transfusion example, blood transfusion is represented by the DEVICE_CONCEPT_ID and the unit (mL) would be housed in the UNIT_SOURCE_VALUE and mapped to a standard concept in the unit domain. ",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,UNIT_CONCEPT_ID,,,,,,,,,,,,,,,,,,
+DEVICE_EXPOSURE,cdm,unique_device_id,No,,,varchar(255),0,,"This is the Unique Device Identification (UDI-DI) number for devices regulated by the FDA, if given.","For medical devices that are regulated by the FDA, a Unique Device Identification (UDI) is provided if available in the data source and is recorded in the UNIQUE_DEVICE_ID field.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DEVICE_EXPOSURE,cdm,unit_concept_id,No,,,integer,0,,UNIT_SOURCE_VALUES should be mapped to a Standard Concept in the Unit domain that best represents the unit as given in the source data.,"There is no standardization requirement for units associated with DEVICE_CONCEPT_IDs, however, it is the responsibility of the ETL to choose the most plausible unit. If there is no unit associated with a Device record, set to NULL.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DEVICE_EXPOSURE,cdm,unit_source_concept_id,No,,,integer,0,,"This is the concept representing the UNIT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Unit necessary for a given analytic use case. Consider using UNIT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the UNIT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DEVICE_EXPOSURE,cdm,unit_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the unit of the Device. For example, blood transfusions are considered devices and can be given in mL quantities.","This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference. Using the blood transfusion example, blood transfusion is represented by the DEVICE_CONCEPT_ID and the unit (mL) would be housed in the UNIT_SOURCE_VALUE and mapped to a standard concept in the unit domain.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,UNIT_CONCEPT_ID,,,,,,,,,,,,,,,,,,
DEVICE_EXPOSURE,cdm,visit_detail_id,No,,,integer,0,,The Visit Detail during which the device was prescribed or given.,To populate this field device exposures must be explicitly initiated in the visit detail record.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DEVICE_EXPOSURE,cdm,visit_occurrence_id,No,,,integer,0,,The Visit during which the device was prescribed or given.,To populate this field device exposures must be explicitly initiated in the visit.,No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DOMAIN,vocab,domain_concept_id,Yes,0,,integer,0,,A Concept representing the Domain Concept the DOMAIN record belongs to.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DOMAIN,vocab,domain_id,Yes,0,,varchar(20),0,,A unique key for each domain.,,Yes,0,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DOMAIN,vocab,domain_concept_id,Yes,0,,integer,0,,A Concept representing the Domain Concept the DOMAIN record belongs to.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DOMAIN,vocab,domain_id,Yes,0,,varchar(20),0,,A unique key for each domain.,,Yes,0,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
DOMAIN,vocab,domain_name,Yes,0,,varchar(255),0,,"The name describing the Domain, e.g.
Condition, Procedure, Measurement
-etc.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DOSE_ERA,cdm,dose_era_end_date,Yes,0,,datetime,0,,,The date the Person was no longer exposed to the dosage of the specific drug ingredient. An era is ended if there are 31 days or more between dosage records.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
-DOSE_ERA,cdm,dose_era_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DOSE_ERA,cdm,dose_era_start_date,Yes,0,,datetime,0,,"The date the Person started on the specific dosage, with at least 31 days since any prior exposure.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-DOSE_ERA,cdm,dose_value,Yes,0,,float,0,,The numeric value of the dosage of the drug_ingredient.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,0,1,,,,,,,,,,No,,,Yes,,,
-DOSE_ERA,cdm,drug_concept_id,Yes,0,,integer,0,,The Concept Id representing the specific drug ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,Ingredient,0,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DOSE_ERA,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DOSE_ERA,cdm,unit_concept_id,Yes,0,,integer,0,,The Concept Id representing the unit of the specific drug ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DRUG_ERA,cdm,drug_concept_id,Yes,0,,integer,0,,The Concept Id representing the specific drug ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,Ingredient,0,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+etc.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DOSE_ERA,cdm,dose_era_end_date,Yes,0,,datetime,0,,,The date the Person was no longer exposed to the dosage of the specific drug ingredient. An era is ended if there are 31 days or more between dosage records.,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
+DOSE_ERA,cdm,dose_era_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DOSE_ERA,cdm,dose_era_start_date,Yes,0,,datetime,0,,"The date the Person started on the specific dosage, with at least 31 days since any prior exposure.",,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+DOSE_ERA,cdm,dose_value,Yes,0,,float,0,,The numeric value of the dosage of the drug_ingredient.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,0,1,,,,,,,,,,No,,,Yes,,,
+DOSE_ERA,cdm,drug_concept_id,Yes,0,,integer,0,,The Concept Id representing the specific drug ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,Ingredient,0,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DOSE_ERA,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DOSE_ERA,cdm,unit_concept_id,Yes,0,,integer,0,,The Concept Id representing the unit of the specific drug ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DRUG_ERA,cdm,drug_concept_id,Yes,0,,integer,0,,The Concept Id representing the specific drug ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,Ingredient,0,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DRUG_ERA,cdm,drug_era_end_date,Yes,0,,datetime,0,,,"The Drug Era End Date is the end date of the last Drug Exposure. The End Date of each Drug Exposure is either taken from the field drug_exposure_end_date or, as it is typically not available, inferred using the following rules:
For pharmacy prescription data, the date when the drug was dispensed plus the number of days of supply are used to extrapolate the End Date for the Drug Exposure. Depending on the country-specific healthcare system, this supply information is either explicitly provided in the day_supply field or inferred from package size or similar information.
For Procedure Drugs, usually the drug is administered on a single date (i.e., the administration date).
-A standard Persistence Window of 30 days (gap, slack) is permitted between two subsequent such extrapolated DRUG_EXPOSURE records to be considered to be merged into a single Drug Era.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DRUG_ERA,DRUG_ERA_START_DATE,1,,No,,,Yes,,,
-DRUG_ERA,cdm,drug_era_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DRUG_ERA,cdm,drug_era_start_date,Yes,0,,datetime,0,,,"The Drug Era Start Date is the start date of the first Drug Exposure for a given ingredient, with at least 31 days since the previous exposure. ",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+A standard Persistence Window of 30 days (gap, slack) is permitted between two subsequent such extrapolated DRUG_EXPOSURE records to be considered to be merged into a single Drug Era.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DRUG_ERA,DRUG_ERA_START_DATE,1,,No,,,Yes,,,
+DRUG_ERA,cdm,drug_era_id,Yes,0,,integer,0,,,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DRUG_ERA,cdm,drug_era_start_date,Yes,0,,datetime,0,,,"The Drug Era Start Date is the start date of the first Drug Exposure for a given ingredient, with at least 31 days since the previous exposure.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
DRUG_ERA,cdm,drug_exposure_count,No,,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
DRUG_ERA,cdm,gap_days,No,,,integer,0,,,"The Gap Days determine how many total drug-free days are observed between all Drug Exposure events that contribute to a DRUG_ERA record. It is assumed that the drugs are ""not stockpiled"" by the patient, i.e. that if a new drug prescription or refill is observed (a new DRUG_EXPOSURE record is written), the remaining supply from the previous events is abandoned. The difference between Persistence Window and Gap Days is that the former is the maximum drug-free time allowed between two subsequent DRUG_EXPOSURE records, while the latter is the sum of actual drug-free days for the given Drug Era under the above assumption of non-stockpiling.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,0,1,,,,,,,,,,No,,,Yes,,,
-DRUG_ERA,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DRUG_ERA,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DRUG_EXPOSURE,cdm,days_supply,No,,,integer,0,,,Days supply of the drug. This should be the verbatim days_supply as given on the prescription. If the drug is physician administered use duration end date if given or set to 1 as default if duration is not available.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,0,1,,365,1,,,,,,,No,,,Yes,,,
DRUG_EXPOSURE,cdm,dose_unit_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the dose unit of the drug given.,This information may be called something different in the source data but the field is meant to contain a value indicating the unit of dosage of drug given to the patient. **This is an older column and will be deprecated in an upcoming version.**,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DRUG_EXPOSURE,cdm,drug_concept_id,Yes,0,,integer,0,,"The DRUG_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source concept id which represents a drug product or molecule otherwise introduced to the body. The drug concepts can have a varying degree of information about drug strength and dose. This information is relevant in the context of quantity and administration information in the subsequent fields plus strength information from the DRUG_STRENGTH table, provided as part of the standard vocabulary download.","The CONCEPT_ID that the DRUG_SOURCE_VALUE maps to. The concept id should be derived either from mapping from the source concept id or by picking the drug concept representing the most amount of detail you have. Records whose source values map to standard concepts with a domain of Drug should go in this table. When the Drug Source Value of the code cannot be translated into Standard Drug Concept IDs, a Drug exposure entry is stored with only the corresponding SOURCE_CONCEPT_ID and DRUG_SOURCE_VALUE and a DRUG_CONCEPT_ID of 0. The Drug Concept with the most detailed content of information is preferred during the mapping process. These are indicated in the CONCEPT_CLASS_ID field of the Concept and are recorded in the following order of precedence: 'Branded Pack', 'Clinical Pack', 'Branded Drug', 'Clinical Drug', 'Branded Drug Component', 'Clinical Drug Component', 'Branded Drug Form', 'Clinical Drug Form', and only if no other information is available 'Ingredient'. Note: If only the drug class is known, the DRUG_CONCEPT_ID field should contain 0. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Drug&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DRUG_EXPOSURE,cdm,drug_exposure_end_date,Yes,0,,date,0,,The DRUG_EXPOSURE_END_DATE denotes the day the drug exposure ended for the patient.,"If this information is not explicitly available in the data, infer the end date using the following methods:
1. Start first with duration or days supply using the calculation drug start date + days supply -1 day. 2. Use quantity divided by daily dose that you may obtain from the sig or a source field (or assumed daily dose of 1) for solid, indivisibile, drug products. If quantity represents ingredient amount, quantity divided by daily dose * concentration (from drug_strength) drug concept id tells you the dose form. 3. If it is an administration record, set drug end date equal to drug start date. If the record is a written prescription then set end date to start date + 29. If the record is a mail-order prescription set end date to start date + 89. The end date must be equal to or greater than the start date. Ibuprofen 20mg/mL oral solution concept tells us this is oral solution. Calculate duration as quantity (200 example) * daily dose (5mL) /concentration (20mg/mL) 200*5/20 = 50 days. [Examples by dose form](https://ohdsi.github.io/CommonDataModel/drug_dose.html)",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DRUG_EXPOSURE,DRUG_EXPOSURE_START_DATE,1,,Yes,1,,Yes,,,
+DRUG_EXPOSURE,cdm,drug_concept_id,Yes,0,,integer,0,,"The DRUG_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source concept id which represents a drug product or molecule otherwise introduced to the body. The drug concepts can have a varying degree of information about drug strength and dose. This information is relevant in the context of quantity and administration information in the subsequent fields plus strength information from the DRUG_STRENGTH table, provided as part of the standard vocabulary download.","The CONCEPT_ID that the DRUG_SOURCE_VALUE maps to. The concept id should be derived either from mapping from the source concept id or by picking the drug concept representing the most amount of detail you have. Records whose source values map to standard concepts with a domain of Drug should go in this table. When the Drug Source Value of the code cannot be translated into Standard Drug Concept IDs, a Drug exposure entry is stored with only the corresponding SOURCE_CONCEPT_ID and DRUG_SOURCE_VALUE and a DRUG_CONCEPT_ID of 0. The Drug Concept with the most detailed content of information is preferred during the mapping process. These are indicated in the CONCEPT_CLASS_ID field of the Concept and are recorded in the following order of precedence: 'Branded Pack', 'Clinical Pack', 'Branded Drug', 'Clinical Drug', 'Branded Drug Component', 'Clinical Drug Component', 'Branded Drug Form', 'Clinical Drug Form', and only if no other information is available 'Ingredient'. Note: If only the drug class is known, the DRUG_CONCEPT_ID field should contain 0. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Drug&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DRUG_EXPOSURE,cdm,drug_exposure_end_date,Yes,0,,date,0,,The DRUG_EXPOSURE_END_DATE denotes the day the drug exposure ended for the patient.,"If this information is not explicitly available in the data, infer the end date using the following methods:
1. Start first with duration or days supply using the calculation drug start date + days supply -1 day. 2. Use quantity divided by daily dose that you may obtain from the sig or a source field (or assumed daily dose of 1) for solid, indivisibile, drug products. If quantity represents ingredient amount, quantity divided by daily dose * concentration (from drug_strength) drug concept id tells you the dose form. 3. If it is an administration record, set drug end date equal to drug start date. If the record is a written prescription then set end date to start date + 29. If the record is a mail-order prescription set end date to start date + 89. The end date must be equal to or greater than the start date. Ibuprofen 20mg/mL oral solution concept tells us this is oral solution. Calculate duration as quantity (200 example) * daily dose (5mL) /concentration (20mg/mL) 200*5/20 = 50 days. [Examples by dose form](https://ohdsi.github.io/CommonDataModel/drug_dose.html)",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DRUG_EXPOSURE,DRUG_EXPOSURE_START_DATE,1,,Yes,1,,Yes,,,
DRUG_EXPOSURE,cdm,drug_exposure_end_datetime,No,,,datetime,0,,,"This is not required, though it is in v6. If a source does not specify datetime the convention is to set the time to midnight (00:00:0000)",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DRUG_EXPOSURE,DRUG_EXPOSURE_START_DATETIME,1,,Yes,1,,Yes,,,
-DRUG_EXPOSURE,cdm,drug_exposure_id,Yes,0,,integer,0,,The unique key given to records of drug dispensings or administrations for a person. Refer to the ETL for how duplicate drugs during the same visit were handled.,"Each instance of a drug dispensing or administration present in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same drug within the same visit. It is valid to keep these duplicates and assign them individual, unique, DRUG_EXPOSURE_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_EXPOSURE,cdm,drug_exposure_start_date,Yes,0,,date,0,,Use this date to determine the start date of the drug record.,"Valid entries include a start date of a prescription, the date a prescription was filled, or the date on which a Drug administration was recorded. It is a valid ETL choice to use the date the drug was ordered as the DRUG_EXPOSURE_START_DATE.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
+DRUG_EXPOSURE,cdm,drug_exposure_id,Yes,0,,integer,0,,The unique key given to records of drug dispensings or administrations for a person. Refer to the ETL for how duplicate drugs during the same visit were handled.,"Each instance of a drug dispensing or administration present in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same drug within the same visit. It is valid to keep these duplicates and assign them individual, unique, DRUG_EXPOSURE_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_EXPOSURE,cdm,drug_exposure_start_date,Yes,0,,date,0,,Use this date to determine the start date of the drug record.,"Valid entries include a start date of a prescription, the date a prescription was filled, or the date on which a Drug administration was recorded. It is a valid ETL choice to use the date the drug was ordered as the DRUG_EXPOSURE_START_DATE.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
DRUG_EXPOSURE,cdm,drug_exposure_start_datetime,No,,,datetime,0,,,"This is not required, though it is in v6. If a source does not specify datetime the convention is to set the time to midnight (00:00:0000)",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
DRUG_EXPOSURE,cdm,drug_source_concept_id,No,,,integer,0,,"This is the concept representing the drug source value and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Drug necessary for a given analytic use case. Consider using DRUG_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the DRUG_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,10,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DRUG_EXPOSURE,cdm,drug_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the drug exposure that occurred. For example, this could be an NDC or Gemscript code.",This code is mapped to a Standard Drug Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,10,,DRUG_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-DRUG_EXPOSURE,cdm,drug_type_concept_id,Yes,0,,integer,0,,"You can use the TYPE_CONCEPT_ID to delineate between prescriptions written vs. prescriptions dispensed vs. medication history vs. patient-reported exposure, etc.","Choose the drug_type_concept_id that best represents the provenance of the record, for example whether it came from a record of a prescription written or physician administered drug. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,100,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+DRUG_EXPOSURE,cdm,drug_type_concept_id,Yes,0,,integer,0,,"You can use the TYPE_CONCEPT_ID to delineate between prescriptions written vs. prescriptions dispensed vs. medication history vs. patient-reported exposure, etc.","Choose the drug_type_concept_id that best represents the provenance of the record, for example whether it came from a record of a prescription written or physician administered drug. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DRUG_EXPOSURE,cdm,lot_number,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DRUG_EXPOSURE,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the PERSON for whom the drug dispensing or administration is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_EXPOSURE,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the PERSON for whom the drug dispensing or administration is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
DRUG_EXPOSURE,cdm,provider_id,No,,,integer,0,,"The Provider associated with drug record, e.g. the provider who wrote the prescription or the provider who administered the drug.","The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record, for example the ordering vs administering physician on an EHR record.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DRUG_EXPOSURE,cdm,quantity,No,,,float,0,,,"To find the dose form of a drug the RELATIONSHIP table can be used where the relationship_id is 'Has dose form'. If liquid, quantity stands for the total amount dispensed or ordered of ingredient in the units given by the drug_strength table. If the unit from the source data does not align with the unit in the DRUG_STRENGTH table the quantity should be converted to the correct unit given in DRUG_STRENGTH. For clinical drugs with fixed dose forms (tablets etc.) the quantity is the number of units/tablets/capsules prescribed or dispensed (can be partial, but then only 1/2 or 1/3, not 0.01). Clinical drugs with divisible dose forms (injections) the quantity is the amount of ingredient the patient got. For example, if the injection is 2mg/mL but the patient got 80mL then quantity is reported as 160.
Quantified clinical drugs with divisible dose forms (prefilled syringes), the quantity is the amount of ingredient similar to clinical drugs. Please see [how to calculate drug dose](https://ohdsi.github.io/CommonDataModel/drug_dose.html) for more information.
@@ -217,113 +217,113 @@ DRUG_EXPOSURE,cdm,stop_reason,No,,,varchar(20),0,,"The reason a person stopped a
DRUG_EXPOSURE,cdm,verbatim_end_date,No,,,date,0,,"This is the end date of the drug exposure as it appears in the source data, if it is given",Put the end date or discontinuation date as it appears from the source data or leave blank if unavailable.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,DRUG_EXPOSURE,DRUG_EXPOSURE_START_DATE,1,,Yes,1,,Yes,,,
DRUG_EXPOSURE,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the drug exposure occurred. For example, if the person was in the ICU at the time of the drug administration the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
DRUG_EXPOSURE,cdm,visit_occurrence_id,No,,,integer,0,,"The Visit during which the drug was prescribed, administered or dispensed.",To populate this field drug exposures must be explicitly initiated in the visit.,No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-DRUG_STRENGTH,vocab,amount_unit_concept_id,No,,,integer,0,,The Concept representing the Unit of measure for the amount of active ingredient contained within the drug product. ,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,amount_value,No,,,float,0,,The numeric value or the amount of active ingredient contained within the drug product.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,box_size,No,,,integer,0,,The number of units of Clinical Branded Drug or Quantified Clinical or Branded Drug contained in a box as dispensed to the patient.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,denominator_unit_concept_id,No,,,integer,0,,The Concept representing the denominator unit for the concentration of active ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,denominator_value,No,,,float,0,,"The amount of total liquid (or other divisible product, such as ointment, gel, spray, etc.).",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,drug_concept_id,Yes,0,,integer,0,,The Concept representing the Branded Drug or Clinical Drug Product.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,ingredient_concept_id,Yes,0,,integer,0,,The Concept representing the active ingredient contained within the drug product.,"Combination Drugs will have more than one record in this table, one for each active Ingredient.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,Ingredient,0,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the concept was invalidated. Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,numerator_unit_concept_id,No,,,integer,0,,The Concept representing the Unit of measure for the concentration of active ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-DRUG_STRENGTH,vocab,numerator_value,No,,,float,0,,The concentration of the active ingredient contained within the drug product.,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,amount_unit_concept_id,No,,,integer,0,,The Concept representing the Unit of measure for the amount of active ingredient contained within the drug product.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,amount_value,No,,,float,0,,The numeric value or the amount of active ingredient contained within the drug product.,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,box_size,No,,,integer,0,,The number of units of Clinical Branded Drug or Quantified Clinical or Branded Drug contained in a box as dispensed to the patient.,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,denominator_unit_concept_id,No,,,integer,0,,The Concept representing the denominator unit for the concentration of active ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,denominator_value,No,,,float,0,,"The amount of total liquid (or other divisible product, such as ointment, gel, spray, etc.).",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,drug_concept_id,Yes,0,,integer,0,,The Concept representing the Branded Drug or Clinical Drug Product.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Drug,0,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,ingredient_concept_id,Yes,0,,integer,0,,The Concept representing the active ingredient contained within the drug product.,"Combination Drugs will have more than one record in this table, one for each active Ingredient.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,Ingredient,0,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the concept was invalidated. Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,numerator_unit_concept_id,No,,,integer,0,,The Concept representing the Unit of measure for the concentration of active ingredient.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+DRUG_STRENGTH,vocab,numerator_value,No,,,float,0,,The concentration of the active ingredient contained within the drug product.,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
DRUG_STRENGTH,vocab,valid_end_date,Yes,0,,date,0,,The date when then Concept became invalid.,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,Yes,DRUG_STRENGTH,VALID_START_DATE,0,,,,,,,,
DRUG_STRENGTH,vocab,valid_start_date,Yes,0,,date,0,,"The date when the Concept was first
recorded. The default value is
1-Jan-1970.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_concept_id,Yes,0,,integer,0,,"The EPISODE_CONCEPT_ID represents the kind abstraction related to the disease phase, outcome or treatment.","Choose a concept in the Episode domain that best represents the ongoing disease phase, outcome, or treatment. Please see [article] for cancers and [article] for non-cancers describing how these are defined. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Episode&page=1&pageSize=15&query=)",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Episode,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_end_date,No,,,date,0,,The date when the instance of the Episode is considered to have ended.,Please see [article] for how to define an Episode end date.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,EPISODE,EPISODE_START_DATE,1,,Yes,1,,Yes,,,
-EPISODE,cdm,episode_end_datetime,No,,,datetime,0,,The date when the instance of the Episode is considered to have ended.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,EPISODE,EPISODE_START_DATETIME,1,,Yes,1,,Yes,,,
-EPISODE,cdm,episode_id,Yes,0,,bigint,0,,A unique identifier for each Episode.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_number,No,,,integer,0,,"For sequences of episodes, this is used to indicate the order the episodes occurred. For example, lines of treatment could be indicated here. ",Please see [article] for the details of how to count episodes.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_object_concept_id,Yes,0,,integer,0,,"A Standard Concept representing the disease phase, outcome, or other abstraction of which the episode consists. For example, if the EPISODE_CONCEPT_ID is [treatment regimen](https://athena.ohdsi.org/search-terms/terms/32531) then the EPISODE_OBJECT_CONCEPT_ID should contain the chemotherapy regimen concept, like [Afatinib monotherapy](https://athena.ohdsi.org/search-terms/terms/35804392). ",Episode entries from the 'Disease Episode' concept class should have an episode_object_concept_id that comes from the Condition domain. Episode entries from the 'Treatment Episode' concept class should have an episode_object_concept_id that scome from the 'Procedure' domain or 'Regimen' concept class.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Procedure OR Regimen,0,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_parent_id,No,,,bigint,0,,Use this field to find the Episode that subsumes the given Episode record. This is used in the case that an Episode are nested into each other.,"If there are multiple nested levels to how Episodes are represented, the EPISODE_PARENT_ID can be used to record this relationship. ",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_source_concept_id,No,,,integer,0,,A foreign key to a Episode Concept that refers to the code used in the source.,Given that the Episodes are user-defined it is unlikely that there will be a Source Concept available. If that is the case then set this field to zero. ,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,No,,,
-EPISODE,cdm,episode_source_value,No,,,varchar(50),0,,The source code for the Episdoe as it appears in the source data. This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,episode_start_date,Yes,0,,date,0,,The date when the Episode beings. ,Please see [article] for how to define an Episode start date.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-EPISODE,cdm,episode_start_datetime,No,,,datetime,0,,The date and time when the Episode begins.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-EPISODE,cdm,episode_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Episode record, as in whether the episode was from an EHR system, insurance claim, registry, or other sources.",Choose the EPISODE_TYPE_CONCEPT_ID that best represents the provenance of the record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE,cdm,person_id,Yes,0,,bigint,0,,The PERSON_ID of the PERSON for whom the episode is recorded.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE_EVENT,cdm,episode_event_field_concept_id,Yes,0,,integer,0,,This field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ,Put the CONCEPT_ID that identifies which table and field the EVENT_ID came from. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?vocabulary=CDM&conceptClass=Field&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,Metadata,0,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE_EVENT,cdm,episode_id,Yes,0,,bigint,0,,Use this field to link the EPISODE_EVENT record to its EPISODE.,Put the EPISODE_ID that subsumes the EPISODE_EVENT record here.,No,,,Yes,0,,EPISODE,EPISODE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-EPISODE_EVENT,cdm,event_id,Yes,0,,bigint,0,,"This field is the primary key of the linked record in the database. For example, if the Episode Event is a Condition Occurrence, then the CONDITION_OCCURRENCE_ID of the linked record goes in this field. ",Put the primary key of the linked record here. ,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-FACT_RELATIONSHIP,cdm,domain_concept_id_1,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-FACT_RELATIONSHIP,cdm,domain_concept_id_2,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-FACT_RELATIONSHIP,cdm,fact_id_1,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-FACT_RELATIONSHIP,cdm,fact_id_2,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-FACT_RELATIONSHIP,cdm,relationship_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,address_1,No,,,varchar(50),0,,This is the first line of the address.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,address_2,No,,,varchar(50),0,,This is the second line of the address,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,city,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,country_concept_id,No,,,integer,0,,The Concept Id representing the country. Values should conform to the [Geography](https://athena.ohdsi.org/search-terms/terms?domain=Geography&standardConcept=Standard&page=1&pageSize=15&query=&boosts) domain. ,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Geography,0,,,,,Yes,0,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-LOCATION,cdm,country_source_value,No,,,varchar(80),0,,The name of the country.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-LOCATION,cdm,county,No,,,varchar(20),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,latitude,No,,,float,0,,,Must be between -90 and 90.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-LOCATION,cdm,location_id,Yes,0,,integer,0,,The unique key given to a unique Location.,Each instance of a Location in the source data should be assigned this unique key.,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,location_source_value,No,,,varchar(50),0,,,"Put the verbatim value for the location here, as it shows up in the source. ",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,longitude,No,,,float,0,,,Must be between -180 and 180.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-LOCATION,cdm,state,No,,,varchar(2),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-LOCATION,cdm,zip,No,,,varchar(9),0,,,"Zip codes are handled as strings of up to 9 characters length. For US addresses, these represent either a 3-digit abbreviated Zip code as provided by many sources for patient protection reasons, the full 5-digit Zip or the 9-digit (ZIP + 4) codes. Unless for specific reasons analytical methods should expect and utilize only the first 3 digits. For international addresses, different rules apply.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-MEASUREMENT,cdm,meas_event_field_concept_id,No,,,integer,0,,"If the Measurement record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the MEASUREMENT_EVENT_ID came from.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-MEASUREMENT,cdm,measurement_concept_id,Yes,0,,integer,0,,"The MEASUREMENT_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies.","The CONCEPT_ID that the MEASUREMENT_SOURCE_CONCEPT_ID maps to. Only records whose SOURCE_CONCEPT_IDs map to Standard Concepts with a domain of ""Measurement"" should go in this table.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Measurement,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,measurement_date,Yes,0,,date,0,,Use this date to determine the date of the measurement.,"If there are multiple dates in the source data associated with a record such as order_date, draw_date, and result_date, choose the one that is closest to the date the sample was drawn from the patient.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,Yes,5,
-MEASUREMENT,cdm,measurement_datetime,No,,,datetime,0,,,"This is not required, though it is in v6. If a source does not specify datetime the convention is to set the time to midnight (00:00:0000)",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,measurement_event_id,No,,,bigint,0,,"If the Measurement record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-MEASUREMENT,cdm,measurement_id,Yes,0,,integer,0,,The unique key given to a Measurement record for a Person. Refer to the ETL for how duplicate Measurements during the same Visit were handled.,"Each instance of a measurement present in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same measurement within the same visit. It is valid to keep these duplicates and assign them individual, unique, MEASUREMENT_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,measurement_source_concept_id,No,,,integer,0,,"This is the concept representing the MEASUREMENT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Measurement necessary for a given analytic use case. Consider using MEASUREMENT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the MEASUREMENT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,measurement_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the Measurement that occurred. For example, this could be an ICD10 or Read code.",This code is mapped to a Standard Measurement Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,MEASUREMENT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,measurement_time,No,,,varchar(10),0,,,This is present for backwards compatibility and will be deprecated in an upcoming version.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,measurement_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Measurement record, as in whether the measurement was from an EHR system, insurance claim, registry, or other sources.","Choose the MEASUREMENT_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,operator_concept_id,No,,,integer,0,,"The meaning of Concept [4172703](https://athena.ohdsi.org/search-terms/terms/4172703) for '=' is identical to omission of a OPERATOR_CONCEPT_ID value. Since the use of this field is rare, it's important when devising analyses to not to forget testing for the content of this field for values different from =.","Operators are <, <=, =, >=, > and these concepts belong to the 'Meas Value Operator' domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Meas+Value+Operator&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Meas Value Operator,0,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the Person for whom the Measurement is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,provider_id,No,,,integer,0,,"The provider associated with measurement record, e.g. the provider who ordered the test or the provider who recorded the result.",The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record. For example the admitting vs attending physician on an EHR record.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,range_high,No,,,float,0,,Ranges have the same unit as the VALUE_AS_NUMBER. These ranges are provided by the source and should remain NULL if not given.,If reference ranges for upper and lower limit of normal as provided (typically by a laboratory) these are stored in the RANGE_HIGH and RANGE_LOW fields. This should be set to NULL if not provided.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,range_low,No,,,float,0,,Ranges have the same unit as the VALUE_AS_NUMBER. These ranges are provided by the source and should remain NULL if not given.,If reference ranges for upper and lower limit of normal as provided (typically by a laboratory) these are stored in the RANGE_HIGH and RANGE_LOW fields. This should be set to NULL if not provided.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,unit_concept_id,No,,,integer,0,,"There is currently no recommended unit for individual measurements, i.e. it is not mandatory to represent Hemoglobin a1C measurements as a percentage. UNIT_SOURCE_VALUES should be mapped to a Standard Concept in the Unit domain that best represents the unit as given in the source data.","There is no standardization requirement for units associated with MEASUREMENT_CONCEPT_IDs, however, it is the responsibility of the ETL to choose the most plausible unit.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,unit_source_concept_id,No,,,integer,0,,"""This is the concept representing the UNIT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Measurement necessary for a given analytic use case. Consider using UNIT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.""",If the UNIT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,50,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,unit_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the unit of the Measurement that occurred. ,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,UNIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,value_as_concept_id,No,,,integer,0,,If the raw data gives a categorial result for measurements those values are captured and mapped to standard concepts in the 'Meas Value' domain.,"If the raw data provides categorial results as well as continuous results for measurements, it is a valid ETL choice to preserve both values. The continuous value should go in the VALUE_AS_NUMBER field and the categorical value should be mapped to a standard concept in the 'Meas Value' domain and put in the VALUE_AS_CONCEPT_ID field. This is also the destination for the 'Maps to value' relationship.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Meas Value,0,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,value_as_number,No,,,float,0,,"This is the numerical value of the Result of the Measurement, if available. Note that measurements such as blood pressures will be split into their component parts i.e. one record for systolic, one record for diastolic.","If there is a negative value coming from the source, set the VALUE_AS_NUMBER to NULL, with the exception of the following Measurements (listed as LOINC codes):
- [1925-7](https://athena.ohdsi.org/search-terms/terms/3003396) Base excess in Arterial blood by calculation - [1927-3](https://athena.ohdsi.org/search-terms/terms/3002032) Base excess in Venous blood by calculation - [8632-2](https://athena.ohdsi.org/search-terms/terms/3006277) QRS-Axis - [11555-0](https://athena.ohdsi.org/search-terms/terms/3012501) Base excess in Blood by calculation - [1926-5](https://athena.ohdsi.org/search-terms/terms/3003129) Base excess in Capillary blood by calculation - [28638-5](https://athena.ohdsi.org/search-terms/terms/3004959) Base excess in Arterial cord blood by calculation [28639-3](https://athena.ohdsi.org/search-terms/terms/3007435) Base excess in Venous cord blood by calculation",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,value_source_value,No,,,varchar(50),0,,This field houses the verbatim result value of the Measurement from the source data . ,"If both a continuous and categorical result are given in the source data such that both VALUE_AS_NUMBER and VALUE_AS_CONCEPT_ID are both included, store the verbatim value that was mapped to VALUE_AS_CONCEPT_ID here.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the Measurement occurred. For example, if the Person was in the ICU at the time the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-MEASUREMENT,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the Measurement occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If a MEASUREMENT_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the measurement record. If a measurement is related to a visit explicitly in the source data, it is possible that the result date of the Measurement falls outside of the bounds of the Visit dates.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-METADATA,cdm,metadata_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,metadata_date,No,,,date,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,metadata_datetime,No,,,datetime,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,metadata_id,Yes,0,,integer,0,,The unique key given to a Metadata record.,Attribute value is auto-generated,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,metadata_type_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,name,Yes,0,,varchar(250),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,value_as_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,value_as_number,No,,,float,0,,"This is the numerical value of the result of the Metadata, if applicable and available. It is not expected that all Metadata will have numeric results, rather, this field is here to house values should they exist. ",,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-METADATA,cdm,value_as_string,No,,,varchar(250),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-NOTE,cdm,encoding_concept_id,Yes,0,,integer,0,,This is the Concept representing the character encoding type. ,"Put the Concept Id that represents the encoding character type here. Currently the only option is UTF-8 ([32678](https://athena.ohdsi.org/search-terms/terms/32678)). It the note is encoded in any other type, like ASCII then put 0. ",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,language_concept_id,Yes,0,,integer,0,,The language of the note. ,Use Concepts that are descendants of the concept [4182347](https://athena.ohdsi.org/search-terms/terms/4182347) (World Languages).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+EPISODE,cdm,episode_concept_id,Yes,0,,integer,0,,"The EPISODE_CONCEPT_ID represents the kind abstraction related to the disease phase, outcome or treatment.","Choose a concept in the Episode domain that best represents the ongoing disease phase, outcome, or treatment. Please see [article] for cancers and [article] for non-cancers describing how these are defined. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Episode&page=1&pageSize=15&query=)",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Episode,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,episode_end_date,No,,,date,0,,The date when the instance of the Episode is considered to have ended.,Please see [article] for how to define an Episode end date.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,EPISODE,EPISODE_START_DATE,1,,Yes,1,,Yes,,,
+EPISODE,cdm,episode_end_datetime,No,,,datetime,0,,The date when the instance of the Episode is considered to have ended.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,EPISODE,EPISODE_START_DATETIME,1,,Yes,1,,Yes,,,
+EPISODE,cdm,episode_id,Yes,0,,bigint,0,,A unique identifier for each Episode.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,episode_number,No,,,integer,0,,"For sequences of episodes, this is used to indicate the order the episodes occurred. For example, lines of treatment could be indicated here.",Please see [article] for the details of how to count episodes.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,episode_object_concept_id,Yes,0,,integer,0,,"A Standard Concept representing the disease phase, outcome, or other abstraction of which the episode consists. For example, if the EPISODE_CONCEPT_ID is [treatment regimen](https://athena.ohdsi.org/search-terms/terms/32531) then the EPISODE_OBJECT_CONCEPT_ID should contain the chemotherapy regimen concept, like [Afatinib monotherapy](https://athena.ohdsi.org/search-terms/terms/35804392).",Episode entries from the 'Disease Episode' concept class should have an episode_object_concept_id that comes from the Condition domain. Episode entries from the 'Treatment Episode' concept class should have an episode_object_concept_id that scome from the 'Procedure' domain or 'Regimen' concept class.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Procedure OR Regimen,0,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,episode_parent_id,No,,,bigint,0,,Use this field to find the Episode that subsumes the given Episode record. This is used in the case that an Episode are nested into each other.,"If there are multiple nested levels to how Episodes are represented, the EPISODE_PARENT_ID can be used to record this relationship.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,episode_source_concept_id,No,,,integer,0,,A foreign key to a Episode Concept that refers to the code used in the source.,Given that the Episodes are user-defined it is unlikely that there will be a Source Concept available. If that is the case then set this field to zero.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,No,,,
+EPISODE,cdm,episode_source_value,No,,,varchar(50),0,,The source code for the Episdoe as it appears in the source data. This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,episode_start_date,Yes,0,,date,0,,The date when the Episode beings.,Please see [article] for how to define an Episode start date.,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+EPISODE,cdm,episode_start_datetime,No,,,datetime,0,,The date and time when the Episode begins.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+EPISODE,cdm,episode_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Episode record, as in whether the episode was from an EHR system, insurance claim, registry, or other sources.",Choose the EPISODE_TYPE_CONCEPT_ID that best represents the provenance of the record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE,cdm,person_id,Yes,0,,bigint,0,,The PERSON_ID of the PERSON for whom the episode is recorded.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE_EVENT,cdm,episode_event_field_concept_id,Yes,0,,integer,0,,This field is the CONCEPT_ID that identifies which table the primary key of the linked record came from.,Put the CONCEPT_ID that identifies which table and field the EVENT_ID came from. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?vocabulary=CDM&conceptClass=Field&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,Metadata,0,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE_EVENT,cdm,episode_id,Yes,0,,bigint,0,,Use this field to link the EPISODE_EVENT record to its EPISODE.,Put the EPISODE_ID that subsumes the EPISODE_EVENT record here.,No,,,Yes,0,,EPISODE,EPISODE_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+EPISODE_EVENT,cdm,event_id,Yes,0,,bigint,0,,"This field is the primary key of the linked record in the database. For example, if the Episode Event is a Condition Occurrence, then the CONDITION_OCCURRENCE_ID of the linked record goes in this field.",Put the primary key of the linked record here.,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+FACT_RELATIONSHIP,cdm,domain_concept_id_1,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,0,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+FACT_RELATIONSHIP,cdm,domain_concept_id_2,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,0,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+FACT_RELATIONSHIP,cdm,fact_id_1,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+FACT_RELATIONSHIP,cdm,fact_id_2,Yes,0,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+FACT_RELATIONSHIP,cdm,relationship_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,0,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,address_1,No,,,varchar(50),0,,This is the first line of the address.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,address_2,No,,,varchar(50),0,,This is the second line of the address,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,city,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,country_concept_id,No,,,integer,0,,The Concept Id representing the country. Values should conform to the [Geography](https://athena.ohdsi.org/search-terms/terms?domain=Geography&standardConcept=Standard&page=1&pageSize=15&query=&boosts) domain.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Geography,0,,,,,Yes,0,,Yes,100,,Yes,100,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+LOCATION,cdm,country_source_value,No,,,varchar(80),0,,The name of the country.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+LOCATION,cdm,county,No,,,varchar(20),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,latitude,No,,,float,0,,,Must be between -90 and 90.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+LOCATION,cdm,location_id,Yes,0,,integer,0,,The unique key given to a unique Location.,Each instance of a Location in the source data should be assigned this unique key.,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,location_source_value,No,,,varchar(50),0,,,"Put the verbatim value for the location here, as it shows up in the source.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,longitude,No,,,float,0,,,Must be between -180 and 180.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+LOCATION,cdm,state,No,,,varchar(2),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+LOCATION,cdm,zip,No,,,varchar(9),0,,,"Zip codes are handled as strings of up to 9 characters length. For US addresses, these represent either a 3-digit abbreviated Zip code as provided by many sources for patient protection reasons, the full 5-digit Zip or the 9-digit (ZIP + 4) codes. Unless for specific reasons analytical methods should expect and utilize only the first 3 digits. For international addresses, different rules apply.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+MEASUREMENT,cdm,meas_event_field_concept_id,No,,,integer,0,,"If the Measurement record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from.",Put the CONCEPT_ID that identifies which table and field the MEASUREMENT_EVENT_ID came from.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+MEASUREMENT,cdm,measurement_concept_id,Yes,0,,integer,0,,"The MEASUREMENT_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies.","The CONCEPT_ID that the MEASUREMENT_SOURCE_CONCEPT_ID maps to. Only records whose SOURCE_CONCEPT_IDs map to Standard Concepts with a domain of ""Measurement"" should go in this table.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Measurement,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,measurement_date,Yes,0,,date,0,,Use this date to determine the date of the measurement.,"If there are multiple dates in the source data associated with a record such as order_date, draw_date, and result_date, choose the one that is closest to the date the sample was drawn from the patient.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,Yes,5,
+MEASUREMENT,cdm,measurement_datetime,No,,,datetime,0,,,"This is not required, though it is in v6. If a source does not specify datetime the convention is to set the time to midnight (00:00:0000)",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,measurement_event_id,No,,,bigint,0,,"If the Measurement record is related to another record in the database, this field is the primary key of the linked record.","Put the primary key of the linked record, if applicable, here.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+MEASUREMENT,cdm,measurement_id,Yes,0,,integer,0,,The unique key given to a Measurement record for a Person. Refer to the ETL for how duplicate Measurements during the same Visit were handled.,"Each instance of a measurement present in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same measurement within the same visit. It is valid to keep these duplicates and assign them individual, unique, MEASUREMENT_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,measurement_source_concept_id,No,,,integer,0,,"This is the concept representing the MEASUREMENT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Measurement necessary for a given analytic use case. Consider using MEASUREMENT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the MEASUREMENT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,measurement_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the Measurement that occurred. For example, this could be an ICD10 or Read code.",This code is mapped to a Standard Measurement Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,MEASUREMENT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,measurement_time,No,,,varchar(10),0,,,This is present for backwards compatibility and will be deprecated in an upcoming version.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,measurement_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Measurement record, as in whether the measurement was from an EHR system, insurance claim, registry, or other sources.","Choose the MEASUREMENT_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,operator_concept_id,No,,,integer,0,,"The meaning of Concept [4172703](https://athena.ohdsi.org/search-terms/terms/4172703) for '=' is identical to omission of a OPERATOR_CONCEPT_ID value. Since the use of this field is rare, it's important when devising analyses to not to forget testing for the content of this field for values different from =.","Operators are <, <=, =, >=, > and these concepts belong to the 'Meas Value Operator' domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Meas+Value+Operator&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Meas Value Operator,0,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the Person for whom the Measurement is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,provider_id,No,,,integer,0,,"The provider associated with measurement record, e.g. the provider who ordered the test or the provider who recorded the result.",The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record. For example the admitting vs attending physician on an EHR record.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,range_high,No,,,float,0,,Ranges have the same unit as the VALUE_AS_NUMBER. These ranges are provided by the source and should remain NULL if not given.,If reference ranges for upper and lower limit of normal as provided (typically by a laboratory) these are stored in the RANGE_HIGH and RANGE_LOW fields. This should be set to NULL if not provided.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,range_low,No,,,float,0,,Ranges have the same unit as the VALUE_AS_NUMBER. These ranges are provided by the source and should remain NULL if not given.,If reference ranges for upper and lower limit of normal as provided (typically by a laboratory) these are stored in the RANGE_HIGH and RANGE_LOW fields. This should be set to NULL if not provided.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,unit_concept_id,No,,,integer,0,,"There is currently no recommended unit for individual measurements, i.e. it is not mandatory to represent Hemoglobin a1C measurements as a percentage. UNIT_SOURCE_VALUES should be mapped to a Standard Concept in the Unit domain that best represents the unit as given in the source data.","There is no standardization requirement for units associated with MEASUREMENT_CONCEPT_IDs, however, it is the responsibility of the ETL to choose the most plausible unit.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,unit_source_concept_id,No,,,integer,0,,"""This is the concept representing the UNIT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Measurement necessary for a given analytic use case. Consider using UNIT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.""",If the UNIT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,50,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,unit_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the unit of the Measurement that occurred.,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,UNIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,value_as_concept_id,No,,,integer,0,,If the raw data gives a categorial result for measurements those values are captured and mapped to standard concepts in the 'Meas Value' domain.,"If the raw data provides categorial results as well as continuous results for measurements, it is a valid ETL choice to preserve both values. The continuous value should go in the VALUE_AS_NUMBER field and the categorical value should be mapped to a standard concept in the 'Meas Value' domain and put in the VALUE_AS_CONCEPT_ID field. This is also the destination for the 'Maps to value' relationship.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Meas Value,0,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,value_as_number,No,,,float,0,,"This is the numerical value of the Result of the Measurement, if available. Note that measurements such as blood pressures will be split into their component parts i.e. one record for systolic, one record for diastolic.","If there is a negative value coming from the source, set the VALUE_AS_NUMBER to NULL, with the exception of the following Measurements (listed as LOINC codes):
- [1925-7](https://athena.ohdsi.org/search-terms/terms/3003396) Base excess in Arterial blood by calculation - [1927-3](https://athena.ohdsi.org/search-terms/terms/3002032) Base excess in Venous blood by calculation - [8632-2](https://athena.ohdsi.org/search-terms/terms/3006277) QRS-Axis - [11555-0](https://athena.ohdsi.org/search-terms/terms/3012501) Base excess in Blood by calculation - [1926-5](https://athena.ohdsi.org/search-terms/terms/3003129) Base excess in Capillary blood by calculation - [28638-5](https://athena.ohdsi.org/search-terms/terms/3004959) Base excess in Arterial cord blood by calculation [28639-3](https://athena.ohdsi.org/search-terms/terms/3007435) Base excess in Venous cord blood by calculation",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,value_source_value,No,,,varchar(50),0,,This field houses the verbatim result value of the Measurement from the source data .,"If both a continuous and categorical result are given in the source data such that both VALUE_AS_NUMBER and VALUE_AS_CONCEPT_ID are both included, store the verbatim value that was mapped to VALUE_AS_CONCEPT_ID here.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the Measurement occurred. For example, if the Person was in the ICU at the time the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+MEASUREMENT,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the Measurement occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If a MEASUREMENT_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the measurement record. If a measurement is related to a visit explicitly in the source data, it is possible that the result date of the Measurement falls outside of the bounds of the Visit dates.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+METADATA,cdm,metadata_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,metadata_date,No,,,date,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,metadata_datetime,No,,,datetime,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,metadata_id,Yes,0,,integer,0,,The unique key given to a Metadata record.,Attribute value is auto-generated,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,metadata_type_concept_id,Yes,0,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,name,Yes,0,,varchar(250),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,value_as_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,value_as_number,No,,,float,0,,"This is the numerical value of the result of the Metadata, if applicable and available. It is not expected that all Metadata will have numeric results, rather, this field is here to house values should they exist.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+METADATA,cdm,value_as_string,No,,,varchar(250),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+NOTE,cdm,encoding_concept_id,Yes,0,,integer,0,,This is the Concept representing the character encoding type.,"Put the Concept Id that represents the encoding character type here. Currently the only option is UTF-8 ([32678](https://athena.ohdsi.org/search-terms/terms/32678)). It the note is encoded in any other type, like ASCII then put 0.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,language_concept_id,Yes,0,,integer,0,,The language of the note.,Use Concepts that are descendants of the concept [4182347](https://athena.ohdsi.org/search-terms/terms/4182347) (World Languages).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
NOTE,cdm,note_class_concept_id,Yes,0,,integer,0,,"A Standard Concept Id representing the HL7 LOINC
-Document Type Vocabulary classification of the note.",Map the note classification to a Standard Concept. For more information see the ETL Conventions in the description of the NOTE table. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&conceptClass=Doc+Kind&conceptClass=Doc+Role&conceptClass=Doc+Setting&conceptClass=Doc+Subject+Matter&conceptClass=Doc+Type+of+Service&domain=Meas+Value&page=1&pageSize=15&query=). This Concept can alternatively be represented by concepts with the relationship 'Kind of (LOINC)' to [706391](https://athena.ohdsi.org/search-terms/terms/706391) (Note).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,note_date,Yes,0,,date,0,,The date the note was recorded.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,Yes,5,
-NOTE,cdm,note_datetime,No,,,datetime,0,,,If time is not given set the time to midnight.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
-NOTE,cdm,note_event_field_concept_id,No,,,integer,0,,"If the Note record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the NOTE_EVENT_ID came from.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-NOTE,cdm,note_event_id,No,,,bigint,0,,"If the Note record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-NOTE,cdm,note_id,Yes,0,,integer,0,,A unique identifier for each note.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,note_source_value,No,,,varchar(50),0,,,The source value mapped to the NOTE_CLASS_CONCEPT_ID.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,note_text,Yes,0,,varchar(MAX),0,,The content of the note.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,note_title,No,,,varchar(250),0,,The title of the note.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,note_type_concept_id,Yes,0,,integer,0,,The provenance of the note. Most likely this will be EHR. ,"Put the source system of the note, as in EHR record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Type+Concept&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,provider_id,No,,,integer,0,,The Provider who wrote the note.,The ETL may need to make a determination on which provider to put here.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,visit_detail_id,No,,,integer,0,,The Visit Detail during which the note was written.,,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE,cdm,visit_occurrence_id,No,,,integer,0,,The Visit during which the note was written. ,,No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-NOTE_NLP,cdm,offset,No,,,varchar(50),0,,Character offset of the extracted term in the input note,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-NOTE_NLP,cdm,lexical_variant,Yes,0,,varchar(250),0,,Raw text extracted from the NLP tool.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,nlp_date,Yes,0,,date,0,,The date of the note processing.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,nlp_datetime,No,,,datetime,0,,The date and time of the note processing.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,nlp_system,No,,,varchar(250),0,,,Name and version of the NLP system that extracted the term. Useful for data provenance.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,note_id,Yes,0,,integer,0,,This is the NOTE_ID for the NOTE record the NLP record is associated to.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-NOTE_NLP,cdm,note_nlp_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,note_nlp_id,Yes,0,,integer,0,,A unique identifier for the NLP record.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,note_nlp_source_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,section_concept_id,No,,,integer,0,,,"The SECTION_CONCEPT_ID should be used to represent the note section contained in the NOTE_NLP record. These concepts can be found as parts of document panels and are based on the type of note written, i.e. a discharge summary. These panels can be found as concepts with the relationship 'Subsumes' to CONCEPT_ID [45875957](https://athena.ohdsi.org/search-terms/terms/45875957).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-NOTE_NLP,cdm,snippet,No,,,varchar(250),0,,A small window of text surrounding the term,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+Document Type Vocabulary classification of the note.",Map the note classification to a Standard Concept. For more information see the ETL Conventions in the description of the NOTE table. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&conceptClass=Doc+Kind&conceptClass=Doc+Role&conceptClass=Doc+Setting&conceptClass=Doc+Subject+Matter&conceptClass=Doc+Type+of+Service&domain=Meas+Value&page=1&pageSize=15&query=). This Concept can alternatively be represented by concepts with the relationship 'Kind of (LOINC)' to [706391](https://athena.ohdsi.org/search-terms/terms/706391) (Note).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,note_date,Yes,0,,date,0,,The date the note was recorded.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,Yes,5,
+NOTE,cdm,note_datetime,No,,,datetime,0,,,If time is not given set the time to midnight.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
+NOTE,cdm,note_event_field_concept_id,No,,,integer,0,,"If the Note record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from.",Put the CONCEPT_ID that identifies which table and field the NOTE_EVENT_ID came from.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+NOTE,cdm,note_event_id,No,,,bigint,0,,"If the Note record is related to another record in the database, this field is the primary key of the linked record.","Put the primary key of the linked record, if applicable, here.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+NOTE,cdm,note_id,Yes,0,,integer,0,,A unique identifier for each note.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,note_source_value,No,,,varchar(50),0,,,The source value mapped to the NOTE_CLASS_CONCEPT_ID.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,note_text,Yes,0,,varchar(MAX),0,,The content of the note.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,note_title,No,,,varchar(250),0,,The title of the note.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,note_type_concept_id,Yes,0,,integer,0,,The provenance of the note. Most likely this will be EHR.,"Put the source system of the note, as in EHR record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Type+Concept&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,provider_id,No,,,integer,0,,The Provider who wrote the note.,The ETL may need to make a determination on which provider to put here.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,visit_detail_id,No,,,integer,0,,The Visit Detail during which the note was written.,,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE,cdm,visit_occurrence_id,No,,,integer,0,,The Visit during which the note was written.,,No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+NOTE_NLP,cdm,lexical_variant,Yes,0,,varchar(250),0,,Raw text extracted from the NLP tool.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,nlp_date,Yes,0,,date,0,,The date of the note processing.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,nlp_datetime,No,,,datetime,0,,The date and time of the note processing.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,nlp_system,No,,,varchar(250),0,,,Name and version of the NLP system that extracted the term. Useful for data provenance.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,note_id,Yes,0,,integer,0,,This is the NOTE_ID for the NOTE record the NLP record is associated to.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+NOTE_NLP,cdm,note_nlp_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,note_nlp_id,Yes,0,,integer,0,,A unique identifier for the NLP record.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,note_nlp_source_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,offset,No,,,varchar(50),0,,Character offset of the extracted term in the input note,,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+NOTE_NLP,cdm,section_concept_id,No,,,integer,0,,,"The SECTION_CONCEPT_ID should be used to represent the note section contained in the NOTE_NLP record. These concepts can be found as parts of document panels and are based on the type of note written, i.e. a discharge summary. These panels can be found as concepts with the relationship 'Subsumes' to CONCEPT_ID [45875957](https://athena.ohdsi.org/search-terms/terms/45875957).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+NOTE_NLP,cdm,snippet,No,,,varchar(250),0,,A small window of text surrounding the term,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
NOTE_NLP,cdm,term_exists,No,,,varchar(1),0,,,"Term_exists is defined as a flag that indicates if the patient actually has or had the condition. Any of the following modifiers would make Term_exists false:
Negation = true
Subject = [anything other than the patient]
@@ -331,142 +331,142 @@ Conditional = true/li>
Rule_out = true
Uncertain = very low certainty or any lower certainties
A complete lack of modifiers would make Term_exists true.
-",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
NOTE_NLP,cdm,term_modifiers,No,,,varchar(2000),0,,,"For the modifiers that are there, they would have to have these values:
- Negation = false
- Subject = patient
- Conditional = false
- Rule_out = false
-- Uncertain = true or high or moderate or even low (could argue about low). Term_modifiers will concatenate all modifiers for different types of entities (conditions, drugs, labs etc) into one string. Lab values will be saved as one of the modifiers. ",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+- Uncertain = true or high or moderate or even low (could argue about low). Term_modifiers will concatenate all modifiers for different types of entities (conditions, drugs, labs etc) into one string. Lab values will be saved as one of the modifiers.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
NOTE_NLP,cdm,term_temporal,No,,,varchar(50),0,,,"Term_temporal is to indicate if a condition is present or just in the past. The following would be past:
- History = true
-- Concept_date = anything before the time of the report",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-OBSERVATION,cdm,obs_event_field_concept_id,No,,,integer,0,,"If the Observation record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the OBSERVATION_EVENT_ID came from.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-OBSERVATION,cdm,observation_concept_id,Yes,0,,integer,0,,"The OBSERVATION_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies.","The CONCEPT_ID that the OBSERVATION_SOURCE_CONCEPT_ID maps to. There is no specified domain that the Concepts in this table must adhere to. The only rule is that records with Concepts in the Condition, Procedure, Drug, Measurement, or Device domains MUST go to the corresponding table. ",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,observation_date,Yes,0,,date,0,,"The date of the Observation. Depending on what the Observation represents this could be the date of a lab test, the date of a survey, or the date a patient's family history was taken. ",For some observations the ETL may need to make a choice as to which date to choose.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,Yes,5,
-OBSERVATION,cdm,observation_datetime,No,,,datetime,0,,,If no time is given set to midnight (00:00:00).,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
-OBSERVATION,cdm,observation_event_id,No,,,bigint,0,,"If the Observation record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here. See the [ETL Conventions for the OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm60.html#observation) table for more details.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-OBSERVATION,cdm,observation_id,Yes,0,,integer,0,,The unique key given to an Observation record for a Person. Refer to the ETL for how duplicate Observations during the same Visit were handled.,Each instance of an observation present in the source data should be assigned this unique key. ,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,observation_source_concept_id,No,,,integer,0,,"This is the concept representing the OBSERVATION_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Observation necessary for a given analytic use case. Consider using OBSERVATION_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the OBSERVATION_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,observation_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the Observation that occurred. For example, this could be an ICD10 or Read code.",This code is mapped to a Standard Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,OBSERVATION_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,observation_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Observation record, as in whether the measurement was from an EHR system, insurance claim, registry, or other sources.","Choose the OBSERVATION_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the Person for whom the Observation is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,provider_id,No,,,integer,0,,"The provider associated with the observation record, e.g. the provider who ordered the test or the provider who recorded the result.",The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record. For example the admitting vs attending physician on an EHR record.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,qualifier_concept_id,No,,,integer,0,,"This field contains all attributes specifying the clinical fact further, such as as degrees, severities, drug-drug interaction alerts etc.","Use your best judgement as to what Concepts to use here and if they are necessary to accurately represent the clinical record. There is no restriction on the domain of these Concepts, they just need to be Standard.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,qualifier_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the qualifier of the Observation that occurred. ,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,QUALIFIER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,unit_concept_id,No,,,integer,0,,There is currently no recommended unit for individual observation concepts. UNIT_SOURCE_VALUES should be mapped to a Standard Concept in the Unit domain that best represents the unit as given in the source data.,"There is no standardization requirement for units associated with OBSERVATION_CONCEPT_IDs, however, it is the responsibility of the ETL to choose the most plausible unit.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,unit_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the unit of the Observation that occurred. ,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,UNIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,value_as_concept_id,No,,,Integer,0,,"It is possible that some records destined for the Observation table have two clinical ideas represented in one source code. This is common with ICD10 codes that describe a family history of some Condition, for example. In OMOP the Vocabulary breaks these two clinical ideas into two codes; one becomes the OBSERVATION_CONCEPT_ID and the other becomes the VALUE_AS_CONCEPT_ID. It is important when using the Observation table to keep this possibility in mind and to examine the VALUE_AS_CONCEPT_ID field for relevant information. ","Note that the value of VALUE_AS_CONCEPT_ID may be provided through mapping from a source Concept which contains the content of the Observation. In those situations, the CONCEPT_RELATIONSHIP table in addition to the 'Maps to' record contains a second record with the relationship_id set to 'Maps to value'. For example, ICD10 [Z82.4](https://athena.ohdsi.org/search-terms/terms/45581076) 'Family history of ischaemic heart disease and other diseases of the circulatory system' has a 'Maps to' relationship to [4167217](https://athena.ohdsi.org/search-terms/terms/4167217) 'Family history of clinical finding' as well as a 'Maps to value' record to [134057](https://athena.ohdsi.org/search-terms/terms/134057) 'Disorder of cardiovascular system'.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,value_as_number,No,,,float,0,,"This is the numerical value of the Result of the Observation, if applicable and available. It is not expected that all Observations will have numeric results, rather, this field is here to house values should they exist. ",,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,value_as_string,No,,,varchar(60),0,,"This is the categorical value of the Result of the Observation, if applicable and available. ",,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,value_source_value,No,,,varchar(50),0,,This field houses the verbatim result value of the Observation from the source data. Do not get confused with the Observation_source_value which captures source value of the observation mapped to observation_concept_id. This field is the observation result value from the source.," If the observation_source_value was a question, for example, or an observation that requires a result then this field is the answer/ result from the source data. Store the verbatim value that represents the result of the observation_source_value. ",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-OBSERVATION,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the Observation occurred. For example, if the Person was in the ICU at the time the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the Observation occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If an OBSERVATION_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the observation record. If an observation is related to a visit explicitly in the source data, it is possible that the result date of the Observation falls outside of the bounds of the Visit dates.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION_PERIOD,cdm,observation_period_end_date,Yes,0,,date,0,,Use this date to determine the end date of the period for which we can assume that all events for a Person are recorded.,"It is often the case that the idea of Observation Periods does not exist in source data. In those cases, the observation_period_end_date can be inferred as the last Event date available for the Person. In insurance claim data, the Observation Period can be considered as the time period the Person is enrolled with a payer.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,OBSERVATION_PERIOD,OBSERVATION_PERIOD_START_DATE,1,,Yes,1,,Yes,,,
-OBSERVATION_PERIOD,cdm,observation_period_id,Yes,0,,integer,0,,A Person can have multiple discrete Observation Periods which are identified by the Observation_Period_Id.,Assign a unique observation_period_id to each discrete Observation Period for a Person.,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-OBSERVATION_PERIOD,cdm,observation_period_start_date,Yes,0,,date,0,,Use this date to determine the start date of the Observation Period.,"It is often the case that the idea of Observation Periods does not exist in source data. In those cases, the observation_period_start_date can be inferred as the earliest Event date available for the Person. In insurance claim data, the Observation Period can be considered as the time period the Person is enrolled with a payer. If a Person switches plans but stays with the same payer, and therefore capturing of data continues, that change would be captured in [PAYER_PLAN_PERIOD](https://ohdsi.github.io/CommonDataModel/cdm531.html#payer_plan_period).",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-OBSERVATION_PERIOD,cdm,period_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Observation Period as in whether the period was determined from an insurance enrollment file, EHR healthcare encounters, or other sources.",Choose the observation_period_type_concept_id that best represents how the period was determined. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-OBSERVATION_PERIOD,cdm,person_id,Yes,0,,integer,0,,The Person ID of the PERSON record for which the Observation Period is recorded.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,family_source_value,No,,,varchar(50),0,,The common identifier for all people (often a family) that covered by the same policy.,Often these are the common digits of the enrollment id of the policy members.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,0,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,payer_concept_id,No,,,integer,0,,This field represents the organization who reimburses the provider which administers care to the Person.,"Map the Payer directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. The point is to stratify on this information and identify if Persons have the same payer, though the name of the Payer is not necessary. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Payer&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,payer_plan_period_end_date,Yes,0,,date,0,,End date of Plan coverage.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PAYER_PLAN_PERIOD,PAYER_PLAN_PERIOD_START_DATE,1,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,payer_plan_period_id,Yes,0,,integer,0,,"A unique identifier for each unique combination of a Person, Payer, Plan, and Period of time.",,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,payer_plan_period_start_date,Yes,0,,date,0,,Start date of Plan coverage.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,payer_source_concept_id,No,,,integer,0,,,If the source data codes the Payer in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,payer_source_value,No,,,varchar(50),0,,This is the Payer as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,PAYER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,person_id,Yes,0,,integer,0,,The Person covered by the Plan.,"A single Person can have multiple, overlapping, PAYER_PLAN_PERIOD records",No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,plan_concept_id,No,,,integer,0,,This field represents the specific health benefit Plan the Person is enrolled in.,Map the Plan directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. The point is to stratify on this information and identify if Persons have the same health benefit Plan though the name of the Plan is not necessary. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Plan&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,plan_source_concept_id,No,,,integer,0,,,If the source data codes the Plan in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,plan_source_value,No,,,varchar(50),0,,This is the health benefit Plan of the Person as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,PLAN_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,sponsor_concept_id,No,,,integer,0,,"This field represents the sponsor of the Plan who finances the Plan. This includes self-insured, small group health plan and large group health plan.",Map the sponsor directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. The point is to stratify on this information and identify if Persons have the same sponsor though the name of the sponsor is not necessary. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Sponsor&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,sponsor_source_concept_id,No,,,integer,0,,,If the source data codes the sponsor in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,sponsor_source_value,No,,,varchar(50),0,,The Plan sponsor as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,SPONSOR_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,stop_reason_concept_id,No,,,integer,0,,"This field represents the reason the Person left the Plan, if known.",Map the stop reason directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Plan+Stop+Reason&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,stop_reason_source_concept_id,No,,,integer,0,,,If the source data codes the stop reason in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PAYER_PLAN_PERIOD,cdm,stop_reason_source_value,No,,,varchar(50),0,,The Plan stop reason as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,STOP_REASON_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,birth_datetime,No,,,datetime,0,,,"This field is not required but highly encouraged. For data sources that provide the precise datetime of birth, that value should be stored in this field. If birth_datetime is not provided in the source, use the following logic to infer the date: If day_of_birth is null and month_of_birth is not null then use the first of the month in that year. If month_of_birth is null or if day_of_birth AND month_of_birth are both null and the person has records during their year of birth then use the date of the earliest record, otherwise use the 15th of June of that year. If time of birth is not given use midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'18500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,No,,,Yes,,,
-PERSON,cdm,care_site_id,No,,,integer,0,,The Care Site refers to where the Provider typically provides the primary care.,,No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,day_of_birth,No,,,integer,0,,,"For data sources that provide the precise date of birth, the day should be extracted and stored in this field.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,1,1,,31,1,,,,,,,No,,,Yes,,,
-PERSON,cdm,ethnicity_concept_id,Yes,0,,integer,0,,"This field captures Ethnicity as defined by the Office of Management and Budget (OMB) of the US Government: it distinguishes only between ""Hispanic"" and ""Not Hispanic"". Races and ethnic backgrounds are not stored here.",Only use this field if you have US-based data and a source of this information. Do not attempt to infer Ethnicity from the race or ethnic background of the Person. [Accepted ethnicity concepts](http://athena.ohdsi.org/search-terms/terms?domain=Ethnicity&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,Ethnicity,0,,,,,Yes,0,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,ethnicity_source_concept_id,No,,,integer,0,,"Due to the small number of options, this tends to be zero.","If the source data codes ethnicity in an OMOP supported vocabulary, store the concept_id here.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PERSON,cdm,ethnicity_source_value,No,,,varchar(50),0,,This field is used to store the ethnicity of the person from the source data. It is not intended for use in standard analytics but for reference only.,"If the person has an ethnicity other than the OMB standard of ""Hispanic"" or ""Not Hispanic"" store that value from the source data here.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,ETHNICITY_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,gender_concept_id,Yes,0,,integer,0,,This field is meant to capture the biological sex at birth of the Person. This field should not be used to study gender identity issues.,Use the gender or sex value present in the data under the assumption that it is the biological sex at birth. If the source data captures gender identity it should be stored in the [OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#observation) table. [Accepted gender concepts](http://athena.ohdsi.org/search-terms/terms?domain=Gender&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,Gender,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,gender_source_concept_id,No,,,integer,0,,"Due to the small number of options, this tends to be zero.","If the source data codes biological sex in a non-standard vocabulary, store the concept_id here.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PERSON,cdm,gender_source_value,No,,,varchar(50),0,,This field is used to store the biological sex of the person from the source data. It is not intended for use in standard analytics but for reference only.,Put the biological sex of the person as it appears in the source data.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,GENDER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,location_id,No,,,integer,0,,The location refers to the physical address of the person. This field should capture the last known location of the person. ,"Put the location_id from the [LOCATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#location) table here that represents the most granular location information for the person. This could represent anything from postal code or parts thereof, state, or county for example. Since many databases contain deidentified data, it is common that the precision of the location is reduced to prevent re-identification. This field should capture the last known location. ",No,,,Yes,0,,LOCATION,LOCATION_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,month_of_birth,No,,,integer,0,,,"For data sources that provide the precise date of birth, the month should be extracted and stored in this field.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,1,1,,12,1,,,,,,,No,,,Yes,,,
-PERSON,cdm,person_id,Yes,0,,integer,0,,It is assumed that every person with a different unique identifier is in fact a different person and should be treated independently.,"Any person linkage that needs to occur to uniquely identify Persons ought to be done prior to writing this table. This identifier can be the original id from the source data provided if it is an integer, otherwise it can be an autogenerated number.",Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,person_source_value,No,,,varchar(50),0,,Use this field to link back to persons in the source data. This is typically used for error checking of ETL logic.,Some use cases require the ability to link back to persons in the source data. This field allows for the storing of the person value as it appears in the source. This field is not required but strongly recommended.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,provider_id,No,,,integer,0,,The Provider refers to the last known primary care provider (General Practitioner).,"Put the provider_id from the [PROVIDER](https://ohdsi.github.io/CommonDataModel/cdm531.html#provider) table of the last known general practitioner of the person. If there are multiple providers, it is up to the ETL to decide which to put here.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,race_concept_id,Yes,0,,integer,0,,This field captures race or ethnic background of the person.,"Only use this field if you have information about race or ethnic background. The Vocabulary contains Concepts about the main races and ethnic backgrounds in a hierarchical system. Due to the imprecise nature of human races and ethnic backgrounds, this is not a perfect system. Mixed races are not supported. If a clear race or ethnic background cannot be established, use Concept_Id 0. [Accepted Race Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Race&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Race,0,,,,,Yes,0,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,race_source_concept_id,No,,,integer,0,,"Due to the small number of options, this tends to be zero.",If the source data codes race in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PERSON,cdm,race_source_value,No,,,varchar(50),0,,This field is used to store the race of the person from the source data. It is not intended for use in standard analytics but for reference only.,Put the race of the person as it appears in the source data.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,RACE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PERSON,cdm,year_of_birth,Yes,0,,integer,0,,Compute age using year_of_birth.,"For data sources with date of birth, the year should be extracted. For data sources where the year of birth is not available, the approximate year of birth could be derived based on age group categorization, if available.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,1850,1,,YEAR(GETDATE())+1,1,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,modifier_concept_id,No,,,integer,0,,The modifiers are intended to give additional information about the procedure but as of now the vocabulary is under review.,"It is up to the ETL to choose how to map modifiers if they exist in source data. These concepts are typically distinguished by 'Modifier' concept classes (e.g., 'CPT4 Modifier' as part of the 'CPT4' vocabulary). If there is more than one modifier on a record, one should be chosen that pertains to the procedure rather than provider. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?conceptClass=CPT4+Modifier&conceptClass=HCPCS+Modifier&vocabulary=CPT4&vocabulary=HCPCS&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,modifier_source_value,No,,,varchar(50),0,,,The original modifier code from the source is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,MODIFIER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the PERSON for whom the procedure is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_concept_id,Yes,0,,integer,0,,"The PROCEDURE_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source value which represents a procedure","The CONCEPT_ID that the PROCEDURE_SOURCE_VALUE maps to. Only records whose source values map to standard concepts with a domain of ""Procedure"" should go in this table. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Procedure&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Procedure,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_date,Yes,0,,date,0,,Use this date to determine the date the procedure started.,This is meant to be the **start date** of the procedure. It will be renamed in a future version to **PROCEDURE_START_DATE**. ,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
-PROCEDURE_OCCURRENCE,cdm,procedure_datetime,No,,,datetime,0,,,"If the procedure has a start time in the native date, use this field to house that information. This will be renamed in a future version to **PROCEDURE_START_DATETIME**.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_end_date,No,,,date,0,,Use this field to house the date that the procedure ended. ,This is meant to be the end date of the procedure. It is not required and for most cases will be the same as the PROCEDURE_START_DATE.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PROCEDURE_OCCURRENCE,PROCEDURE_DATE,1,,Yes,1,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_end_datetime,No,,,datetime,0,,Use this field to house the datetime that the procedure ended. ,This is meant to house the end datetime of the procedure and will most often be used in conjunction with the procedure_start_datetime to determine the length of the procedure.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PROCEDURE_OCCURRENCE,PROCEDURE_DATETIME,1,,Yes,1,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_occurrence_id,Yes,0,,integer,0,,The unique key given to a procedure record for a person. Refer to the ETL for how duplicate procedures during the same visit were handled.,"Each instance of a procedure occurrence in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same procedure within the same visit. It is valid to keep these duplicates and assign them individual, unique, PROCEDURE_OCCURRENCE_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_source_concept_id,No,,,integer,0,,"This is the concept representing the procedure source value and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Procedure necessary for a given analytic use case. Consider using PROCEDURE_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the PROCEDURE_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the procedure that occurred. For example, this could be an CPT4 or OPCS4 code.",Use this value to look up the source concept id and then map the source concept id to a standard concept id.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,PROCEDURE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,procedure_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Procedure record, as in whether the procedure was from an EHR system, insurance claim, registry, or other sources.","Choose the PROCEDURE_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. If a procedure is recorded as an EHR encounter, the PROCEDURE_TYPE_CONCEPT would be 'EHR encounter record'. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,provider_id,No,,,integer,0,,"The provider associated with the procedure record, e.g. the provider who performed the Procedure.","The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record, for example the admitting vs attending physician on an EHR record.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,quantity,No,,,integer,0,,"If the quantity value is omitted, a single procedure is assumed.","If a Procedure has a quantity of '0' in the source, this should default to '1' in the ETL. If there is a record in the source it can be assumed the exposure occurred at least once",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the Procedure occurred. For example, if the Person was in the ICU at the time of the Procedure the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROCEDURE_OCCURRENCE,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the procedure occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If a PROCEDURE_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the Visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the PROCEDURE_OCCURRENCE record.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-PROVIDER,cdm,care_site_id,No,,,integer,0,,This is the CARE_SITE_ID for the location that the provider primarily practices in.,"If a Provider has more than one Care Site, the main or most often exerted CARE_SITE_ID should be recorded.",No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,dea,No,,,varchar(20),0,,"This is the identifier issued by the DEA, a US federal agency, that allows a provider to write prescriptions for controlled substances.",,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,gender_concept_id,No,,,integer,0,,This field represents the recorded gender of the provider in the source data.,"If given, put a concept from the gender domain representing the recorded gender of the provider. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Gender&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Gender,0,,,,,Yes,0,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,gender_source_concept_id,No,,,integer,0,,This is often zero as many sites use proprietary codes to store provider gender.,If the source data codes provider gender in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,gender_source_value,No,,,varchar(50),0,,This is provider's gender as it appears in the source data.,Put the provider's gender as it appears in the source data. This field is up to the discretion of the ETL-er as to whether this should be the coded value from the source or the text description of the lookup value.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,GENDER_CONCEPT_ID,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,npi,No,,,varchar(20),0,,This is the National Provider Number issued to health care providers in the US by the Centers for Medicare and Medicaid Services (CMS).,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,provider_id,Yes,0,,integer,0,,It is assumed that every provider with a different unique identifier is in fact a different person and should be treated independently.,"This identifier can be the original id from the source data provided it is an integer, otherwise it can be an autogenerated number.",Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,provider_name,No,,,varchar(255),0,,,"This field is not necessary as it is not necessary to have the actual identity of the Provider. Rather, the idea is to uniquely and anonymously identify providers of care across the database.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,provider_source_value,No,,,varchar(50),0,,Use this field to link back to providers in the source data. This is typically used for error checking of ETL logic.,Some use cases require the ability to link back to providers in the source data. This field allows for the storing of the provider identifier as it appears in the source.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,specialty_concept_id,No,,,integer,0,,"This field either represents the most common specialty that occurs in the data or the most specific concept that represents all specialties listed, should the provider have more than one. This includes physician specialties such as internal medicine, emergency medicine, etc. and allied health professionals such as nurses, midwives, and pharmacists.","If a Provider has more than one Specialty, there are two options: 1. Choose a concept_id which is a common ancestor to the multiple specialties, or, 2. Choose the specialty that occurs most often for the provider. Concepts in this field should be Standard with a domain of Provider. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Provider&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,specialty_source_concept_id,No,,,integer,0,,This is often zero as many sites use proprietary codes to store physician speciality.,If the source data codes provider specialty in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,specialty_source_value,No,,,varchar(50),0,,"This is the kind of provider or specialty as it appears in the source data. This includes physician specialties such as internal medicine, emergency medicine, etc. and allied health professionals such as nurses, midwives, and pharmacists.",Put the kind of provider as it appears in the source data. This field is up to the discretion of the ETL-er as to whether this should be the coded value from the source or the text description of the lookup value.,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,SPECIALTY_CONCEPT_ID,,,,,,,,,,,,No,,,No,,,
-PROVIDER,cdm,year_of_birth,No,,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+- Concept_date = anything before the time of the report",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+OBSERVATION,cdm,obs_event_field_concept_id,No,,,integer,0,,"If the Observation record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from.",Put the CONCEPT_ID that identifies which table and field the OBSERVATION_EVENT_ID came from.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+OBSERVATION,cdm,observation_concept_id,Yes,0,,integer,0,,"The OBSERVATION_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies.","The CONCEPT_ID that the OBSERVATION_SOURCE_CONCEPT_ID maps to. There is no specified domain that the Concepts in this table must adhere to. The only rule is that records with Concepts in the Condition, Procedure, Drug, Measurement, or Device domains MUST go to the corresponding table.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,observation_date,Yes,0,,date,0,,"The date of the Observation. Depending on what the Observation represents this could be the date of a lab test, the date of a survey, or the date a patient's family history was taken.",For some observations the ETL may need to make a choice as to which date to choose.,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,Yes,5,
+OBSERVATION,cdm,observation_datetime,No,,,datetime,0,,,If no time is given set to midnight (00:00:00).,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
+OBSERVATION,cdm,observation_event_id,No,,,bigint,0,,"If the Observation record is related to another record in the database, this field is the primary key of the linked record.","Put the primary key of the linked record, if applicable, here. See the [ETL Conventions for the OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm60.html#observation) table for more details.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+OBSERVATION,cdm,observation_id,Yes,0,,integer,0,,The unique key given to an Observation record for a Person. Refer to the ETL for how duplicate Observations during the same Visit were handled.,Each instance of an observation present in the source data should be assigned this unique key.,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,observation_source_concept_id,No,,,integer,0,,"This is the concept representing the OBSERVATION_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Observation necessary for a given analytic use case. Consider using OBSERVATION_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the OBSERVATION_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,observation_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the Observation that occurred. For example, this could be an ICD10 or Read code.",This code is mapped to a Standard Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,OBSERVATION_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,observation_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Observation record, as in whether the measurement was from an EHR system, insurance claim, registry, or other sources.","Choose the OBSERVATION_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the Person for whom the Observation is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,provider_id,No,,,integer,0,,"The provider associated with the observation record, e.g. the provider who ordered the test or the provider who recorded the result.",The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record. For example the admitting vs attending physician on an EHR record.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,qualifier_concept_id,No,,,integer,0,,"This field contains all attributes specifying the clinical fact further, such as as degrees, severities, drug-drug interaction alerts etc.","Use your best judgement as to what Concepts to use here and if they are necessary to accurately represent the clinical record. There is no restriction on the domain of these Concepts, they just need to be Standard.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,qualifier_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the qualifier of the Observation that occurred.,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,QUALIFIER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,unit_concept_id,No,,,integer,0,,There is currently no recommended unit for individual observation concepts. UNIT_SOURCE_VALUES should be mapped to a Standard Concept in the Unit domain that best represents the unit as given in the source data.,"There is no standardization requirement for units associated with OBSERVATION_CONCEPT_IDs, however, it is the responsibility of the ETL to choose the most plausible unit.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Unit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,unit_source_value,No,,,varchar(50),0,,This field houses the verbatim value from the source data representing the unit of the Observation that occurred.,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,UNIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,value_as_concept_id,No,,,Integer,0,,"It is possible that some records destined for the Observation table have two clinical ideas represented in one source code. This is common with ICD10 codes that describe a family history of some Condition, for example. In OMOP the Vocabulary breaks these two clinical ideas into two codes; one becomes the OBSERVATION_CONCEPT_ID and the other becomes the VALUE_AS_CONCEPT_ID. It is important when using the Observation table to keep this possibility in mind and to examine the VALUE_AS_CONCEPT_ID field for relevant information.","Note that the value of VALUE_AS_CONCEPT_ID may be provided through mapping from a source Concept which contains the content of the Observation. In those situations, the CONCEPT_RELATIONSHIP table in addition to the 'Maps to' record contains a second record with the relationship_id set to 'Maps to value'. For example, ICD10 [Z82.4](https://athena.ohdsi.org/search-terms/terms/45581076) 'Family history of ischaemic heart disease and other diseases of the circulatory system' has a 'Maps to' relationship to [4167217](https://athena.ohdsi.org/search-terms/terms/4167217) 'Family history of clinical finding' as well as a 'Maps to value' record to [134057](https://athena.ohdsi.org/search-terms/terms/134057) 'Disorder of cardiovascular system'.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,value_as_number,No,,,float,0,,"This is the numerical value of the Result of the Observation, if applicable and available. It is not expected that all Observations will have numeric results, rather, this field is here to house values should they exist.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,value_as_string,No,,,varchar(60),0,,"This is the categorical value of the Result of the Observation, if applicable and available.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,value_source_value,No,,,varchar(50),0,,This field houses the verbatim result value of the Observation from the source data. Do not get confused with the Observation_source_value which captures source value of the observation mapped to observation_concept_id. This field is the observation result value from the source.,"If the observation_source_value was a question, for example, or an observation that requires a result then this field is the answer/ result from the source data. Store the verbatim value that represents the result of the observation_source_value.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+OBSERVATION,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the Observation occurred. For example, if the Person was in the ICU at the time the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the Observation occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If an OBSERVATION_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the observation record. If an observation is related to a visit explicitly in the source data, it is possible that the result date of the Observation falls outside of the bounds of the Visit dates.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION_PERIOD,cdm,observation_period_end_date,Yes,0,,date,0,,Use this date to determine the end date of the period for which we can assume that all events for a Person are recorded.,"It is often the case that the idea of Observation Periods does not exist in source data. In those cases, the observation_period_end_date can be inferred as the last Event date available for the Person. In insurance claim data, the Observation Period can be considered as the time period the Person is enrolled with a payer.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,OBSERVATION_PERIOD,OBSERVATION_PERIOD_START_DATE,1,,Yes,1,,Yes,,,
+OBSERVATION_PERIOD,cdm,observation_period_id,Yes,0,,integer,0,,A Person can have multiple discrete Observation Periods which are identified by the Observation_Period_Id.,Assign a unique observation_period_id to each discrete Observation Period for a Person.,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+OBSERVATION_PERIOD,cdm,observation_period_start_date,Yes,0,,date,0,,Use this date to determine the start date of the Observation Period.,"It is often the case that the idea of Observation Periods does not exist in source data. In those cases, the observation_period_start_date can be inferred as the earliest Event date available for the Person. In insurance claim data, the Observation Period can be considered as the time period the Person is enrolled with a payer. If a Person switches plans but stays with the same payer, and therefore capturing of data continues, that change would be captured in [PAYER_PLAN_PERIOD](https://ohdsi.github.io/CommonDataModel/cdm531.html#payer_plan_period).",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+OBSERVATION_PERIOD,cdm,period_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Observation Period as in whether the period was determined from an insurance enrollment file, EHR healthcare encounters, or other sources.",Choose the observation_period_type_concept_id that best represents how the period was determined. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+OBSERVATION_PERIOD,cdm,person_id,Yes,0,,integer,0,,The Person ID of the PERSON record for which the Observation Period is recorded.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,family_source_value,No,,,varchar(50),0,,The common identifier for all people (often a family) that covered by the same policy.,Often these are the common digits of the enrollment id of the policy members.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,0,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,payer_concept_id,No,,,integer,0,,This field represents the organization who reimburses the provider which administers care to the Person.,"Map the Payer directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. The point is to stratify on this information and identify if Persons have the same payer, though the name of the Payer is not necessary. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Payer&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,payer_plan_period_end_date,Yes,0,,date,0,,End date of Plan coverage.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PAYER_PLAN_PERIOD,PAYER_PLAN_PERIOD_START_DATE,1,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,payer_plan_period_id,Yes,0,,integer,0,,"A unique identifier for each unique combination of a Person, Payer, Plan, and Period of time.",,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,payer_plan_period_start_date,Yes,0,,date,0,,Start date of Plan coverage.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,payer_source_concept_id,No,,,integer,0,,,If the source data codes the Payer in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,payer_source_value,No,,,varchar(50),0,,This is the Payer as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,PAYER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,person_id,Yes,0,,integer,0,,The Person covered by the Plan.,"A single Person can have multiple, overlapping, PAYER_PLAN_PERIOD records",No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,plan_concept_id,No,,,integer,0,,This field represents the specific health benefit Plan the Person is enrolled in.,Map the Plan directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. The point is to stratify on this information and identify if Persons have the same health benefit Plan though the name of the Plan is not necessary. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Plan&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,plan_source_concept_id,No,,,integer,0,,,If the source data codes the Plan in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,plan_source_value,No,,,varchar(50),0,,This is the health benefit Plan of the Person as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,PLAN_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,sponsor_concept_id,No,,,integer,0,,"This field represents the sponsor of the Plan who finances the Plan. This includes self-insured, small group health plan and large group health plan.",Map the sponsor directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. The point is to stratify on this information and identify if Persons have the same sponsor though the name of the sponsor is not necessary. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Sponsor&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,sponsor_source_concept_id,No,,,integer,0,,,If the source data codes the sponsor in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,sponsor_source_value,No,,,varchar(50),0,,The Plan sponsor as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,SPONSOR_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,stop_reason_concept_id,No,,,integer,0,,"This field represents the reason the Person left the Plan, if known.",Map the stop reason directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Plan+Stop+Reason&standardConcept=Standard&page=1&pageSize=15&query=).,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,stop_reason_source_concept_id,No,,,integer,0,,,If the source data codes the stop reason in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PAYER_PLAN_PERIOD,cdm,stop_reason_source_value,No,,,varchar(50),0,,The Plan stop reason as it appears in the source data.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,STOP_REASON_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,birth_datetime,No,,,datetime,0,,,"This field is not required but highly encouraged. For data sources that provide the precise datetime of birth, that value should be stored in this field. If birth_datetime is not provided in the source, use the following logic to infer the date: If day_of_birth is null and month_of_birth is not null then use the first of the month in that year. If month_of_birth is null or if day_of_birth AND month_of_birth are both null and the person has records during their year of birth then use the date of the earliest record, otherwise use the 15th of June of that year. If time of birth is not given use midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'18500101',1,,"DATEADD(dd,1,GETDATE())",1,,,,,,,No,,,Yes,,,
+PERSON,cdm,care_site_id,No,,,integer,0,,The Care Site refers to where the Provider typically provides the primary care.,,No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,day_of_birth,No,,,integer,0,,,"For data sources that provide the precise date of birth, the day should be extracted and stored in this field.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,31,1,,,,,,,No,,,Yes,,,
+PERSON,cdm,ethnicity_concept_id,Yes,0,,integer,0,,"This field captures Ethnicity as defined by the Office of Management and Budget (OMB) of the US Government: it distinguishes only between ""Hispanic"" and ""Not Hispanic"". Races and ethnic backgrounds are not stored here.",Only use this field if you have US-based data and a source of this information. Do not attempt to infer Ethnicity from the race or ethnic background of the Person. [Accepted ethnicity concepts](http://athena.ohdsi.org/search-terms/terms?domain=Ethnicity&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,Ethnicity,0,,,,,Yes,0,,Yes,0,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,ethnicity_source_concept_id,No,,,integer,0,,"Due to the small number of options, this tends to be zero.","If the source data codes ethnicity in an OMOP supported vocabulary, store the concept_id here.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PERSON,cdm,ethnicity_source_value,No,,,varchar(50),0,,This field is used to store the ethnicity of the person from the source data. It is not intended for use in standard analytics but for reference only.,"If the person has an ethnicity other than the OMB standard of ""Hispanic"" or ""Not Hispanic"" store that value from the source data here.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,ETHNICITY_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,gender_concept_id,Yes,0,,integer,0,,This field is meant to capture the biological sex at birth of the Person. This field should not be used to study gender identity issues.,Use the gender or sex value present in the data under the assumption that it is the biological sex at birth. If the source data captures gender identity it should be stored in the [OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#observation) table. [Accepted gender concepts](http://athena.ohdsi.org/search-terms/terms?domain=Gender&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,Gender,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,gender_source_concept_id,No,,,integer,0,,"Due to the small number of options, this tends to be zero.","If the source data codes biological sex in a non-standard vocabulary, store the concept_id here.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PERSON,cdm,gender_source_value,No,,,varchar(50),0,,This field is used to store the biological sex of the person from the source data. It is not intended for use in standard analytics but for reference only.,Put the biological sex of the person as it appears in the source data.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,GENDER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,location_id,No,,,integer,0,,The location refers to the physical address of the person. This field should capture the last known location of the person.,"Put the location_id from the [LOCATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#location) table here that represents the most granular location information for the person. This could represent anything from postal code or parts thereof, state, or county for example. Since many databases contain deidentified data, it is common that the precision of the location is reduced to prevent re-identification. This field should capture the last known location.",No,,,Yes,0,,LOCATION,LOCATION_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,month_of_birth,No,,,integer,0,,,"For data sources that provide the precise date of birth, the month should be extracted and stored in this field.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,12,1,,,,,,,No,,,Yes,,,
+PERSON,cdm,person_id,Yes,0,,integer,0,,It is assumed that every person with a different unique identifier is in fact a different person and should be treated independently.,"Any person linkage that needs to occur to uniquely identify Persons ought to be done prior to writing this table. This identifier can be the original id from the source data provided if it is an integer, otherwise it can be an autogenerated number.",Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,person_source_value,No,,,varchar(50),0,,Use this field to link back to persons in the source data. This is typically used for error checking of ETL logic.,Some use cases require the ability to link back to persons in the source data. This field allows for the storing of the person value as it appears in the source. This field is not required but strongly recommended.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,provider_id,No,,,integer,0,,The Provider refers to the last known primary care provider (General Practitioner).,"Put the provider_id from the [PROVIDER](https://ohdsi.github.io/CommonDataModel/cdm531.html#provider) table of the last known general practitioner of the person. If there are multiple providers, it is up to the ETL to decide which to put here.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,race_concept_id,Yes,0,,integer,0,,This field captures race or ethnic background of the person.,"Only use this field if you have information about race or ethnic background. The Vocabulary contains Concepts about the main races and ethnic backgrounds in a hierarchical system. Due to the imprecise nature of human races and ethnic backgrounds, this is not a perfect system. Mixed races are not supported. If a clear race or ethnic background cannot be established, use Concept_Id 0. [Accepted Race Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Race&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Race,0,,,,,Yes,0,,Yes,0,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,race_source_concept_id,No,,,integer,0,,"Due to the small number of options, this tends to be zero.",If the source data codes race in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PERSON,cdm,race_source_value,No,,,varchar(50),0,,This field is used to store the race of the person from the source data. It is not intended for use in standard analytics but for reference only.,Put the race of the person as it appears in the source data.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,RACE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PERSON,cdm,year_of_birth,Yes,0,,integer,0,,Compute age using year_of_birth.,"For data sources with date of birth, the year should be extracted. For data sources where the year of birth is not available, the approximate year of birth could be derived based on age group categorization, if available.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,1850,1,,YEAR(GETDATE())+1,1,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,modifier_concept_id,No,,,integer,0,,The modifiers are intended to give additional information about the procedure but as of now the vocabulary is under review.,"It is up to the ETL to choose how to map modifiers if they exist in source data. These concepts are typically distinguished by 'Modifier' concept classes (e.g., 'CPT4 Modifier' as part of the 'CPT4' vocabulary). If there is more than one modifier on a record, one should be chosen that pertains to the procedure rather than provider. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?conceptClass=CPT4+Modifier&conceptClass=HCPCS+Modifier&vocabulary=CPT4&vocabulary=HCPCS&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,modifier_source_value,No,,,varchar(50),0,,,The original modifier code from the source is stored here for reference.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,MODIFIER_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,person_id,Yes,0,,integer,0,,The PERSON_ID of the PERSON for whom the procedure is recorded. This may be a system generated code.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_concept_id,Yes,0,,integer,0,,"The PROCEDURE_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies. This is the standard concept mapped from the source value which represents a procedure","The CONCEPT_ID that the PROCEDURE_SOURCE_VALUE maps to. Only records whose source values map to standard concepts with a domain of ""Procedure"" should go in this table. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Procedure&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Procedure,0,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_date,Yes,0,,date,0,,Use this date to determine the date the procedure started.,This is meant to be the **start date** of the procedure. It will be renamed in a future version to **PROCEDURE_START_DATE**.,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,5,
+PROCEDURE_OCCURRENCE,cdm,procedure_datetime,No,,,datetime,0,,,"If the procedure has a start time in the native date, use this field to house that information. This will be renamed in a future version to **PROCEDURE_START_DATETIME**.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_end_date,No,,,date,0,,Use this field to house the date that the procedure ended.,This is meant to be the end date of the procedure. It is not required and for most cases will be the same as the PROCEDURE_START_DATE.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PROCEDURE_OCCURRENCE,PROCEDURE_DATE,1,,Yes,1,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_end_datetime,No,,,datetime,0,,Use this field to house the datetime that the procedure ended.,This is meant to house the end datetime of the procedure and will most often be used in conjunction with the procedure_start_datetime to determine the length of the procedure.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PROCEDURE_OCCURRENCE,PROCEDURE_DATETIME,1,,Yes,1,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_occurrence_id,Yes,0,,integer,0,,The unique key given to a procedure record for a person. Refer to the ETL for how duplicate procedures during the same visit were handled.,"Each instance of a procedure occurrence in the source data should be assigned this unique key. In some cases, a person can have multiple records of the same procedure within the same visit. It is valid to keep these duplicates and assign them individual, unique, PROCEDURE_OCCURRENCE_IDs, though it is up to the ETL how they should be handled.",Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_source_concept_id,No,,,integer,0,,"This is the concept representing the procedure source value and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Procedure necessary for a given analytic use case. Consider using PROCEDURE_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.",If the PROCEDURE_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the procedure that occurred. For example, this could be an CPT4 or OPCS4 code.",Use this value to look up the source concept id and then map the source concept id to a standard concept id.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,PROCEDURE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,procedure_type_concept_id,Yes,0,,integer,0,,"This field can be used to determine the provenance of the Procedure record, as in whether the procedure was from an EHR system, insurance claim, registry, or other sources.","Choose the PROCEDURE_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. If a procedure is recorded as an EHR encounter, the PROCEDURE_TYPE_CONCEPT would be 'EHR encounter record'. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,provider_id,No,,,integer,0,,"The provider associated with the procedure record, e.g. the provider who performed the Procedure.","The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record, for example the admitting vs attending physician on an EHR record.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,quantity,No,,,integer,0,,"If the quantity value is omitted, a single procedure is assumed.","If a Procedure has a quantity of '0' in the source, this should default to '1' in the ETL. If there is a record in the source it can be assumed the exposure occurred at least once",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,visit_detail_id,No,,,integer,0,,"The VISIT_DETAIL record during which the Procedure occurred. For example, if the Person was in the ICU at the time of the Procedure the VISIT_OCCURRENCE record would reflect the overall hospital stay and the VISIT_DETAIL record would reflect the ICU stay during the hospital visit.",Same rules apply as for the VISIT_OCCURRENCE_ID.,No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROCEDURE_OCCURRENCE,cdm,visit_occurrence_id,No,,,integer,0,,The visit during which the procedure occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If a PROCEDURE_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the Visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the PROCEDURE_OCCURRENCE record.",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+PROVIDER,cdm,care_site_id,No,,,integer,0,,This is the CARE_SITE_ID for the location that the provider primarily practices in.,"If a Provider has more than one Care Site, the main or most often exerted CARE_SITE_ID should be recorded.",No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,dea,No,,,varchar(20),0,,"This is the identifier issued by the DEA, a US federal agency, that allows a provider to write prescriptions for controlled substances.",,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,gender_concept_id,No,,,integer,0,,This field represents the recorded gender of the provider in the source data.,"If given, put a concept from the gender domain representing the recorded gender of the provider. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Gender&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Gender,0,,,,,Yes,0,,Yes,100,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,gender_source_concept_id,No,,,integer,0,,This is often zero as many sites use proprietary codes to store provider gender.,If the source data codes provider gender in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,gender_source_value,No,,,varchar(50),0,,This is provider's gender as it appears in the source data.,Put the provider's gender as it appears in the source data. This field is up to the discretion of the ETL-er as to whether this should be the coded value from the source or the text description of the lookup value.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,GENDER_CONCEPT_ID,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,npi,No,,,varchar(20),0,,This is the National Provider Number issued to health care providers in the US by the Centers for Medicare and Medicaid Services (CMS).,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,provider_id,Yes,0,,integer,0,,It is assumed that every provider with a different unique identifier is in fact a different person and should be treated independently.,"This identifier can be the original id from the source data provided it is an integer, otherwise it can be an autogenerated number.",Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,provider_name,No,,,varchar(255),0,,,"This field is not necessary as it is not necessary to have the actual identity of the Provider. Rather, the idea is to uniquely and anonymously identify providers of care across the database.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,provider_source_value,No,,,varchar(50),0,,Use this field to link back to providers in the source data. This is typically used for error checking of ETL logic.,Some use cases require the ability to link back to providers in the source data. This field allows for the storing of the provider identifier as it appears in the source.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,specialty_concept_id,No,,,integer,0,,"This field either represents the most common specialty that occurs in the data or the most specific concept that represents all specialties listed, should the provider have more than one. This includes physician specialties such as internal medicine, emergency medicine, etc. and allied health professionals such as nurses, midwives, and pharmacists.","If a Provider has more than one Specialty, there are two options: 1. Choose a concept_id which is a common ancestor to the multiple specialties, or, 2. Choose the specialty that occurs most often for the provider. Concepts in this field should be Standard with a domain of Provider. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Provider&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,100,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,specialty_source_concept_id,No,,,integer,0,,This is often zero as many sites use proprietary codes to store physician speciality.,If the source data codes provider specialty in an OMOP supported vocabulary store the concept_id here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,specialty_source_value,No,,,varchar(50),0,,"This is the kind of provider or specialty as it appears in the source data. This includes physician specialties such as internal medicine, emergency medicine, etc. and allied health professionals such as nurses, midwives, and pharmacists.",Put the kind of provider as it appears in the source data. This field is up to the discretion of the ETL-er as to whether this should be the coded value from the source or the text description of the lookup value.,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,SPECIALTY_CONCEPT_ID,,,,,,,,,,,,No,,,No,,,
+PROVIDER,cdm,year_of_birth,No,,,integer,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
RELATIONSHIP,vocab,defines_ancestry,Yes,0,,varchar(1),0,,"Defines whether a hierarchical relationship
contributes to the concept_ancestor table.
These are subsets of the hierarchical
-relationships. Valid values are 1 or 0.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+relationships. Valid values are 1 or 0.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
RELATIONSHIP,vocab,is_hierarchical,Yes,0,,varchar(1),0,,"Defines whether a relationship defines
concepts into classes or hierarchies. Values
-are 1 for hierarchical relationship or 0 if not.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+are 1 for hierarchical relationship or 0 if not.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
RELATIONSHIP,vocab,relationship_concept_id,Yes,0,,integer,0,,"A foreign key that refers to an identifier in
the [CONCEPT](https://ohdsi.github.io/CommonDataModel/cdm531.html#concept) table for the unique
-relationship concept.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+relationship concept.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
RELATIONSHIP,vocab,relationship_id,Yes,0,,varchar(20),0,,"The type of relationship captured by the
-relationship record.",,Yes,0,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-RELATIONSHIP,vocab,relationship_name,Yes,0,,varchar(255),0,,,,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+relationship record.",,Yes,0,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+RELATIONSHIP,vocab,relationship_name,Yes,0,,varchar(255),0,,,,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
RELATIONSHIP,vocab,reverse_relationship_id,Yes,0,,varchar(20),0,,"The identifier for the relationship used to
define the reverse relationship between two
-concepts.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-SOURCE_TO_CONCEPT_MAP,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the mapping instance was invalidated. Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+concepts.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+SOURCE_TO_CONCEPT_MAP,vocab,invalid_reason,No,,,varchar(1),0,,"Reason the mapping instance was invalidated. Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
SOURCE_TO_CONCEPT_MAP,vocab,source_code,Yes,0,,varchar(50),0,,"The source code being translated
-into a Standard Concept.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+into a Standard Concept.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
SOURCE_TO_CONCEPT_MAP,vocab,source_code_description,No,,,varchar(255),0,,"An optional description for the
source code. This is included as a
convenience to compare the
description of the source code to
-the name of the concept.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+the name of the concept.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
SOURCE_TO_CONCEPT_MAP,vocab,source_concept_id,Yes,0,,integer,0,,"A foreign key to the Source
Concept that is being translated
-into a Standard Concept.","This is either 0 or should be a number above 2 billion, which are the Concepts reserved for site-specific codes and mappings. ",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
+into a Standard Concept.","This is either 0 or should be a number above 2 billion, which are the Concepts reserved for site-specific codes and mappings.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,No,,,
SOURCE_TO_CONCEPT_MAP,vocab,source_vocabulary_id,Yes,0,,varchar(20),0,,"A foreign key to the
VOCABULARY table defining the
vocabulary of the source code that
is being translated to a Standard
-Concept.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+Concept.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
SOURCE_TO_CONCEPT_MAP,vocab,target_concept_id,Yes,0,,integer,0,,"The target Concept
to which the source code is being
-mapped.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-SOURCE_TO_CONCEPT_MAP,vocab,target_vocabulary_id,Yes,0,,varchar(20),0,,The Vocabulary of the target Concept.,,No,,,Yes,0,,VOCABULARY,VOCABULARY_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+mapped.",,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+SOURCE_TO_CONCEPT_MAP,vocab,target_vocabulary_id,Yes,0,,varchar(20),0,,The Vocabulary of the target Concept.,,No,,,Yes,0,,VOCABULARY,VOCABULARY_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
SOURCE_TO_CONCEPT_MAP,vocab,valid_end_date,Yes,0,,date,0,,"The date when the mapping
instance became invalid because it
was deleted or superseded
@@ -474,78 +474,78 @@ was deleted or superseded
Default value is 31-Dec-2099.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,Yes,SOURCE_TO_CONCEPT_MAP,VALID_START_DATE,0,,,,,,,,
SOURCE_TO_CONCEPT_MAP,vocab,valid_start_date,Yes,0,,date,0,,"The date when the mapping
instance was first recorded.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-SPECIMEN,cdm,anatomic_site_concept_id,No,,,integer,0,,This is the site on the body where the specimen is from.,Map the ANATOMIC_SITE_SOURCE_VALUE to a Standard Concept in the Spec Anatomic Site domain. This should be coded at the lowest level of granularity [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Spec+Anatomic+Site&conceptClass=Body+Structure&page=4&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,anatomic_site_source_value,No,,,varchar(50),0,,,"This is the site on the body where the specimen was taken from, as represented in the source.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,ANATOMIC_SITE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,disease_status_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,disease_status_source_value,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,DISEASE_STATUS_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,person_id,Yes,0,,integer,0,,The person from whom the specimen is collected.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,quantity,No,,,float,0,,The amount of specimen collected from the person.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_concept_id,Yes,0,,integer,0,,,The standard CONCEPT_ID that the SPECIMEN_SOURCE_VALUE maps to in the specimen domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Specimen&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_date,Yes,0,,date,0,,The date the specimen was collected.,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_datetime,No,,,datetime,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_id,Yes,0,,integer,0,,Unique identifier for each specimen.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_source_id,No,,,varchar(50),0,,This is the identifier for the specimen from the source system. ,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_source_value,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,SPECIMEN_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,specimen_type_concept_id,Yes,0,,integer,0,,,"Put the source of the specimen record, as in an EHR system. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Type+Concept&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,unit_concept_id,No,,,integer,0,,The unit for the quantity of the specimen.,Map the UNIT_SOURCE_VALUE to a Standard Concept in the Unit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Unit&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-SPECIMEN,cdm,unit_source_value,No,,,varchar(50),0,,,"This unit for the quantity of the specimen, as represented in the source.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,UNIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-VISIT_DETAIL,cdm,admitted_from_concept_id,No,,,Integer,0,,"Use this field to determine where the patient was admitted from. This concept is part of the visit domain and can indicate if a patient was admitted to the hospital from a long-term care facility, for example.","If available, map the admitted_from_source_value to a standard concept in the visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=). If the person was admitted from home, set this to 0.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,admitted_from_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was admitted from. Typically this applies only to visits that have a length of stay, like inpatient visits or long-term care visits.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,care_site_id,No,,,integer,0,,This field provides information about the Care Site where the Visit Detail took place.,There should only be one Care Site associated with a Visit Detail.,No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_DETAIL,cdm,discharged_to_concept_id,No,,,integer,0,,"Use this field to determine where the patient was discharged to after a visit. This concept is part of the visit domain and can indicate if a patient was transferred to another hospital or sent to a long-term care facility, for example. It is assumed that a person is discharged to home therefore there is not a standard concept id for ""home"". Use concept id = 0 when a person is discharged to home.","If available, map the DISCHARGE_TO_SOURCE_VALUE to a Standard Concept in the Visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,discharged_to_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was discharged to after a visit, as in they went home or were moved to long-term care. Typically this applies only to visits that have a length of stay of a day or more.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,parent_visit_detail_id,No,,,integer,0,,Use this field to find the visit detail that subsumes the given visit detail record. This is used in the case that a visit detail record needs to be nested beyond the VISIT_OCCURRENCE/VISIT_DETAIL relationship.,"If there are multiple nested levels to how Visits are represented in the source, the VISIT_DETAIL_PARENT_ID can be used to record this relationship. ",No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_DETAIL,cdm,preceding_visit_detail_id,No,,,integer,0,,Use this field to find the visit detail that occurred for the person prior to the given visit detail record. There could be a few days or a few years in between.,"The PRECEDING_VISIT_DETAIL_ID can be used to link a visit immediately preceding the current Visit Detail. Note this is not symmetrical, and there is no such thing as a ""following_visit_id"".",No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,provider_id,No,,,integer,0,,"There will only be one provider per **visit** record and the ETL document should clearly state how they were chosen (attending, admitting, etc.). This is a typical reason for leveraging the VISIT_DETAIL table as even though each VISIT_DETAIL record can only have one provider, there is no limit to the number of VISIT_DETAIL records that can be associated to a VISIT_OCCURRENCE record.",The additional providers associated to a Visit can be stored in this table where each VISIT_DETAIL record represents a different provider.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_DETAIL,cdm,visit_detail_concept_id,Yes,0,,integer,0,,"This field contains a concept id representing the kind of visit detail, like inpatient or outpatient. All concepts in this field should be standard and belong to the Visit domain.","Populate this field based on the kind of visit that took place for the person. For example this could be ""Inpatient Visit"", ""Outpatient Visit"", ""Ambulatory Visit"", etc. This table will contain standard concepts in the Visit domain. These concepts are arranged in a hierarchical structure to facilitate cohort definitions by rolling up to generally familiar Visits adopted in most healthcare systems worldwide. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,anatomic_site_concept_id,No,,,integer,0,,This is the site on the body where the specimen is from.,Map the ANATOMIC_SITE_SOURCE_VALUE to a Standard Concept in the Spec Anatomic Site domain. This should be coded at the lowest level of granularity [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Spec+Anatomic+Site&conceptClass=Body+Structure&page=4&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,anatomic_site_source_value,No,,,varchar(50),0,,,"This is the site on the body where the specimen was taken from, as represented in the source.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,ANATOMIC_SITE_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,disease_status_concept_id,No,,,integer,0,,,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,disease_status_source_value,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,DISEASE_STATUS_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,person_id,Yes,0,,integer,0,,The person from whom the specimen is collected.,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,quantity,No,,,float,0,,The amount of specimen collected from the person.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,1,1,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_concept_id,Yes,0,,integer,0,,,The standard CONCEPT_ID that the SPECIMEN_SOURCE_VALUE maps to in the specimen domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Specimen&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,0,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_date,Yes,0,,date,0,,The date the specimen was collected.,,No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_datetime,No,,,datetime,0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_id,Yes,0,,integer,0,,Unique identifier for each specimen.,,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_source_id,No,,,varchar(50),0,,This is the identifier for the specimen from the source system.,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_source_value,No,,,varchar(50),0,,,,No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,SPECIMEN_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,specimen_type_concept_id,Yes,0,,integer,0,,,"Put the source of the specimen record, as in an EHR system. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Type+Concept&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,unit_concept_id,No,,,integer,0,,The unit for the quantity of the specimen.,Map the UNIT_SOURCE_VALUE to a Standard Concept in the Unit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Unit&standardConcept=Standard&page=1&pageSize=15&query=),No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+SPECIMEN,cdm,unit_source_value,No,,,varchar(50),0,,,"This unit for the quantity of the specimen, as represented in the source.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,UNIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+VISIT_DETAIL,cdm,admitted_from_concept_id,No,,,Integer,0,,"Use this field to determine where the patient was admitted from. This concept is part of the visit domain and can indicate if a patient was admitted to the hospital from a long-term care facility, for example.","If available, map the admitted_from_source_value to a standard concept in the visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=). If the person was admitted from home, set this to 0.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,admitted_from_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was admitted from. Typically this applies only to visits that have a length of stay, like inpatient visits or long-term care visits.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,care_site_id,No,,,integer,0,,This field provides information about the Care Site where the Visit Detail took place.,There should only be one Care Site associated with a Visit Detail.,No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_DETAIL,cdm,discharged_to_concept_id,No,,,integer,0,,"Use this field to determine where the patient was discharged to after a visit. This concept is part of the visit domain and can indicate if a patient was transferred to another hospital or sent to a long-term care facility, for example. It is assumed that a person is discharged to home therefore there is not a standard concept id for ""home"". Use concept id = 0 when a person is discharged to home.","If available, map the DISCHARGE_TO_SOURCE_VALUE to a Standard Concept in the Visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,discharged_to_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was discharged to after a visit, as in they went home or were moved to long-term care. Typically this applies only to visits that have a length of stay of a day or more.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,parent_visit_detail_id,No,,,integer,0,,Use this field to find the visit detail that subsumes the given visit detail record. This is used in the case that a visit detail record needs to be nested beyond the VISIT_OCCURRENCE/VISIT_DETAIL relationship.,"If there are multiple nested levels to how Visits are represented in the source, the VISIT_DETAIL_PARENT_ID can be used to record this relationship.",No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_DETAIL,cdm,preceding_visit_detail_id,No,,,integer,0,,Use this field to find the visit detail that occurred for the person prior to the given visit detail record. There could be a few days or a few years in between.,"The PRECEDING_VISIT_DETAIL_ID can be used to link a visit immediately preceding the current Visit Detail. Note this is not symmetrical, and there is no such thing as a ""following_visit_id"".",No,,,Yes,0,,VISIT_DETAIL,VISIT_DETAIL_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,provider_id,No,,,integer,0,,"There will only be one provider per **visit** record and the ETL document should clearly state how they were chosen (attending, admitting, etc.). This is a typical reason for leveraging the VISIT_DETAIL table as even though each VISIT_DETAIL record can only have one provider, there is no limit to the number of VISIT_DETAIL records that can be associated to a VISIT_OCCURRENCE record.",The additional providers associated to a Visit can be stored in this table where each VISIT_DETAIL record represents a different provider.,No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_DETAIL,cdm,visit_detail_concept_id,Yes,0,,integer,0,,"This field contains a concept id representing the kind of visit detail, like inpatient or outpatient. All concepts in this field should be standard and belong to the Visit domain.","Populate this field based on the kind of visit that took place for the person. For example this could be ""Inpatient Visit"", ""Outpatient Visit"", ""Ambulatory Visit"", etc. This table will contain standard concepts in the Visit domain. These concepts are arranged in a hierarchical structure to facilitate cohort definitions by rolling up to generally familiar Visits adopted in most healthcare systems worldwide. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
VISIT_DETAIL,cdm,visit_detail_end_date,Yes,0,,date,0,,"This the end date of the patient-provider interaction. If a Person is still an inpatient in the hospital at the time of the data extract and does not have a visit_end_date, then set the visit_end_date to the date of the data pull.","Visit Detail end dates are mandatory. If end dates are not provided in the source there are three ways in which to derive them:
- Outpatient Visit Detail: visit_detail_end_datetime = visit_detail_start_datetime
- Emergency Room Visit Detail: visit_detail_end_datetime = visit_detail_start_datetime
- Inpatient Visit Detail: Usually there is information about discharge. If not, you should be able to derive the end date from the sudden decline of activity or from the absence of inpatient procedures/drugs.
- Non-hospital institution Visit Details: Particularly for claims data, if end dates are not provided assume the visit is for the duration of month that it occurs.
For Inpatient Visit Details ongoing at the date of ETL, put date of processing the data into visit_detai_end_datetime and visit_detail_type_concept_id with 32220 ""Still patient"" to identify the visit as incomplete.
-All other Visits Details: visit_detail_end_datetime = visit_detail_start_datetime. ",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_DETAIL,VISIT_DETAIL_START_DATE,1,,Yes,1,,Yes,Yes,1,
-VISIT_DETAIL,cdm,visit_detail_end_datetime,No,,,datetime,0,,"If a Person is still an inpatient in the hospital at the time of the data extract and does not have a visit_end_datetime, then set the visit_end_datetime to the datetime of the data pull.","If no time is given for the end date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_DETAIL,VISIT_DETAIL_START_DATETIME,1,,Yes,1,,Yes,,,
-VISIT_DETAIL,cdm,visit_detail_id,Yes,0,,integer,0,,Use this to identify unique interactions between a person and the health care system. This identifier links across the other CDM event tables to associate events with a visit detail.,This should be populated by creating a unique identifier for each unique interaction between a person and the healthcare system where the person receives a medical good or service over a span of time.,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_DETAIL,cdm,visit_detail_source_concept_id,No,,,Integer,0,,,If the VISIT_DETAIL_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_DETAIL,cdm,visit_detail_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the kind of visit detail that took place (inpatient, outpatient, emergency, etc.)","If there is information about the kind of visit detail in the source data that value should be stored here. If a visit is an amalgamation of visits from the source then use a hierarchy to choose the VISIT_DETAIL_SOURCE_VALUE, such as IP -> ER-> OP. This should line up with the logic chosen to determine how visits are created.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,visit_detail_start_date,Yes,0,,date,0,,This is the date of the start of the encounter. This may or may not be equal to the date of the Visit the Visit Detail is associated with.,"When populating VISIT_DETAIL_START_DATE, you should think about the patient experience to make decisions on how to define visits. Most likely this should be the date of the patient-provider interaction.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,1,
-VISIT_DETAIL,cdm,visit_detail_start_datetime,No,,,datetime,0,,,"If no time is given for the start date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-VISIT_DETAIL,cdm,visit_detail_type_concept_id,Yes,0,,integer,0,,"Use this field to understand the provenance of the visit detail record, or where the record comes from.","Populate this field based on the provenance of the visit detail record, as in whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_DETAIL,cdm,visit_occurrence_id,Yes,0,,integer,0,,Use this field to link the VISIT_DETAIL record to its VISIT_OCCURRENCE.,Put the VISIT_OCCURRENCE_ID that subsumes the VISIT_DETAIL record here.,No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_OCCURRENCE,cdm,admitted_from_concept_id,No,,,integer,0,,"Use this field to determine where the patient was admitted from. This concept is part of the visit domain and can indicate if a patient was admitted to the hospital from a long-term care facility, for example.","If available, map the admitted_from_source_value to a standard concept in the visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=). If a person was admitted from home, set this to 0.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_OCCURRENCE,cdm,admitted_from_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was admitted from. Typically this applies only to visits that have a length of stay, like inpatient visits or long-term care visits.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_OCCURRENCE,cdm,care_site_id,No,,,integer,0,,This field provides information about the Care Site where the Visit took place.,There should only be one Care Site associated with a Visit.,No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,discharged_to_concept_id,No,,,integer,0,,"Use this field to determine where the patient was discharged to after a visit. This concept is part of the visit domain and can indicate if a patient was transferred to another hospital or sent to a long-term care facility, for example. It is assumed that a person is discharged to home therefore there is not a standard concept id for ""home"". Use concept id = 0 when a person is discharged to home.","If available, map the discharged_to_source_value to a standard concept in the visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_OCCURRENCE,cdm,discharged_to_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was discharged to after a visit, as in they went home or were moved to long-term care. Typically this applies only to visits that have a length of stay of a day or more.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
-VISIT_OCCURRENCE,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,preceding_visit_occurrence_id,No,,,integer,0,,Use this field to find the visit that occurred for the person prior to the given visit. There could be a few days or a few years in between.,"This field can be used to link a visit immediately preceding the current visit. Note this is not symmetrical, and there is no such thing as a ""following_visit_id"".",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,provider_id,No,,,integer,0,,"There will only be one provider per visit record and the ETL document should clearly state how they were chosen (attending, admitting, etc.). If there are multiple providers associated with a visit in the source, this can be reflected in the event tables (CONDITION_OCCURRENCE, PROCEDURE_OCCURRENCE, etc.) or in the VISIT_DETAIL table.","If there are multiple providers associated with a visit, you will need to choose which one to put here. The additional providers can be stored in the [VISIT_DETAIL](https://ohdsi.github.io/CommonDataModel/cdm531.html#visit_detail) table.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_concept_id,Yes,0,,integer,0,,"This field contains a concept id representing the kind of visit, like inpatient or outpatient. All concepts in this field should be standard and belong to the Visit domain.","Populate this field based on the kind of visit that took place for the person. For example this could be ""Inpatient Visit"", ""Outpatient Visit"", ""Ambulatory Visit"", etc. This table will contain standard concepts in the Visit domain. These concepts are arranged in a hierarchical structure to facilitate cohort definitions by rolling up to generally familiar Visits adopted in most healthcare systems worldwide. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+All other Visits Details: visit_detail_end_datetime = visit_detail_start_datetime.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_DETAIL,VISIT_DETAIL_START_DATE,1,,Yes,1,,Yes,Yes,1,
+VISIT_DETAIL,cdm,visit_detail_end_datetime,No,,,datetime,0,,"If a Person is still an inpatient in the hospital at the time of the data extract and does not have a visit_end_datetime, then set the visit_end_datetime to the datetime of the data pull.","If no time is given for the end date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_DETAIL,VISIT_DETAIL_START_DATETIME,1,,Yes,1,,Yes,,,
+VISIT_DETAIL,cdm,visit_detail_id,Yes,0,,integer,0,,Use this to identify unique interactions between a person and the health care system. This identifier links across the other CDM event tables to associate events with a visit detail.,This should be populated by creating a unique identifier for each unique interaction between a person and the healthcare system where the person receives a medical good or service over a span of time.,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_DETAIL,cdm,visit_detail_source_concept_id,No,,,Integer,0,,,If the VISIT_DETAIL_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_DETAIL,cdm,visit_detail_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the kind of visit detail that took place (inpatient, outpatient, emergency, etc.)","If there is information about the kind of visit detail in the source data that value should be stored here. If a visit is an amalgamation of visits from the source then use a hierarchy to choose the VISIT_DETAIL_SOURCE_VALUE, such as IP -> ER-> OP. This should line up with the logic chosen to determine how visits are created.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,visit_detail_start_date,Yes,0,,date,0,,This is the date of the start of the encounter. This may or may not be equal to the date of the Visit the Visit Detail is associated with.,"When populating VISIT_DETAIL_START_DATE, you should think about the patient experience to make decisions on how to define visits. Most likely this should be the date of the patient-provider interaction.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,Yes,1,
+VISIT_DETAIL,cdm,visit_detail_start_datetime,No,,,datetime,0,,,"If no time is given for the start date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+VISIT_DETAIL,cdm,visit_detail_type_concept_id,Yes,0,,integer,0,,"Use this field to understand the provenance of the visit detail record, or where the record comes from.","Populate this field based on the provenance of the visit detail record, as in whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_DETAIL,cdm,visit_occurrence_id,Yes,0,,integer,0,,Use this field to link the VISIT_DETAIL record to its VISIT_OCCURRENCE.,Put the VISIT_OCCURRENCE_ID that subsumes the VISIT_DETAIL record here.,No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_OCCURRENCE,cdm,admitted_from_concept_id,No,,,integer,0,,"Use this field to determine where the patient was admitted from. This concept is part of the visit domain and can indicate if a patient was admitted to the hospital from a long-term care facility, for example.","If available, map the admitted_from_source_value to a standard concept in the visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=). If a person was admitted from home, set this to 0.",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_OCCURRENCE,cdm,admitted_from_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was admitted from. Typically this applies only to visits that have a length of stay, like inpatient visits or long-term care visits.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_OCCURRENCE,cdm,care_site_id,No,,,integer,0,,This field provides information about the Care Site where the Visit took place.,There should only be one Care Site associated with a Visit.,No,,,Yes,0,,CARE_SITE,CARE_SITE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,discharged_to_concept_id,No,,,integer,0,,"Use this field to determine where the patient was discharged to after a visit. This concept is part of the visit domain and can indicate if a patient was transferred to another hospital or sent to a long-term care facility, for example. It is assumed that a person is discharged to home therefore there is not a standard concept id for ""home"". Use concept id = 0 when a person is discharged to home.","If available, map the discharged_to_source_value to a standard concept in the visit domain. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,100,,Yes,5,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_OCCURRENCE,cdm,discharged_to_source_value,No,,,varchar(50),0,,,"This information may be called something different in the source data but the field is meant to contain a value indicating where a person was discharged to after a visit, as in they went home or were moved to long-term care. Typically this applies only to visits that have a length of stay of a day or more.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+VISIT_OCCURRENCE,cdm,person_id,Yes,0,,integer,0,,,,No,,,Yes,0,,PERSON,PERSON_ID,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,preceding_visit_occurrence_id,No,,,integer,0,,Use this field to find the visit that occurred for the person prior to the given visit. There could be a few days or a few years in between.,"This field can be used to link a visit immediately preceding the current visit. Note this is not symmetrical, and there is no such thing as a ""following_visit_id"".",No,,,Yes,0,,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,provider_id,No,,,integer,0,,"There will only be one provider per visit record and the ETL document should clearly state how they were chosen (attending, admitting, etc.). If there are multiple providers associated with a visit in the source, this can be reflected in the event tables (CONDITION_OCCURRENCE, PROCEDURE_OCCURRENCE, etc.) or in the VISIT_DETAIL table.","If there are multiple providers associated with a visit, you will need to choose which one to put here. The additional providers can be stored in the [VISIT_DETAIL](https://ohdsi.github.io/CommonDataModel/cdm531.html#visit_detail) table.",No,,,Yes,0,,PROVIDER,PROVIDER_ID,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_concept_id,Yes,0,,integer,0,,"This field contains a concept id representing the kind of visit, like inpatient or outpatient. All concepts in this field should be standard and belong to the Visit domain.","Populate this field based on the kind of visit that took place for the person. For example this could be ""Inpatient Visit"", ""Outpatient Visit"", ""Ambulatory Visit"", etc. This table will contain standard concepts in the Visit domain. These concepts are arranged in a hierarchical structure to facilitate cohort definitions by rolling up to generally familiar Visits adopted in most healthcare systems worldwide. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Visit&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Visit,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
VISIT_OCCURRENCE,cdm,visit_end_date,Yes,0,,date,0,,"For inpatient visits the end date is typically the discharge date. If a Person is still an inpatient in the hospital at the time of the data extract and does not have a visit_end_date, then set the visit_end_date to the date of the data pull.","Visit end dates are mandatory. If end dates are not provided in the source there are three ways in which to derive them:
- Outpatient Visit: visit_end_datetime = visit_start_datetime
- Emergency Room Visit: visit_end_datetime = visit_start_datetime
- Inpatient Visit: Usually there is information about discharge. If not, you should be able to derive the end date from the sudden decline of activity or from the absence of inpatient procedures/drugs.
- Non-hospital institution Visits: Particularly for claims data, if end dates are not provided assume the visit is for the duration of month that it occurs.
For Inpatient Visits ongoing at the date of ETL, put date of processing the data into visit_end_datetime and visit_type_concept_id with 32220 ""Still patient"" to identify the visit as incomplete.
-- All other Visits: visit_end_datetime = visit_start_datetime. If this is a one-day visit the end date should match the start date.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_OCCURRENCE,VISIT_START_DATE,1,,Yes,1,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_end_datetime,No,,,datetime,0,,"If a Person is still an inpatient in the hospital at the time of the data extract and does not have a visit_end_datetime, then set the visit_end_datetime to the datetime of the data pull.","If no time is given for the end date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_OCCURRENCE,VISIT_START_DATETIME,1,,Yes,1,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_occurrence_id,Yes,0,,integer,0,,Use this to identify unique interactions between a person and the health care system. This identifier links across the other CDM event tables to associate events with a visit.,This should be populated by creating a unique identifier for each unique interaction between a person and the healthcare system where the person receives a medical good or service over a span of time.,Yes,0,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_source_concept_id,No,,,integer,0,,,If the visit source value is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the kind of visit that took place (inpatient, outpatient, emergency, etc.)","If there is information about the kind of visit in the source data that value should be stored here. If a visit is an amalgamation of visits from the source then use a hierarchy to choose the visit source value, such as IP -> ER-> OP. This should line up with the logic chosen to determine how visits are created.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,Yes,100,,VISIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_start_date,Yes,0,,date,0,,"For inpatient visits, the start date is typically the admission date. For outpatient visits the start date and end date will be the same.","When populating VISIT_START_DATE, you should think about the patient experience to make decisions on how to define visits. In the case of an inpatient visit this should be the date the patient was admitted to the hospital or institution. In all other cases this should be the date of the patient-provider interaction.",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_start_datetime,No,,,datetime,0,,,"If no time is given for the start date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
-VISIT_OCCURRENCE,cdm,visit_type_concept_id,Yes,0,,Integer,0,,"Use this field to understand the provenance of the visit record, or where the record comes from.","Populate this field based on the provenance of the visit record, as in whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
-VOCABULARY,vocab,vocabulary_concept_id,Yes,0,,integer,0,,A Concept that represents the Vocabulary the VOCABULARY record belongs to.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+- All other Visits: visit_end_datetime = visit_start_datetime. If this is a one-day visit the end date should match the start date.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_OCCURRENCE,VISIT_START_DATE,1,,Yes,1,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_end_datetime,No,,,datetime,0,,"If a Person is still an inpatient in the hospital at the time of the data extract and does not have a visit_end_datetime, then set the visit_end_datetime to the datetime of the data pull.","If no time is given for the end date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,VISIT_OCCURRENCE,VISIT_START_DATETIME,1,,Yes,1,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_occurrence_id,Yes,0,,integer,0,,Use this to identify unique interactions between a person and the health care system. This identifier links across the other CDM event tables to associate events with a visit.,This should be populated by creating a unique identifier for each unique interaction between a person and the healthcare system where the person receives a medical good or service over a span of time.,Yes,0,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_source_concept_id,No,,,integer,0,,,If the visit source value is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,Yes,100,,No,,,Yes,100,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_source_value,No,,,varchar(50),0,,"This field houses the verbatim value from the source data representing the kind of visit that took place (inpatient, outpatient, emergency, etc.)","If there is information about the kind of visit in the source data that value should be stored here. If a visit is an amalgamation of visits from the source then use a hierarchy to choose the visit source value, such as IP -> ER-> OP. This should line up with the logic chosen to determine how visits are created.",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,Yes,100,,VISIT_CONCEPT_ID,,,,,,,,,,,,No,,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_start_date,Yes,0,,date,0,,"For inpatient visits, the start date is typically the admission date. For outpatient visits the start date and end date will be the same.","When populating VISIT_START_DATE, you should think about the patient experience to make decisions on how to define visits. In the case of an inpatient visit this should be the date the patient was admitted to the hospital or institution. In all other cases this should be the date of the patient-provider interaction.",No,,,No,,,,,,,,,,,No,,,Yes,0,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_start_datetime,No,,,datetime,0,,,"If no time is given for the start date of a visit, set it to midnight (00:00:0000).",No,,,No,,,,,,,,,,,No,,,Yes,100,,No,,,No,,,No,,,,'19500101',1,,"DATEADD(dd,1,GETDATE())",1,,Yes,PERSON,BIRTH_DATETIME,1,,Yes,1,,Yes,,,
+VISIT_OCCURRENCE,cdm,visit_type_concept_id,Yes,0,,Integer,0,,"Use this field to understand the provenance of the visit record, or where the record comes from.","Populate this field based on the provenance of the visit record, as in whether it came from an EHR record or billing claim. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,,,Yes,0,,CONCEPT,CONCEPT_ID,Type Concept,0,,,,,Yes,0,,Yes,0,,Yes,0,,No,,,No,,,,,,,,,,,,,,,No,,,Yes,,,
+VOCABULARY,vocab,vocabulary_concept_id,Yes,0,,integer,0,,A Concept that represents the Vocabulary the VOCABULARY record belongs to.,,No,,,Yes,0,,CONCEPT,CONCEPT_ID,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
VOCABULARY,vocab,vocabulary_id,Yes,0,,varchar(20),0,,"A unique identifier for each Vocabulary, such
-as ICD9CM, SNOMED, Visit.",,Yes,0,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+as ICD9CM, SNOMED, Visit.",,Yes,0,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
VOCABULARY,vocab,vocabulary_name,Yes,0,,varchar(255),0,,"The name describing the vocabulary, for
example, International Classification of
Diseases, Ninth Revision, Clinical
-Modification, Volume 1 and 2 (NCHS) etc.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+Modification, Volume 1 and 2 (NCHS) etc.",,No,,,No,,,,,,,,,,,No,,,No,0,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
VOCABULARY,vocab,vocabulary_reference,No,,,varchar(255),0,,"External reference to documentation or
available download of the about the
-vocabulary.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
+vocabulary.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
VOCABULARY,vocab,vocabulary_version,No,,,varchar(255),0,,"Version of the Vocabulary as indicated in
-the source.",,No,,,No,,,,,,,,,,,No,,,No,,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
\ No newline at end of file
+the source.",,No,,,No,,,,,,,,,,,No,,,No,100,,No,,,No,,,No,,,,,,,,,,,,,,,,,,,,,
diff --git a/inst/csv/OMOP_CDMv5.4_Table_Level.csv b/inst/csv/OMOP_CDMv5.4_Table_Level.csv
index 62662b99..1c593ff3 100644
--- a/inst/csv/OMOP_CDMv5.4_Table_Level.csv
+++ b/inst/csv/OMOP_CDMv5.4_Table_Level.csv
@@ -1,7 +1,7 @@
cdmTableName,schema,isRequired,conceptPrefix,measurePersonCompleteness,measurePersonCompletenessThreshold,measurePersonCompletenessNotes,measureConditionEraCompleteness,measureConditionEraCompletenessThreshold,measureConditionEraCompletenessNotes,validation,tableDescription,userGuidance,etlConventions
PERSON,CDM,Yes,,No,,,No,,,,"This table serves as the central identity management for all Persons in the database. It contains records that uniquely identify each person or patient, and some demographic information. ",All records in this table are independent Persons.,"All Persons in a database needs one record in this table, unless they fail data quality requirements specified in the ETL. Persons with no Events should have a record nonetheless. If more than one data source contributes Events to the database, Persons must be reconciled, if possible, across the sources to create one single record per Person. The content of the BIRTH_DATETIME must be equivalent to the content of BIRTH_DAY, BIRTH_MONTH and BIRTH_YEAR. "
OBSERVATION_PERIOD,CDM,Yes,,Yes,0,,No,,,,"This table contains records which define spans of time during which two conditions are expected to hold: (i) Clinical Events that happened to the Person are recorded in the Event tables, and (ii) absense of records indicate such Events did not occur during this span of time.","For each Person, one or more OBSERVATION_PERIOD records may be present, but they will not overlap or be back to back to each other. Events may exist outside all of the time spans of the OBSERVATION_PERIOD records for a patient, however, absence of an Event outside these time spans cannot be construed as evidence of absence of an Event. Incidence or prevalence rates should only be calculated for the time of active OBSERVATION_PERIOD records. When constructing cohorts, outside Events can be used for inclusion criteria definition, but without any guarantee for the performance of these criteria. Also, OBSERVATION_PERIOD records can be as short as a single day, greatly disturbing the denominator of any rate calculation as part of cohort characterizations. To avoid that, apply minimal observation time as a requirement for any cohort definition.","Each Person needs to have at least one OBSERVATION_PERIOD record, which should represent time intervals with a high capture rate of Clinical Events. Some source data have very similar concepts, such as enrollment periods in insurance claims data. In other source data such as most EHR systems these time spans need to be inferred under a set of assumptions. It is the discretion of the ETL developer to define these assumptions. In many ETL solutions the start date of the first occurrence or the first high quality occurrence of a Clinical Event (Condition, Drug, Procedure, Device, Measurement, Visit) is defined as the start of the OBSERVATION_PERIOD record, and the end date of the last occurrence of last high quality occurrence of a Clinical Event, or the end of the database period becomes the end of the OBSERVATOIN_PERIOD for each Person. If a Person only has a single Clinical Event the OBSERVATION_PERIOD record can be as short as one day. Depending on these definitions it is possible that Clinical Events fall outside the time spans defined by OBSERVATION_PERIOD records. Family history or history of Clinical Events generally are not used to generate OBSERVATION_PERIOD records around the time they are referring to. Any two overlapping or adjacent OBSERVATION_PERIOD records have to be merged into one."
-VISIT_OCCURRENCE,CDM,No,VISIT_,Yes,0,,No,,,,"This table contains Events where Persons engage with the healthcare system for a duration of time. They are often also called ""Encounters"". Visits are defined by a configuration of circumstances under which they occur, such as (i) whether the patient comes to a healthcare institution, the other way around, or the interaction is remote, (ii) whether and what kind of trained medical staff is delivering the service during the Visit, and (iii) whether the Visit is transient or for a longer period involving a stay in bed. ","The configuration defining the Visit are described by Concepts in the Visit Domain, which form a hierarchical structure, but rolling up to generally familiar Visits adopted in most healthcare systems worldwide:
+VISIT_OCCURRENCE,CDM,No,VISIT_,Yes,95,,No,,,,"This table contains Events where Persons engage with the healthcare system for a duration of time. They are often also called ""Encounters"". Visits are defined by a configuration of circumstances under which they occur, such as (i) whether the patient comes to a healthcare institution, the other way around, or the interaction is remote, (ii) whether and what kind of trained medical staff is delivering the service during the Visit, and (iii) whether the Visit is transient or for a longer period involving a stay in bed. ","The configuration defining the Visit are described by Concepts in the Visit Domain, which form a hierarchical structure, but rolling up to generally familiar Visits adopted in most healthcare systems worldwide:
- [Inpatient Visit](https://athena.ohdsi.org/search-terms/terms/9201): Person visiting hospital, at a Care Site, in bed, for duration of more than one day, with physicians and other Providers permanently available to deliver service around the clock
- [Emergency Room Visit](https://athena.ohdsi.org/search-terms/terms/9203): Person visiting dedicated healthcare institution for treating emergencies, at a Care Site, within one day, with physicians and Providers permanently available to deliver service around the clock
@@ -16,15 +16,15 @@ VISIT_OCCURRENCE,CDM,No,VISIT_,Yes,0,,No,,,,"This table contains Events where Pe
- [Case Management Visit](https://athena.ohdsi.org/search-terms/terms/38004193): Person interacting with healthcare system, without a Care Site, within a day, with no Providers involved, for administrative purposes
The Visit duration, or 'length of stay', is defined as VISIT_END_DATE - VISIT_START_DATE. For all Visits this is <1 day, except Inpatient Visits and Non-hospital institution Visits. The CDM also contains the VISIT_DETAIL table where additional information about the Visit is stored, for example, transfers between units during an inpatient Visit.","Visits can be derived easily if the source data contain coding systems for Place of Service or Procedures, like CPT codes for well visits. In those cases, the codes can be looked up and mapped to a Standard Visit Concept. Otherwise, Visit Concepts have to be identified in the ETL process. This table will contain concepts in the Visit domain. These concepts are arranged in a hierarchical structure to facilitate cohort definitions by rolling up to generally familiar Visits adopted in most healthcare systems worldwide. Visits can be adjacent to each other, i.e. the end date of one can be identical with the start date of the other. As a consequence, more than one-day Visits or their descendants can be recorded for the same day. Multi-day visits must not overlap, i.e. share days other than start and end days. It is often the case that some logic should be written for how to define visits and how to assign Visit_Concept_Id. For example, in US claims outpatient visits that appear to occur within the time period of an inpatient visit can be rolled into one with the same Visit_Occurrence_Id. In EHR data inpatient visits that are within one day of each other may be strung together to create one visit. It will all depend on the source data and how encounter records should be translated to visit occurrences. Providers can be associated with a Visit through the PROVIDER_ID field, or indirectly through PROCEDURE_OCCURRENCE records linked both to the VISIT and PROVIDER tables."
-VISIT_DETAIL,CDM,No,VISIT_DETAIL_,Yes,0,,No,,,,The VISIT_DETAIL table is an optional table used to represents details of each record in the parent VISIT_OCCURRENCE table. A good example of this would be the movement between units in a hospital during an inpatient stay or claim lines associated with a one insurance claim. For every record in the VISIT_OCCURRENCE table there may be 0 or more records in the VISIT_DETAIL table with a 1:n relationship where n may be 0. The VISIT_DETAIL table is structurally very similar to VISIT_OCCURRENCE table and belongs to the visit domain.,"The configuration defining the Visit Detail is described by Concepts in the Visit Domain, which form a hierarchical structure. The Visit Detail record will have an associated to the Visit Occurrence record in two ways:
1. The Visit Detail record will have the VISIT_OCCURRENCE_ID it is associated to 2. The VISIT_DETAIL_CONCEPT_ID will be a descendant of the VISIT_CONCEPT_ID for the Visit.","It is not mandatory that the VISIT_DETAIL table be filled in, but if you find that the logic to create VISIT_OCCURRENCE records includes the roll-up of multiple smaller records to create one picture of a Visit then it is a good idea to use VISIT_DETAIL. In EHR data, for example, a Person may be in the hospital but instead of one over-arching Visit their encounters are recorded as times they interacted with a health care provider. A Person in the hospital interacts with multiple providers multiple times a day so the encounters must be strung together using some heuristic (defined by the ETL) to identify the entire Visit. In this case the encounters would be considered Visit Details and the entire Visit would be the Visit Occurrence. In this example it is also possible to use the Vocabulary to distinguish Visit Details from a Visit Occurrence by setting the VISIT_CONCEPT_ID to [9201](https://athena.ohdsi.org/search-terms/terms/9201) and the VISIT_DETAIL_CONCEPT_IDs either to 9201 or its children to indicate where the patient was in the hospital at the time of care."
-CONDITION_OCCURRENCE,CDM,No,CONDITION_,Yes,0,,No,,,,"This table contains records of Events of a Person suggesting the presence of a disease or medical condition stated as a diagnosis, a sign, or a symptom, which is either observed by a Provider or reported by the patient. ","Conditions are defined by Concepts from the Condition domain, which form a complex hierarchy. As a result, the same Person with the same disease may have multiple Condition records, which belong to the same hierarchical family. Most Condition records are mapped from diagnostic codes, but recorded signs, symptoms and summary descriptions also contribute to this table. Rule out diagnoses should not be recorded in this table, but in reality their negating nature is not always captured in the source data, and other precautions must be taken when when identifying Persons who should suffer from the recorded Condition. Record all conditions as they exist in the source data. Any decisions about diagnosis/phenotype definitions would be done through cohort specifications. These cohorts can be housed in the [COHORT](https://ohdsi.github.io/CommonDataModel/cdm531.html#payer_plan_period) table. Conditions span a time interval from start to end, but are typically recorded as single snapshot records with no end date. The reason is twofold: (i) At the time of the recording the duration is not known and later not recorded, and (ii) the Persons typically cease interacting with the healthcare system when they feel better, which leads to incomplete capture of resolved Conditions. The [CONDITION_ERA](https://ohdsi.github.io/CommonDataModel/cdm531.html#condition_era) table addresses this issue. Family history and past diagnoses ('history of') are not recorded in this table. Instead, they are listed in the [OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#observation) table. Codes written in the process of establishing the diagnosis, such as 'question of' of and 'rule out', should not represented here. Instead, they should be recorded in the [OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#observation) table, if they are used for analyses. However, this information is not always available.",Source codes and source text fields mapped to Standard Concepts of the Condition Domain have to be recorded here.
-DRUG_EXPOSURE,CDM,No,DRUG_,Yes,0,,No,,,,"This table captures records about the exposure to a Drug ingested or otherwise introduced into the body. A Drug is a biochemical substance formulated in such a way that when administered to a Person it will exert a certain biochemical effect on the metabolism. Drugs include prescription and over-the-counter medicines, vaccines, and large-molecule biologic therapies. Radiological devices ingested or applied locally do not count as Drugs.","The purpose of records in this table is to indicate an exposure to a certain drug as best as possible. In this context a drug is defined as an active ingredient. Drug Exposures are defined by Concepts from the Drug domain, which form a complex hierarchy. As a result, one DRUG_SOURCE_CONCEPT_ID may map to multiple standard concept ids if it is a combination product. Records in this table represent prescriptions written, prescriptions dispensed, and drugs administered by a provider to name a few. The DRUG_TYPE_CONCEPT_ID can be used to find and filter on these types. This table includes additional information about the drug products, the quantity given, and route of administration.",Information about quantity and dose is provided in a variety of different ways and it is important for the ETL to provide as much information as possible from the data. Depending on the provenance of the data fields may be captured differently i.e. quantity for drugs administered may have a separate meaning from quantity for prescriptions dispensed. If a patient has multiple records on the same day for the same drug or procedures the ETL should not de-dupe them unless there is probable reason to believe the item is a true data duplicate. Take note on how to handle refills for prescriptions written.
-PROCEDURE_OCCURRENCE,CDM,No,PROCEDURE_,Yes,0,,No,,,,"This table contains records of activities or processes ordered by, or carried out by, a healthcare provider on the patient with a diagnostic or therapeutic purpose.","Lab tests are not a procedure, if something is observed with an expected resulting amount and unit then it should be a measurement. Phlebotomy is a procedure but so trivial that it tends to be rarely captured. It can be assumed that there is a phlebotomy procedure associated with many lab tests, therefore it is unnecessary to add them as separate procedures. If the user finds the same procedure over concurrent days, it is assumed those records are part of a procedure lasting more than a day. This logic is in lieu of the procedure_end_date, which will be added in a future version of the CDM.","If a procedure lasts more than a day, then it should be recorded as a separate record for each day the procedure occurred, this logic is in lieu of the PROCEDURE_END_DATE, which will be added in a future version of the CDM. When dealing with duplicate records, the ETL must determine whether to sum them up into one record or keep them separate. Things to consider are: - Same Procedure - Same PROCEDURE_DATETIME - Same Visit Occurrence or Visit Detail - Same Provider - Same Modifier for Procedures. Source codes and source text fields mapped to Standard Concepts of the Procedure Domain have to be recorded here."
-DEVICE_EXPOSURE,CDM,No,DEVICE_,Yes,0,,No,,,,"The Device domain captures information about a person's exposure to a foreign physical object or instrument which is used for diagnostic or therapeutic purposes through a mechanism beyond chemical action. Devices include implantable objects (e.g. pacemakers, stents, artificial joints), medical equipment and supplies (e.g. bandages, crutches, syringes), other instruments used in medical procedures (e.g. sutures, defibrillators) and material used in clinical care (e.g. adhesives, body material, dental material, surgical material).","The distinction between Devices or supplies and Procedures are sometimes blurry, but the former are physical objects while the latter are actions, often to apply a Device or supply.",Source codes and source text fields mapped to Standard Concepts of the Device Domain have to be recorded here.
-MEASUREMENT,CDM,No,MEASUREMENT_,Yes,0,,No,,,,"The MEASUREMENT table contains records of Measurements, i.e. structured values (numerical or categorical) obtained through systematic and standardized examination or testing of a Person or Person's sample. The MEASUREMENT table contains both orders and results of such Measurements as laboratory tests, vital signs, quantitative findings from pathology reports, etc. Measurements are stored as attribute value pairs, with the attribute as the Measurement Concept and the value representing the result. The value can be a Concept (stored in VALUE_AS_CONCEPT), or a numerical value (VALUE_AS_NUMBER) with a Unit (UNIT_CONCEPT_ID). The Procedure for obtaining the sample is housed in the PROCEDURE_OCCURRENCE table, though it is unnecessary to create a PROCEDURE_OCCURRENCE record for each measurement if one does not exist in the source data. Measurements differ from Observations in that they require a standardized test or some other activity to generate a quantitative or qualitative result. If there is no result, it is assumed that the lab test was conducted but the result was not captured.","Measurements are predominately lab tests with a few exceptions, like blood pressure or function tests. Results are given in the form of a value and unit combination. When investigating measurements, look for operator_concept_ids (<, >, etc.).","Only records where the source value maps to a Concept in the measurement domain should be included in this table. Even though each Measurement always has a result, the fields VALUE_AS_NUMBER and VALUE_AS_CONCEPT_ID are not mandatory as often the result is not given in the source data. When the result is not known, the Measurement record represents just the fact that the corresponding Measurement was carried out, which in itself is already useful information for some use cases. For some Measurement Concepts, the result is included in the test. For example, ICD10 CONCEPT_ID [45548980](https://athena.ohdsi.org/search-terms/terms/45548980) 'Abnormal level of unspecified serum enzyme' indicates a Measurement and the result (abnormal). In those situations, the CONCEPT_RELATIONSHIP table in addition to the 'Maps to' record contains a second record with the relationship_id set to 'Maps to value'. In this example, the 'Maps to' relationship directs to [4046263](https://athena.ohdsi.org/search-terms/terms/4046263) 'Enzyme measurement' as well as a 'Maps to value' record to [4135493](https://athena.ohdsi.org/search-terms/terms/4135493) 'Abnormal'."
-OBSERVATION,CDM,No,OBSERVATION_,Yes,0,,No,,,,"The OBSERVATION table captures clinical facts about a Person obtained in the context of examination, questioning or a procedure. Any data that cannot be represented by any other domains, such as social and lifestyle facts, medical history, family history, etc. are recorded here.","Observations differ from Measurements in that they do not require a standardized test or some other activity to generate clinical fact. Typical observations are medical history, family history, the stated need for certain treatment, social circumstances, lifestyle choices, healthcare utilization patterns, etc. If the generation clinical facts requires a standardized testing such as lab testing or imaging and leads to a standardized result, the data item is recorded in the MEASUREMENT table. If the clinical fact observed determines a sign, symptom, diagnosis of a disease or other medical condition, it is recorded in the CONDITION_OCCURRENCE table. Valid Observation Concepts are not enforced to be from any domain though they still should be Standard Concepts.","Records whose Source Values map to any domain besides Condition, Procedure, Drug, Measurement or Device should be stored in the Observation table. Observations can be stored as attribute value pairs, with the attribute as the Observation Concept and the value representing the clinical fact. This fact can be a Concept (stored in VALUE_AS_CONCEPT), a numerical value (VALUE_AS_NUMBER), a verbatim string (VALUE_AS_STRING), or a datetime (VALUE_AS_DATETIME). Even though Observations do not have an explicit result, the clinical fact can be stated separately from the type of Observation in the VALUE_AS_* fields. It is recommended for Observations that are suggestive statements of positive assertion should have a value of 'Yes' (concept_id=4188539), recorded, even though the null value is the equivalent. "
-DEATH,CDM,No,,No,,,No,,,,"The death domain contains the clinical event for how and when a Person dies. A person can have up to one record if the source system contains evidence about the Death, such as: Condition in an administrative claim, status of enrollment into a health plan, or explicit record in EHR data.",,
-NOTE,CDM,No,,Yes,0,,No,,,,"The NOTE table captures unstructured information that was recorded by a provider about a patient in free text (in ASCII, or preferably in UTF8 format) notes on a given date. The type of note_text is CLOB or varchar(MAX) depending on RDBMS. ",,"HL7/LOINC CDO is a standard for consistent naming of documents to support a range of use cases: retrieval, organization, display, and exchange. It guides the creation of LOINC codes for clinical notes. CDO annotates each document with 5 dimensions:
+VISIT_DETAIL,CDM,No,VISIT_DETAIL_,Yes,100,,No,,,,The VISIT_DETAIL table is an optional table used to represents details of each record in the parent VISIT_OCCURRENCE table. A good example of this would be the movement between units in a hospital during an inpatient stay or claim lines associated with a one insurance claim. For every record in the VISIT_OCCURRENCE table there may be 0 or more records in the VISIT_DETAIL table with a 1:n relationship where n may be 0. The VISIT_DETAIL table is structurally very similar to VISIT_OCCURRENCE table and belongs to the visit domain.,"The configuration defining the Visit Detail is described by Concepts in the Visit Domain, which form a hierarchical structure. The Visit Detail record will have an associated to the Visit Occurrence record in two ways:
1. The Visit Detail record will have the VISIT_OCCURRENCE_ID it is associated to 2. The VISIT_DETAIL_CONCEPT_ID will be a descendant of the VISIT_CONCEPT_ID for the Visit.","It is not mandatory that the VISIT_DETAIL table be filled in, but if you find that the logic to create VISIT_OCCURRENCE records includes the roll-up of multiple smaller records to create one picture of a Visit then it is a good idea to use VISIT_DETAIL. In EHR data, for example, a Person may be in the hospital but instead of one over-arching Visit their encounters are recorded as times they interacted with a health care provider. A Person in the hospital interacts with multiple providers multiple times a day so the encounters must be strung together using some heuristic (defined by the ETL) to identify the entire Visit. In this case the encounters would be considered Visit Details and the entire Visit would be the Visit Occurrence. In this example it is also possible to use the Vocabulary to distinguish Visit Details from a Visit Occurrence by setting the VISIT_CONCEPT_ID to [9201](https://athena.ohdsi.org/search-terms/terms/9201) and the VISIT_DETAIL_CONCEPT_IDs either to 9201 or its children to indicate where the patient was in the hospital at the time of care."
+CONDITION_OCCURRENCE,CDM,No,CONDITION_,Yes,95,,No,,,,"This table contains records of Events of a Person suggesting the presence of a disease or medical condition stated as a diagnosis, a sign, or a symptom, which is either observed by a Provider or reported by the patient. ","Conditions are defined by Concepts from the Condition domain, which form a complex hierarchy. As a result, the same Person with the same disease may have multiple Condition records, which belong to the same hierarchical family. Most Condition records are mapped from diagnostic codes, but recorded signs, symptoms and summary descriptions also contribute to this table. Rule out diagnoses should not be recorded in this table, but in reality their negating nature is not always captured in the source data, and other precautions must be taken when when identifying Persons who should suffer from the recorded Condition. Record all conditions as they exist in the source data. Any decisions about diagnosis/phenotype definitions would be done through cohort specifications. These cohorts can be housed in the [COHORT](https://ohdsi.github.io/CommonDataModel/cdm531.html#payer_plan_period) table. Conditions span a time interval from start to end, but are typically recorded as single snapshot records with no end date. The reason is twofold: (i) At the time of the recording the duration is not known and later not recorded, and (ii) the Persons typically cease interacting with the healthcare system when they feel better, which leads to incomplete capture of resolved Conditions. The [CONDITION_ERA](https://ohdsi.github.io/CommonDataModel/cdm531.html#condition_era) table addresses this issue. Family history and past diagnoses ('history of') are not recorded in this table. Instead, they are listed in the [OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#observation) table. Codes written in the process of establishing the diagnosis, such as 'question of' of and 'rule out', should not represented here. Instead, they should be recorded in the [OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm531.html#observation) table, if they are used for analyses. However, this information is not always available.",Source codes and source text fields mapped to Standard Concepts of the Condition Domain have to be recorded here.
+DRUG_EXPOSURE,CDM,No,DRUG_,Yes,95,,No,,,,"This table captures records about the exposure to a Drug ingested or otherwise introduced into the body. A Drug is a biochemical substance formulated in such a way that when administered to a Person it will exert a certain biochemical effect on the metabolism. Drugs include prescription and over-the-counter medicines, vaccines, and large-molecule biologic therapies. Radiological devices ingested or applied locally do not count as Drugs.","The purpose of records in this table is to indicate an exposure to a certain drug as best as possible. In this context a drug is defined as an active ingredient. Drug Exposures are defined by Concepts from the Drug domain, which form a complex hierarchy. As a result, one DRUG_SOURCE_CONCEPT_ID may map to multiple standard concept ids if it is a combination product. Records in this table represent prescriptions written, prescriptions dispensed, and drugs administered by a provider to name a few. The DRUG_TYPE_CONCEPT_ID can be used to find and filter on these types. This table includes additional information about the drug products, the quantity given, and route of administration.",Information about quantity and dose is provided in a variety of different ways and it is important for the ETL to provide as much information as possible from the data. Depending on the provenance of the data fields may be captured differently i.e. quantity for drugs administered may have a separate meaning from quantity for prescriptions dispensed. If a patient has multiple records on the same day for the same drug or procedures the ETL should not de-dupe them unless there is probable reason to believe the item is a true data duplicate. Take note on how to handle refills for prescriptions written.
+PROCEDURE_OCCURRENCE,CDM,No,PROCEDURE_,Yes,95,,No,,,,"This table contains records of activities or processes ordered by, or carried out by, a healthcare provider on the patient with a diagnostic or therapeutic purpose.","Lab tests are not a procedure, if something is observed with an expected resulting amount and unit then it should be a measurement. Phlebotomy is a procedure but so trivial that it tends to be rarely captured. It can be assumed that there is a phlebotomy procedure associated with many lab tests, therefore it is unnecessary to add them as separate procedures. If the user finds the same procedure over concurrent days, it is assumed those records are part of a procedure lasting more than a day. This logic is in lieu of the procedure_end_date, which will be added in a future version of the CDM.","If a procedure lasts more than a day, then it should be recorded as a separate record for each day the procedure occurred, this logic is in lieu of the PROCEDURE_END_DATE, which will be added in a future version of the CDM. When dealing with duplicate records, the ETL must determine whether to sum them up into one record or keep them separate. Things to consider are: - Same Procedure - Same PROCEDURE_DATETIME - Same Visit Occurrence or Visit Detail - Same Provider - Same Modifier for Procedures. Source codes and source text fields mapped to Standard Concepts of the Procedure Domain have to be recorded here."
+DEVICE_EXPOSURE,CDM,No,DEVICE_,Yes,100,,No,,,,"The Device domain captures information about a person's exposure to a foreign physical object or instrument which is used for diagnostic or therapeutic purposes through a mechanism beyond chemical action. Devices include implantable objects (e.g. pacemakers, stents, artificial joints), medical equipment and supplies (e.g. bandages, crutches, syringes), other instruments used in medical procedures (e.g. sutures, defibrillators) and material used in clinical care (e.g. adhesives, body material, dental material, surgical material).","The distinction between Devices or supplies and Procedures are sometimes blurry, but the former are physical objects while the latter are actions, often to apply a Device or supply.",Source codes and source text fields mapped to Standard Concepts of the Device Domain have to be recorded here.
+MEASUREMENT,CDM,No,MEASUREMENT_,Yes,95,,No,,,,"The MEASUREMENT table contains records of Measurements, i.e. structured values (numerical or categorical) obtained through systematic and standardized examination or testing of a Person or Person's sample. The MEASUREMENT table contains both orders and results of such Measurements as laboratory tests, vital signs, quantitative findings from pathology reports, etc. Measurements are stored as attribute value pairs, with the attribute as the Measurement Concept and the value representing the result. The value can be a Concept (stored in VALUE_AS_CONCEPT), or a numerical value (VALUE_AS_NUMBER) with a Unit (UNIT_CONCEPT_ID). The Procedure for obtaining the sample is housed in the PROCEDURE_OCCURRENCE table, though it is unnecessary to create a PROCEDURE_OCCURRENCE record for each measurement if one does not exist in the source data. Measurements differ from Observations in that they require a standardized test or some other activity to generate a quantitative or qualitative result. If there is no result, it is assumed that the lab test was conducted but the result was not captured.","Measurements are predominately lab tests with a few exceptions, like blood pressure or function tests. Results are given in the form of a value and unit combination. When investigating measurements, look for operator_concept_ids (<, >, etc.).","Only records where the source value maps to a Concept in the measurement domain should be included in this table. Even though each Measurement always has a result, the fields VALUE_AS_NUMBER and VALUE_AS_CONCEPT_ID are not mandatory as often the result is not given in the source data. When the result is not known, the Measurement record represents just the fact that the corresponding Measurement was carried out, which in itself is already useful information for some use cases. For some Measurement Concepts, the result is included in the test. For example, ICD10 CONCEPT_ID [45548980](https://athena.ohdsi.org/search-terms/terms/45548980) 'Abnormal level of unspecified serum enzyme' indicates a Measurement and the result (abnormal). In those situations, the CONCEPT_RELATIONSHIP table in addition to the 'Maps to' record contains a second record with the relationship_id set to 'Maps to value'. In this example, the 'Maps to' relationship directs to [4046263](https://athena.ohdsi.org/search-terms/terms/4046263) 'Enzyme measurement' as well as a 'Maps to value' record to [4135493](https://athena.ohdsi.org/search-terms/terms/4135493) 'Abnormal'."
+OBSERVATION,CDM,No,OBSERVATION_,Yes,95,,No,,,,"The OBSERVATION table captures clinical facts about a Person obtained in the context of examination, questioning or a procedure. Any data that cannot be represented by any other domains, such as social and lifestyle facts, medical history, family history, etc. are recorded here.","Observations differ from Measurements in that they do not require a standardized test or some other activity to generate clinical fact. Typical observations are medical history, family history, the stated need for certain treatment, social circumstances, lifestyle choices, healthcare utilization patterns, etc. If the generation clinical facts requires a standardized testing such as lab testing or imaging and leads to a standardized result, the data item is recorded in the MEASUREMENT table. If the clinical fact observed determines a sign, symptom, diagnosis of a disease or other medical condition, it is recorded in the CONDITION_OCCURRENCE table. Valid Observation Concepts are not enforced to be from any domain though they still should be Standard Concepts.","Records whose Source Values map to any domain besides Condition, Procedure, Drug, Measurement or Device should be stored in the Observation table. Observations can be stored as attribute value pairs, with the attribute as the Observation Concept and the value representing the clinical fact. This fact can be a Concept (stored in VALUE_AS_CONCEPT), a numerical value (VALUE_AS_NUMBER), a verbatim string (VALUE_AS_STRING), or a datetime (VALUE_AS_DATETIME). Even though Observations do not have an explicit result, the clinical fact can be stated separately from the type of Observation in the VALUE_AS_* fields. It is recommended for Observations that are suggestive statements of positive assertion should have a value of 'Yes' (concept_id=4188539), recorded, even though the null value is the equivalent. "
+DEATH,CDM,No,,Yes,100,,No,,,,"The death domain contains the clinical event for how and when a Person dies. A person can have up to one record if the source system contains evidence about the Death, such as: Condition in an administrative claim, status of enrollment into a health plan, or explicit record in EHR data.",,
+NOTE,CDM,No,,Yes,100,,No,,,,"The NOTE table captures unstructured information that was recorded by a provider about a patient in free text (in ASCII, or preferably in UTF8 format) notes on a given date. The type of note_text is CLOB or varchar(MAX) depending on RDBMS. ",,"HL7/LOINC CDO is a standard for consistent naming of documents to support a range of use cases: retrieval, organization, display, and exchange. It guides the creation of LOINC codes for clinical notes. CDO annotates each document with 5 dimensions:
- **Kind of Document**: Characterizes the general structure of the document at a macro level (e.g. Anesthesia Consent)
- **Type of Service**: Characterizes the kind of service or activity (e.g. evaluations, consultations, and summaries). The notion of time sequence, e.g., at the beginning (admission) at the end (discharge) is subsumed in this axis. Example: Discharge Teaching.
@@ -36,20 +36,20 @@ Each combination of these 5 dimensions rolls up to a unique LOINC code.
According to CDO requirements, only 2 of the 5 dimensions are required to properly annotate a document; Kind of Document and any one of the other 4 dimensions.
However, not all the permutations of the CDO dimensions will necessarily yield an existing LOINC code. Each of these dimensions are contained in the OMOP Vocabulary under the domain of 'Meas Value' with each dimension represented as a Concept Class. "
NOTE_NLP,CDM,No,,No,,,No,,,,The NOTE_NLP table encodes all output of NLP on clinical notes. Each row represents a single extracted term from a note.,,
-SPECIMEN,CDM,No,SPECIMEN_,Yes,0,,No,,,,The specimen domain contains the records identifying biological samples from a person.,,"Anatomic site is coded at the most specific level of granularity possible, such that higher level classifications can be derived using the Standardized Vocabularies."
+SPECIMEN,CDM,No,SPECIMEN_,Yes,100,,No,,,,The specimen domain contains the records identifying biological samples from a person.,,"Anatomic site is coded at the most specific level of granularity possible, such that higher level classifications can be derived using the Standardized Vocabularies."
FACT_RELATIONSHIP,CDM,No,,No,,,No,,,,"The FACT_RELATIONSHIP table contains records about the relationships between facts stored as records in any table of the CDM. Relationships can be defined between facts from the same domain, or different domains. Examples of Fact Relationships include: [Person relationships](https://athena.ohdsi.org/search-terms/terms?domain=Relationship&standardConcept=Standard&page=2&pageSize=15&query=) (parent-child), care site relationships (hierarchical organizational structure of facilities within a health system), indication relationship (between drug exposures and associated conditions), usage relationships (of devices during the course of an associated procedure), or facts derived from one another (measurements derived from an associated specimen).",,"All relationships are directional, and each relationship is represented twice symmetrically within the FACT_RELATIONSHIP table. For example, two persons if person_id = 1 is the mother of person_id = 2 two records are in the FACT_RELATIONSHIP table (all strings in fact concept_id records in the Concept table:
- Person, 1, Person, 2, parent of
- Person, 2, Person, 1, child of"
LOCATION,CDM,No,,No,,,No,,,,The LOCATION table represents a generic way to capture physical location or address information of Persons and Care Sites.,"The current iteration of the LOCATION table is US centric. Until a major release to correct this, certain fields can be used to represent different international values.
- STATE can also be used for province or district
- ZIP is also the postal code or postcode
- COUNTY can also be used to represent region","Each address or Location is unique and is present only once in the table. Locations do not contain names, such as the name of a hospital. In order to construct a full address that can be used in the postal service, the address information from the Location needs to be combined with information from the Care Site."
CARE_SITE,CDM,No,,No,,,No,,,,"The CARE_SITE table contains a list of uniquely identified institutional (physical or organizational) units where healthcare delivery is practiced (offices, wards, hospitals, clinics, etc.).",,"Care site is a unique combination of location_id and place_of_service_source_value. Care site does not take into account the provider (human) information such a specialty. Many source data do not make a distinction between individual and institutional providers. The CARE_SITE table contains the institutional providers. If the source, instead of uniquely identifying individual Care Sites, only provides limited information such as Place of Service, generic or ""pooled"" Care Site records are listed in the CARE_SITE table. There can be hierarchical and business relationships between Care Sites. For example, wards can belong to clinics or departments, which can in turn belong to hospitals, which in turn can belong to hospital systems, which in turn can belong to HMOs.The relationships between Care Sites are defined in the FACT_RELATIONSHIP table."
PROVIDER,CDM,No,,No,,,No,,,,"The PROVIDER table contains a list of uniquely identified healthcare providers. These are individuals providing hands-on healthcare to patients, such as physicians, nurses, midwives, physical therapists etc.","Many sources do not make a distinction between individual and institutional providers. The PROVIDER table contains the individual providers. If the source, instead of uniquely identifying individual providers, only provides limited information such as specialty, generic or 'pooled' Provider records are listed in the PROVIDER table.",
-PAYER_PLAN_PERIOD,CDM,No,,Yes,0,,No,,,,"The PAYER_PLAN_PERIOD table captures details of the period of time that a Person is continuously enrolled under a specific health Plan benefit structure from a given Payer. Each Person receiving healthcare is typically covered by a health benefit plan, which pays for (fully or partially), or directly provides, the care. These benefit plans are provided by payers, such as health insurances or state or government agencies. In each plan the details of the health benefits are defined for the Person or her family, and the health benefit Plan might change over time typically with increasing utilization (reaching certain cost thresholds such as deductibles), plan availability and purchasing choices of the Person. The unique combinations of Payer organizations, health benefit Plans and time periods in which they are valid for a Person are recorded in this table.","A Person can have multiple, overlapping, Payer_Plan_Periods in this table. For example, medical and drug coverage in the US can be represented by two Payer_Plan_Periods. The details of the benefit structure of the Plan is rarely known, the idea is just to identify that the Plans are different.",
+PAYER_PLAN_PERIOD,CDM,No,,Yes,100,,No,,,,"The PAYER_PLAN_PERIOD table captures details of the period of time that a Person is continuously enrolled under a specific health Plan benefit structure from a given Payer. Each Person receiving healthcare is typically covered by a health benefit plan, which pays for (fully or partially), or directly provides, the care. These benefit plans are provided by payers, such as health insurances or state or government agencies. In each plan the details of the health benefits are defined for the Person or her family, and the health benefit Plan might change over time typically with increasing utilization (reaching certain cost thresholds such as deductibles), plan availability and purchasing choices of the Person. The unique combinations of Payer organizations, health benefit Plans and time periods in which they are valid for a Person are recorded in this table.","A Person can have multiple, overlapping, Payer_Plan_Periods in this table. For example, medical and drug coverage in the US can be represented by two Payer_Plan_Periods. The details of the benefit structure of the Plan is rarely known, the idea is just to identify that the Plans are different.",
COST,CDM,No,,No,,,No,,,,"The COST table captures records containing the cost of any medical event recorded in one of the OMOP clinical event tables such as DRUG_EXPOSURE, PROCEDURE_OCCURRENCE, VISIT_OCCURRENCE, VISIT_DETAIL, DEVICE_OCCURRENCE, OBSERVATION or MEASUREMENT.
Each record in the cost table account for the amount of money transacted for the clinical event. So, the COST table may be used to represent both receivables (charges) and payments (paid), each transaction type represented by its COST_CONCEPT_ID. The COST_TYPE_CONCEPT_ID field will use concepts in the Standardized Vocabularies to designate the source (provenance) of the cost data. A reference to the health plan information in the PAYER_PLAN_PERIOD table is stored in the record for information used for the adjudication system to determine the persons benefit for the clinical event.","When dealing with summary costs, the cost of the goods or services the provider provides is often not known directly, but derived from the hospital charges multiplied by an average cost-to-charge ratio.","One cost record is generated for each response by a payer. In a claims databases, the payment and payment terms reported by the payer for the goods or services billed will generate one cost record. If the source data has payment information for more than one payer (i.e. primary insurance and secondary insurance payment for one entity), then a cost record is created for each reporting payer. Therefore, it is possible for one procedure to have multiple cost records for each payer, but typically it contains one or no record per entity. Payer reimbursement cost records will be identified by using the PAYER_PLAN_ID field. Drug costs are composed of ingredient cost (the amount charged by the wholesale distributor or manufacturer), the dispensing fee (the amount charged by the pharmacy and the sales tax)."
-DRUG_ERA,CDM,No,,Yes,0,,No,,,,"A Drug Era is defined as a span of time when the Person is assumed to be exposed to a particular active ingredient. A Drug Era is not the same as a Drug Exposure: Exposures are individual records corresponding to the source when Drug was delivered to the Person, while successive periods of Drug Exposures are combined under certain rules to produce continuous Drug Eras.",,The SQL script for generating DRUG_ERA records can be found [here](https://ohdsi.github.io/CommonDataModel/sqlScripts.html#drug_eras).
-DOSE_ERA,CDM,No,,Yes,0,,No,,,,A Dose Era is defined as a span of time when the Person is assumed to be exposed to a constant dose of a specific active ingredient.,,"Dose Eras will be derived from records in the DRUG_EXPOSURE table and the Dose information from the DRUG_STRENGTH table using a standardized algorithm. Dose Form information is not taken into account. So, if the patient changes between different formulations, or different manufacturers with the same formulation, the Dose Era is still spanning the entire time of exposure to the Ingredient. "
-CONDITION_ERA,CDM,No,,Yes,0,,Yes,0,,,"A Condition Era is defined as a span of time when the Person is assumed to have a given condition. Similar to Drug Eras, Condition Eras are chronological periods of Condition Occurrence. Combining individual Condition Occurrences into a single Condition Era serves two purposes:
+DRUG_ERA,CDM,No,,Yes,95,,No,,,,"A Drug Era is defined as a span of time when the Person is assumed to be exposed to a particular active ingredient. A Drug Era is not the same as a Drug Exposure: Exposures are individual records corresponding to the source when Drug was delivered to the Person, while successive periods of Drug Exposures are combined under certain rules to produce continuous Drug Eras.",,The SQL script for generating DRUG_ERA records can be found [here](https://ohdsi.github.io/CommonDataModel/sqlScripts.html#drug_eras).
+DOSE_ERA,CDM,No,,Yes,100,,No,,,,A Dose Era is defined as a span of time when the Person is assumed to be exposed to a constant dose of a specific active ingredient.,,"Dose Eras will be derived from records in the DRUG_EXPOSURE table and the Dose information from the DRUG_STRENGTH table using a standardized algorithm. Dose Form information is not taken into account. So, if the patient changes between different formulations, or different manufacturers with the same formulation, the Dose Era is still spanning the entire time of exposure to the Ingredient. "
+CONDITION_ERA,CDM,No,,Yes,95,,Yes,0,,,"A Condition Era is defined as a span of time when the Person is assumed to have a given condition. Similar to Drug Eras, Condition Eras are chronological periods of Condition Occurrence. Combining individual Condition Occurrences into a single Condition Era serves two purposes:
- It allows aggregation of chronic conditions that require frequent ongoing care, instead of treating each Condition Occurrence as an independent event.
- It allows aggregation of multiple, closely timed doctor visits for the same Condition to avoid double-counting the Condition Occurrences.
@@ -78,4 +78,4 @@ This table is entirely derived from the CONCEPT, CONCEPT_RELATIONSHIP and RELATI
SOURCE_TO_CONCEPT_MAP,VOCAB,No,,No,,,No,,,,"The source to concept map table is a legacy data structure within the OMOP Common Data Model, recommended for use in ETL processes to maintain local source codes which are not available as Concepts in the Standardized Vocabularies, and to establish mappings for each source code into a Standard Concept as target_concept_ids that can be used to populate the Common Data Model tables. The SOURCE_TO_CONCEPT_MAP table is no longer populated with content within the Standardized Vocabularies published to the OMOP community.",,
DRUG_STRENGTH,VOCAB,No,,No,,,No,,,,The DRUG_STRENGTH table contains structured content about the amount or concentration and associated units of a specific ingredient contained within a particular drug product. This table is supplemental information to support standardized analysis of drug utilization.,,
COHORT,COHORT,No,,No,,,No,,,,The COHORT table contains records of subjects that satisfy a given set of criteria for a duration of time. The definition of the cohort is contained within the COHORT_DEFINITION table. It is listed as part of the RESULTS schema because it is a table that users of the database as well as tools such as ATLAS need to be able to write to. The CDM and Vocabulary tables are all read-only so it is suggested that the COHORT and COHORT_DEFINTION tables are kept in a separate schema to alleviate confusion.,,"Cohorts typically include patients diagnosed with a specific condition, patients exposed to a particular drug, but can also be Providers who have performed a specific Procedure. Cohort records must have a Start Date and an End Date, but the End Date may be set to Start Date or could have an applied censor date using the Observation Period Start Date. Cohort records must contain a Subject Id, which can refer to the Person, Provider, Visit record or Care Site though they are most often Person Ids. The Cohort Definition will define the type of subject through the subject concept id. A subject can belong (or not belong) to a cohort at any moment in time. A subject can only have one record in the cohort table for any moment of time, i.e. it is not possible for a person to contain multiple records indicating cohort membership that are overlapping in time"
-COHORT_DEFINITION,COHORT,No,,No,,,No,,,,"The COHORT_DEFINITION table contains records defining a Cohort derived from the data through the associated description and syntax and upon instantiation (execution of the algorithm) placed into the COHORT table. Cohorts are a set of subjects that satisfy a given combination of inclusion criteria for a duration of time. The COHORT_DEFINITION table provides a standardized structure for maintaining the rules governing the inclusion of a subject into a cohort, and can store operational programming code to instantiate the cohort within the OMOP Common Data Model.",,
\ No newline at end of file
+COHORT_DEFINITION,COHORT,No,,No,,,No,,,,"The COHORT_DEFINITION table contains records defining a Cohort derived from the data through the associated description and syntax and upon instantiation (execution of the algorithm) placed into the COHORT table. Cohorts are a set of subjects that satisfy a given combination of inclusion criteria for a duration of time. The COHORT_DEFINITION table provides a standardized structure for maintaining the rules governing the inclusion of a subject into a cohort, and can store operational programming code to instantiate the cohort within the OMOP Common Data Model.",,
diff --git a/inst/doc/AddNewCheck.pdf b/inst/doc/AddNewCheck.pdf
index 87d2bb58..50f6d97c 100644
Binary files a/inst/doc/AddNewCheck.pdf and b/inst/doc/AddNewCheck.pdf differ
diff --git a/inst/doc/CheckStatusDefinitions.pdf b/inst/doc/CheckStatusDefinitions.pdf
index ff2740f1..0b2209f7 100644
Binary files a/inst/doc/CheckStatusDefinitions.pdf and b/inst/doc/CheckStatusDefinitions.pdf differ
diff --git a/inst/doc/CheckTypeDescriptions.pdf b/inst/doc/CheckTypeDescriptions.pdf
index 1c0399d6..6fddddff 100644
Binary files a/inst/doc/CheckTypeDescriptions.pdf and b/inst/doc/CheckTypeDescriptions.pdf differ
diff --git a/inst/doc/DataQualityDashboard.pdf b/inst/doc/DataQualityDashboard.pdf
index e35750d9..89042448 100644
Binary files a/inst/doc/DataQualityDashboard.pdf and b/inst/doc/DataQualityDashboard.pdf differ
diff --git a/inst/doc/DqdForCohorts.pdf b/inst/doc/DqdForCohorts.pdf
index 306e46d5..d692f689 100644
Binary files a/inst/doc/DqdForCohorts.pdf and b/inst/doc/DqdForCohorts.pdf differ
diff --git a/inst/doc/SqlOnly.pdf b/inst/doc/SqlOnly.pdf
new file mode 100644
index 00000000..4f9f5637
Binary files /dev/null and b/inst/doc/SqlOnly.pdf differ
diff --git a/inst/doc/Thresholds.pdf b/inst/doc/Thresholds.pdf
index 0aa1e7f2..6775e554 100644
Binary files a/inst/doc/Thresholds.pdf and b/inst/doc/Thresholds.pdf differ
diff --git a/inst/shinyApps/app.R b/inst/shinyApps/app.R
index 51f17076..c493b5fa 100755
--- a/inst/shinyApps/app.R
+++ b/inst/shinyApps/app.R
@@ -2,7 +2,7 @@ library(shiny)
server <- function(input, output, session) {
observe({
jsonPath <- Sys.getenv("jsonPath")
- results <- convertJsonResultsFileCase(jsonPath, writeToFile = FALSE, targetCase = "camel")
+ results <- DataQualityDashboard::convertJsonResultsFileCase(jsonPath, writeToFile = FALSE, targetCase = "camel")
results <- jsonlite::parse_json(jsonlite::toJSON(results))
session$sendCustomMessage("results", results)
})
diff --git a/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=1-insert.sql b/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=1-insert.sql
deleted file mode 100644
index e3ddf7bd..00000000
--- a/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=1-insert.sql
+++ /dev/null
@@ -1,2715 +0,0 @@
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION_PERIOD table' as check_description
-
- ,'OBSERVATION_PERIOD' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_observation_period' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 0 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 0 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,0 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = OBSERVATION_PERIOD
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.OBSERVATION_PERIOD cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_OCCURRENCE table' as check_description
-
- ,'VISIT_OCCURRENCE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_visit_occurrence' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = VISIT_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.VISIT_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_OCCURRENCE table' as check_description
-
- ,'CONDITION_OCCURRENCE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_condition_occurrence' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = CONDITION_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.CONDITION_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_EXPOSURE table' as check_description
-
- ,'DRUG_EXPOSURE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_drug_exposure' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DRUG_EXPOSURE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DRUG_EXPOSURE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the PROCEDURE_OCCURRENCE table' as check_description
-
- ,'PROCEDURE_OCCURRENCE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_procedure_occurrence' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = PROCEDURE_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.PROCEDURE_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DEVICE_EXPOSURE table' as check_description
-
- ,'DEVICE_EXPOSURE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_device_exposure' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DEVICE_EXPOSURE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DEVICE_EXPOSURE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the MEASUREMENT table' as check_description
-
- ,'MEASUREMENT' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_measurement' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = MEASUREMENT
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.MEASUREMENT cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_DETAIL table' as check_description
-
- ,'VISIT_DETAIL' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_visit_detail' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = VISIT_DETAIL
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.VISIT_DETAIL cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the NOTE table' as check_description
-
- ,'NOTE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_note' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = NOTE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.NOTE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION table' as check_description
-
- ,'OBSERVATION' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_observation' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = OBSERVATION
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.OBSERVATION cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the SPECIMEN table' as check_description
-
- ,'SPECIMEN' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_specimen' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = SPECIMEN
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.SPECIMEN cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the PAYER_PLAN_PERIOD table' as check_description
-
- ,'PAYER_PLAN_PERIOD' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_payer_plan_period' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = PAYER_PLAN_PERIOD
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.PAYER_PLAN_PERIOD cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_ERA table' as check_description
-
- ,'DRUG_ERA' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_drug_era' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DRUG_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DRUG_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DOSE_ERA table' as check_description
-
- ,'DOSE_ERA' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_dose_era' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DOSE_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DOSE_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_ERA table' as check_description
-
- ,'CONDITION_ERA' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_condition_era' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = CONDITION_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.CONDITION_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
diff --git a/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=1-legacy.sql b/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=1-legacy.sql
deleted file mode 100644
index dacbe470..00000000
--- a/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=1-legacy.sql
+++ /dev/null
@@ -1,1335 +0,0 @@
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = OBSERVATION_PERIOD
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.OBSERVATION_PERIOD cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = VISIT_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.VISIT_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = CONDITION_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.CONDITION_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DRUG_EXPOSURE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DRUG_EXPOSURE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = PROCEDURE_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.PROCEDURE_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DEVICE_EXPOSURE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DEVICE_EXPOSURE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = MEASUREMENT
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.MEASUREMENT cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = VISIT_DETAIL
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.VISIT_DETAIL cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = NOTE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.NOTE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = OBSERVATION
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.OBSERVATION cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = SPECIMEN
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.SPECIMEN cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = PAYER_PLAN_PERIOD
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.PAYER_PLAN_PERIOD cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DRUG_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DRUG_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DOSE_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DOSE_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = CONDITION_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.CONDITION_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-;
diff --git a/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=4-insert.sql b/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=4-insert.sql
deleted file mode 100644
index 6bac6787..00000000
--- a/inst/testdata/TABLE_measurePersonCompleteness-mssql-union=4-insert.sql
+++ /dev/null
@@ -1,2462 +0,0 @@
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION_PERIOD table' as check_description
-
- ,'OBSERVATION_PERIOD' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_observation_period' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 0 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 0 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,0 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = OBSERVATION_PERIOD
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.OBSERVATION_PERIOD cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_OCCURRENCE table' as check_description
-
- ,'VISIT_OCCURRENCE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_visit_occurrence' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = VISIT_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.VISIT_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_OCCURRENCE table' as check_description
-
- ,'CONDITION_OCCURRENCE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_condition_occurrence' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = CONDITION_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.CONDITION_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_EXPOSURE table' as check_description
-
- ,'DRUG_EXPOSURE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_drug_exposure' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DRUG_EXPOSURE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DRUG_EXPOSURE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the PROCEDURE_OCCURRENCE table' as check_description
-
- ,'PROCEDURE_OCCURRENCE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_procedure_occurrence' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = PROCEDURE_OCCURRENCE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.PROCEDURE_OCCURRENCE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DEVICE_EXPOSURE table' as check_description
-
- ,'DEVICE_EXPOSURE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_device_exposure' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DEVICE_EXPOSURE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DEVICE_EXPOSURE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the MEASUREMENT table' as check_description
-
- ,'MEASUREMENT' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_measurement' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = MEASUREMENT
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.MEASUREMENT cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_DETAIL table' as check_description
-
- ,'VISIT_DETAIL' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_visit_detail' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = VISIT_DETAIL
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.VISIT_DETAIL cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the NOTE table' as check_description
-
- ,'NOTE' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_note' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = NOTE
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.NOTE cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION table' as check_description
-
- ,'OBSERVATION' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_observation' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = OBSERVATION
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.OBSERVATION cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the SPECIMEN table' as check_description
-
- ,'SPECIMEN' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_specimen' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = SPECIMEN
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.SPECIMEN cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the PAYER_PLAN_PERIOD table' as check_description
-
- ,'PAYER_PLAN_PERIOD' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_payer_plan_period' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = PAYER_PLAN_PERIOD
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.PAYER_PLAN_PERIOD cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
-/*********
-
-SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
-
-Note that this does not include information about SQL errors or performance
-
-**********/
-
-
-
-WITH cte_all AS (
-
- /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_ERA table' as check_description
-
- ,'DRUG_ERA' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_drug_era' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DRUG_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DRUG_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the DOSE_ERA table' as check_description
-
- ,'DOSE_ERA' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_dose_era' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,100 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = DOSE_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.DOSE_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
- UNION ALL /*********
-
-SQL to create query for insertion into results table. These may be unioned together prior to insert.
-
-Note that this does not include information about SQL errors or performance.
-
-**********/
-
-
-
-SELECT
-
- cte.num_violated_rows
-
- ,cte.pct_violated_rows
-
- ,cte.num_denominator_rows
-
- ,'' as execution_time
-
- ,'' as query_text
-
- ,'measurePersonCompleteness' as check_name
-
- ,'TABLE' as check_level
-
- ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_ERA table' as check_description
-
- ,'CONDITION_ERA' as cdm_table_name
-
- ,'NA' as cdm_field_name
-
- ,'NA' as concept_id
-
- ,'NA' as unit_concept_id
-
- ,'table_person_completeness.sql' as sql_file
-
- ,'Completeness' as category
-
- ,'NA' as subcategory
-
- ,'Validation' as context
-
- ,'' as warning
-
- ,'' as error
-
- ,'table_measurepersoncompleteness_condition_era' as checkid
-
- ,0 as is_error
-
- ,0 as not_applicable
-
- ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
-
- ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
-
- ,NULL as not_applicable_reason
-
- ,95 as threshold_value
-
- ,NULL as notes_value
-
-FROM (
-
-
-
-/*********
-
-Table Level:
-
-MEASURE_PERSON_COMPLETENESS
-
-Determine what #/% of persons have at least one record in the cdmTable
-
-
-
-Parameters used in this template:
-
-schema = @yourCdmSchema
-
-cdmTableName = CONDITION_ERA
-
-
-
-**********/
-
-
-
-
-
-SELECT
-
- num_violated_rows,
-
- CASE
-
- WHEN denominator.num_rows = 0 THEN 0
-
- ELSE 1.0*num_violated_rows/denominator.num_rows
-
- END AS pct_violated_rows,
-
- denominator.num_rows AS num_denominator_rows
-
-FROM
-
-(
-
- SELECT
-
- COUNT_BIG(violated_rows.person_id) AS num_violated_rows
-
- FROM
-
- (
-
- /*violatedRowsBegin*/
-
- SELECT
-
- cdmTable.*
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
- LEFT JOIN @yourCdmSchema.CONDITION_ERA cdmTable2
-
- ON cdmTable.person_id = cdmTable2.person_id
-
- WHERE cdmTable2.person_id IS NULL
-
- /*violatedRowsEnd*/
-
- ) violated_rows
-
-) violated_row_count,
-
-(
-
- SELECT
-
- COUNT_BIG(*) AS num_rows
-
- FROM @yourCdmSchema.person cdmTable
-
-
-
-) denominator
-
-
-
-
-
-) cte
-
-
-
-)
-
-INSERT INTO @yourResultsSchema.dqdashboard_results
-
-SELECT *
-
-FROM cte_all
-
-;
diff --git a/tests/testthat/_snaps/executeDqChecks.md b/tests/testthat/_snaps/executeDqChecks.md
new file mode 100644
index 00000000..dec7ddf0
--- /dev/null
+++ b/tests/testthat/_snaps/executeDqChecks.md
@@ -0,0 +1,3526 @@
+# Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=4 and sqlOnlyIncrementalInsert=TRUE
+
+ Code
+ cat(SqlRender::readSql(dqdSqlFilePath))
+ Output
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION_PERIOD table' as check_description
+ ,'OBSERVATION_PERIOD' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_observation_period' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 0 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 0 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,0 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = OBSERVATION_PERIOD
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.OBSERVATION_PERIOD cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_OCCURRENCE table' as check_description
+ ,'VISIT_OCCURRENCE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_visit_occurrence' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = VISIT_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.VISIT_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_OCCURRENCE table' as check_description
+ ,'CONDITION_OCCURRENCE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_condition_occurrence' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = CONDITION_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.CONDITION_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_EXPOSURE table' as check_description
+ ,'DRUG_EXPOSURE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_drug_exposure' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DRUG_EXPOSURE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DRUG_EXPOSURE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the PROCEDURE_OCCURRENCE table' as check_description
+ ,'PROCEDURE_OCCURRENCE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_procedure_occurrence' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = PROCEDURE_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.PROCEDURE_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DEVICE_EXPOSURE table' as check_description
+ ,'DEVICE_EXPOSURE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_device_exposure' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DEVICE_EXPOSURE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DEVICE_EXPOSURE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the MEASUREMENT table' as check_description
+ ,'MEASUREMENT' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_measurement' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = MEASUREMENT
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.MEASUREMENT cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_DETAIL table' as check_description
+ ,'VISIT_DETAIL' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_visit_detail' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = VISIT_DETAIL
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.VISIT_DETAIL cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the NOTE table' as check_description
+ ,'NOTE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_note' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = NOTE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.NOTE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION table' as check_description
+ ,'OBSERVATION' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_observation' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = OBSERVATION
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.OBSERVATION cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the SPECIMEN table' as check_description
+ ,'SPECIMEN' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_specimen' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = SPECIMEN
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.SPECIMEN cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the PAYER_PLAN_PERIOD table' as check_description
+ ,'PAYER_PLAN_PERIOD' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_payer_plan_period' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = PAYER_PLAN_PERIOD
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.PAYER_PLAN_PERIOD cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_ERA table' as check_description
+ ,'DRUG_ERA' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_drug_era' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DRUG_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DRUG_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DOSE_ERA table' as check_description
+ ,'DOSE_ERA' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_dose_era' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DOSE_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DOSE_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_ERA table' as check_description
+ ,'CONDITION_ERA' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_condition_era' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = CONDITION_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.CONDITION_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+ UNION ALL /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DEATH table' as check_description
+ ,'DEATH' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_death' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DEATH
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DEATH cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+
+# Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=1 and sqlOnlyIncrementalInsert=TRUE
+
+ Code
+ cat(SqlRender::readSql(dqdSqlFilePath))
+ Output
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION_PERIOD table' as check_description
+ ,'OBSERVATION_PERIOD' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_observation_period' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 0 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 0 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,0 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = OBSERVATION_PERIOD
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.OBSERVATION_PERIOD cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_OCCURRENCE table' as check_description
+ ,'VISIT_OCCURRENCE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_visit_occurrence' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = VISIT_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.VISIT_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_OCCURRENCE table' as check_description
+ ,'CONDITION_OCCURRENCE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_condition_occurrence' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = CONDITION_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.CONDITION_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_EXPOSURE table' as check_description
+ ,'DRUG_EXPOSURE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_drug_exposure' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DRUG_EXPOSURE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DRUG_EXPOSURE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the PROCEDURE_OCCURRENCE table' as check_description
+ ,'PROCEDURE_OCCURRENCE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_procedure_occurrence' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = PROCEDURE_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.PROCEDURE_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DEVICE_EXPOSURE table' as check_description
+ ,'DEVICE_EXPOSURE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_device_exposure' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DEVICE_EXPOSURE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DEVICE_EXPOSURE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the MEASUREMENT table' as check_description
+ ,'MEASUREMENT' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_measurement' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = MEASUREMENT
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.MEASUREMENT cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the VISIT_DETAIL table' as check_description
+ ,'VISIT_DETAIL' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_visit_detail' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = VISIT_DETAIL
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.VISIT_DETAIL cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the NOTE table' as check_description
+ ,'NOTE' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_note' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = NOTE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.NOTE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the OBSERVATION table' as check_description
+ ,'OBSERVATION' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_observation' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = OBSERVATION
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.OBSERVATION cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the SPECIMEN table' as check_description
+ ,'SPECIMEN' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_specimen' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = SPECIMEN
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.SPECIMEN cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the PAYER_PLAN_PERIOD table' as check_description
+ ,'PAYER_PLAN_PERIOD' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_payer_plan_period' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = PAYER_PLAN_PERIOD
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.PAYER_PLAN_PERIOD cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DRUG_ERA table' as check_description
+ ,'DRUG_ERA' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_drug_era' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DRUG_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DRUG_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DOSE_ERA table' as check_description
+ ,'DOSE_ERA' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_dose_era' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DOSE_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DOSE_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the CONDITION_ERA table' as check_description
+ ,'CONDITION_ERA' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_condition_era' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 95 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 95 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,95 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = CONDITION_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.CONDITION_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+ /*********
+ SQL to insert individual DQD results directly into output table, rather than waiting until collecting all results.
+ Note that this does not include information about SQL errors or performance
+ **********/
+
+ WITH cte_all AS (
+ /*********
+ SQL to create query for insertion into results table. These may be unioned together prior to insert.
+ Note that this does not include information about SQL errors or performance.
+ **********/
+
+ SELECT
+ cte.num_violated_rows
+ ,cte.pct_violated_rows
+ ,cte.num_denominator_rows
+ ,'' as execution_time
+ ,'' as query_text
+ ,'measurePersonCompleteness' as check_name
+ ,'TABLE' as check_level
+ ,'The number and percent of persons in the CDM that do not have at least one record in the DEATH table' as check_description
+ ,'DEATH' as cdm_table_name
+ ,'NA' as cdm_field_name
+ ,'NA' as concept_id
+ ,'NA' as unit_concept_id
+ ,'table_person_completeness.sql' as sql_file
+ ,'Completeness' as category
+ ,'NA' as subcategory
+ ,'Validation' as context
+ ,'' as warning
+ ,'' as error
+ ,'table_measurepersoncompleteness_death' as checkid
+ ,0 as is_error
+ ,0 as not_applicable
+ ,CASE WHEN (cte.pct_violated_rows * 100) > 100 THEN 1 ELSE 0 END as failed
+ ,CASE WHEN (cte.pct_violated_rows * 100) <= 100 THEN 1 ELSE 0 END as passed
+ ,NULL as not_applicable_reason
+ ,100 as threshold_value
+ ,NULL as notes_value
+ FROM (
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DEATH
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DEATH cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+
+
+ ) cte
+
+ )
+ INSERT INTO @yourResultsSchema.dqdashboard_results
+ SELECT *
+ FROM cte_all
+ ;
+
+
+# Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=1 and sqlOnlyIncrementalInsert=FALSE (the behavior in version <= 2.2.0)
+
+ Code
+ cat(SqlRender::readSql(dqdSqlFilePath))
+ Output
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = OBSERVATION_PERIOD
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.OBSERVATION_PERIOD cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = VISIT_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.VISIT_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = CONDITION_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.CONDITION_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DRUG_EXPOSURE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DRUG_EXPOSURE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = PROCEDURE_OCCURRENCE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.PROCEDURE_OCCURRENCE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DEVICE_EXPOSURE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DEVICE_EXPOSURE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = MEASUREMENT
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.MEASUREMENT cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = VISIT_DETAIL
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.VISIT_DETAIL cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = NOTE
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.NOTE cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = OBSERVATION
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.OBSERVATION cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = SPECIMEN
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.SPECIMEN cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = PAYER_PLAN_PERIOD
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.PAYER_PLAN_PERIOD cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DRUG_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DRUG_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DOSE_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DOSE_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = CONDITION_ERA
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.CONDITION_ERA cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
+ /*********
+ Table Level:
+ MEASURE_PERSON_COMPLETENESS
+ Determine what #/% of persons have at least one record in the cdmTable
+
+ Parameters used in this template:
+ schema = @yourCdmSchema
+ cdmTableName = DEATH
+
+ **********/
+
+
+ SELECT
+ num_violated_rows,
+ CASE
+ WHEN denominator.num_rows = 0 THEN 0
+ ELSE 1.0*num_violated_rows/denominator.num_rows
+ END AS pct_violated_rows,
+ denominator.num_rows AS num_denominator_rows
+ FROM
+ (
+ SELECT
+ COUNT_BIG(violated_rows.person_id) AS num_violated_rows
+ FROM
+ (
+ /*violatedRowsBegin*/
+ SELECT
+ cdmTable.*
+ FROM @yourCdmSchema.person cdmTable
+
+ LEFT JOIN @yourCdmSchema.DEATH cdmTable2
+ ON cdmTable.person_id = cdmTable2.person_id
+ WHERE cdmTable2.person_id IS NULL
+ /*violatedRowsEnd*/
+ ) violated_rows
+ ) violated_row_count,
+ (
+ SELECT
+ COUNT_BIG(*) AS num_rows
+ FROM @yourCdmSchema.person cdmTable
+
+ ) denominator
+ ;
+
+
diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R
index 147aeb64..16ae8c13 100644
--- a/tests/testthat/setup.R
+++ b/tests/testthat/setup.R
@@ -20,46 +20,3 @@ remove_sql_comments <- function(sql) {
sql4 <- gsub("@@@@ .+? @@@@", " ", sql3, ) # remove multi-line comments
sql5 <- gsub("\\s+", " ", sql4) # remove multiple spaces
}
-
-# dbms <- getOption("dbms", default = "sqlite")
-# if (dbms == "sqlite") {
-# connectionDetails <- Eunomia::getEunomiaConnectionDetails()
-# cdmDatabaseSchema <- "main"
-# resultsDatabaseSchema <- "main"
-# cdmVersion <- 5
-# }
-# if (dbms == "postgresql") {
-# DatabaseConnector::downloadJdbcDrivers("postgresql", pathToDriver = jdbcDriverFolder)
-# connectionDetails <- createConnectionDetails(dbms = "postgresql",
-# user = Sys.getenv("CDM5_POSTGRESQL_USER"),
-# password = URLdecode(Sys.getenv("CDM5_POSTGRESQL_PASSWORD")),
-# server = Sys.getenv("CDM5_POSTGRESQL_SERVER"),
-# pathToDriver = jdbcDriverFolder)
-#
-# cdmDatabaseSchema <- Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA")
-# cdmVersion <- 5
-# }
-# if (dbms == "sql server") {
-# DatabaseConnector::downloadJdbcDrivers("sql server", pathToDriver = jdbcDriverFolder)
-# connectionDetails <- createConnectionDetails(dbms = "sql server",
-# user = Sys.getenv("CDM5_SQL_SERVER_USER"),
-# password = URLdecode(Sys.getenv("CDM5_SQL_SERVER_PASSWORD")),
-# server = Sys.getenv("CDM5_SQL_SERVER_SERVER"),
-# pathToDriver = jdbcDriverFolder)
-# cdmDatabaseSchema <- Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA")
-# cdmVersion <- 5
-# }
-# if (dbms == "oracle") {
-# DatabaseConnector::downloadJdbcDrivers("oracle", pathToDriver = jdbcDriverFolder)
-# connectionDetails <- createConnectionDetails(dbms = "oracle",
-# user = Sys.getenv("CDM5_ORACLE_USER"),
-# password = URLdecode(Sys.getenv("CDM5_ORACLE_PASSWORD")),
-# server = Sys.getenv("CDM5_ORACLE_SERVER"),
-# pathToDriver = jdbcDriverFolder)
-# cdmDatabaseSchema <- Sys.getenv("CDM5_ORACLE_CDM_SCHEMA")
-#
-# # Restore temp schema setting after tests complete
-# oldTempSchema <- getOption("sqlRenderTempEmulationSchema")
-# options("sqlRenderTempEmulationSchema" = Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA"))
-# cdmVersion <- 5
-# }
diff --git a/tests/testthat/test-execute.R b/tests/testthat/test-executeDqChecks.R
similarity index 76%
rename from tests/testthat/test-execute.R
rename to tests/testthat/test-executeDqChecks.R
index 646d20cb..e4183cbd 100644
--- a/tests/testthat/test-execute.R
+++ b/tests/testthat/test-executeDqChecks.R
@@ -1,10 +1,5 @@
library(testthat)
-
-test_that("listDqChecks works", {
- checks <- listDqChecks()
- expect_equal(length(checks), 4)
- expect_true(all(sapply(checks, is.data.frame)))
-})
+local_edition(3)
test_that("Execute a single DQ check on Synthea/Eunomia", {
outputFolder <- tempfile("dqd_")
@@ -43,7 +38,6 @@ test_that("Execute all TABLE checks on Synthea/Eunomia", {
expect_true(nrow(results$CheckResults) > 0)
})
-
test_that("Execute FIELD checks on Synthea/Eunomia", {
outputFolder <- tempfile("dqd_")
on.exit(unlink(outputFolder, recursive = TRUE))
@@ -185,44 +179,6 @@ test_that("Check invalid cdm version", {
)
})
-test_that("Write JSON results", {
- outputFolder <- tempfile("dqd_")
- on.exit(unlink(outputFolder, recursive = TRUE))
-
- expect_warning(
- results <- executeDqChecks(
- connectionDetails = connectionDetailsEunomia,
- cdmDatabaseSchema = cdmDatabaseSchemaEunomia,
- resultsDatabaseSchema = resultsDatabaseSchemaEunomia,
- cdmSourceName = "Eunomia",
- checkNames = "measurePersonCompleteness",
- outputFolder = outputFolder,
- writeToTable = FALSE
- ),
- regexp = "^Missing check names.*"
- )
-
- jsonPath <- list.files(outputFolder, ".json", full.names = TRUE)
- csvPath <- file.path(outputFolder, "results.csv")
- writeJsonResultsToCsv(
- jsonPath = jsonPath,
- csvPath = csvPath
- )
- expect_true(file.exists(csvPath))
-
- DataQualityDashboard::writeJsonResultsToTable(
- connectionDetails = connectionDetailsEunomia,
- resultsDatabaseSchema = resultsDatabaseSchemaEunomia,
- jsonFilePath = jsonPath,
- writeTableName = "dqd_results"
- )
- connection <- DatabaseConnector::connect(connectionDetailsEunomia)
- on.exit(DatabaseConnector::disconnect(connection), add = TRUE)
- tableNames <- DatabaseConnector::getTableNames(connection = connection, databaseSchema = resultsDatabaseSchemaEunomia)
- expect_true("dqd_results" %in% tolower(tableNames))
- DatabaseConnector::renderTranslateExecuteSql(connection, "DROP TABLE @database_schema.dqd_results;", database_schema = resultsDatabaseSchemaEunomia)
-})
-
test_that("Execute DQ checks and write to table", {
outputFolder <- tempfile("dqd_")
on.exit(unlink(outputFolder, recursive = TRUE))
@@ -247,33 +203,6 @@ test_that("Execute DQ checks and write to table", {
DatabaseConnector::renderTranslateExecuteSql(connection, "DROP TABLE @database_schema.dqd_results;", database_schema = resultsDatabaseSchemaEunomia)
})
-test_that("Execute reEvaluateThresholds on Synthea/Eunomia", {
- outputFolder <- tempfile("dqd_")
- on.exit(unlink(outputFolder, recursive = TRUE))
-
- expect_warning(
- results <- executeDqChecks(
- connectionDetails = connectionDetailsEunomia,
- cdmDatabaseSchema = cdmDatabaseSchemaEunomia,
- resultsDatabaseSchema = resultsDatabaseSchemaEunomia,
- cdmSourceName = "Eunomia",
- checkNames = "measurePersonCompleteness",
- outputFolder = outputFolder,
- writeToTable = F
- ),
- regexp = "^Missing check names.*"
- )
-
- jsonPath <- list.files(outputFolder, ".json", full.names = TRUE)
-
- results2 <- reEvaluateThresholds(
- jsonFilePath = jsonPath,
- outputFolder = outputFolder,
- outputFile = "reEvaluated.txt"
- )
- expect_is(results2, "list")
-})
-
test_that("Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=4 and sqlOnlyIncrementalInsert=TRUE", {
outputFolder <- tempfile("dqd_")
on.exit(unlink(outputFolder, recursive = TRUE))
@@ -300,14 +229,7 @@ test_that("Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=4 and sqlO
expect_true(dqdSqlFile %in% list.files(outputFolder))
dqdSqlFilePath <- file.path(outputFolder, dqdSqlFile)
- sql <- SqlRender::readSql(dqdSqlFilePath)
-
- # comparison
- expectedSqlFile <- system.file("testdata", "TABLE_measurePersonCompleteness-mssql-union=4-insert.sql", package = "DataQualityDashboard")
- sqlExpected <- SqlRender::readSql(expectedSqlFile)
-
- # test if identical, removing comments and excess whitespace
- expect_equal(remove_sql_comments(sql), remove_sql_comments(sqlExpected))
+ expect_snapshot(cat(SqlRender::readSql(dqdSqlFilePath)))
})
test_that("Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=1 and sqlOnlyIncrementalInsert=TRUE", {
@@ -336,14 +258,7 @@ test_that("Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=1 and sqlO
expect_true(dqdSqlFile %in% list.files(outputFolder))
dqdSqlFilePath <- file.path(outputFolder, dqdSqlFile)
- sql <- SqlRender::readSql(dqdSqlFilePath)
-
- # comparison
- expectedSqlFile <- system.file("testdata", "TABLE_measurePersonCompleteness-mssql-union=1-insert.sql", package = "DataQualityDashboard")
- sqlExpected <- SqlRender::readSql(expectedSqlFile)
-
- # test if identical, removing comments and excess whitespace
- expect_equal(remove_sql_comments(sql), remove_sql_comments(sqlExpected))
+ expect_snapshot(cat(SqlRender::readSql(dqdSqlFilePath)))
})
test_that("Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=1 and sqlOnlyIncrementalInsert=FALSE (the behavior in version <= 2.2.0)", {
@@ -372,14 +287,7 @@ test_that("Execute DQ checks using sqlOnly=TRUE and sqlOnlyUnionCount=1 and sqlO
expect_true(dqdSqlFile %in% list.files(outputFolder))
dqdSqlFilePath <- file.path(outputFolder, dqdSqlFile)
- sql <- SqlRender::readSql(dqdSqlFilePath)
-
- # comparison
- expectedSqlFile <- system.file("testdata", "TABLE_measurePersonCompleteness-mssql-union=1-legacy.sql", package = "DataQualityDashboard")
- sqlExpected <- SqlRender::readSql(expectedSqlFile)
-
- # test if identical, removing comments and excess whitespace
- expect_equal(remove_sql_comments(sql), remove_sql_comments(sqlExpected))
+ expect_snapshot(cat(SqlRender::readSql(dqdSqlFilePath)))
})
test_that("Incremental insert SQL is valid.", {
@@ -414,6 +322,7 @@ test_that("Incremental insert SQL is valid.", {
DatabaseConnector::executeSql(connection = connection, sql = checkSql)
checkResults <- DatabaseConnector::renderTranslateQuerySql(connection, "SELECT * FROM @database_schema.dqd_results;", database_schema = resultsDatabaseSchemaEunomia)
- expect_true(nrow(checkResults) == 15)
+ expect_equal(nrow(checkResults), 16)
+
DatabaseConnector::renderTranslateExecuteSql(connection, "DROP TABLE @database_schema.dqd_results;", database_schema = resultsDatabaseSchemaEunomia)
})
diff --git a/tests/testthat/test-listChecks.R b/tests/testthat/test-listChecks.R
new file mode 100644
index 00000000..8bfe043d
--- /dev/null
+++ b/tests/testthat/test-listChecks.R
@@ -0,0 +1,7 @@
+library(testthat)
+
+test_that("listDqChecks works", {
+ checks <- listDqChecks()
+ expect_equal(length(checks), 4)
+ expect_true(all(sapply(checks, is.data.frame)))
+})
diff --git a/tests/testthat/test-reEvaluateThresholds.R b/tests/testthat/test-reEvaluateThresholds.R
new file mode 100644
index 00000000..eb56bdd5
--- /dev/null
+++ b/tests/testthat/test-reEvaluateThresholds.R
@@ -0,0 +1,29 @@
+library(testthat)
+
+test_that("Execute reEvaluateThresholds on Synthea/Eunomia", {
+ outputFolder <- tempfile("dqd_")
+ on.exit(unlink(outputFolder, recursive = TRUE))
+
+ expect_warning(
+ results <- executeDqChecks(
+ connectionDetails = connectionDetailsEunomia,
+ cdmDatabaseSchema = cdmDatabaseSchemaEunomia,
+ resultsDatabaseSchema = resultsDatabaseSchemaEunomia,
+ cdmSourceName = "Eunomia",
+ checkNames = "measurePersonCompleteness",
+ outputFolder = outputFolder,
+ writeToTable = F
+ ),
+ regexp = "^Missing check names.*"
+ )
+
+ jsonPath <- list.files(outputFolder, ".json", full.names = TRUE)
+
+ results2 <- reEvaluateThresholds(
+ jsonFilePath = jsonPath,
+ outputFolder = outputFolder,
+ outputFile = "reEvaluated.txt"
+ )
+
+ expect_type(results2, "list")
+})
diff --git a/tests/testthat/test-writeJsonResultsTo.R b/tests/testthat/test-writeJsonResultsTo.R
new file mode 100644
index 00000000..7aff258f
--- /dev/null
+++ b/tests/testthat/test-writeJsonResultsTo.R
@@ -0,0 +1,39 @@
+library(testthat)
+
+test_that("Write JSON results", {
+ outputFolder <- tempfile("dqd_")
+ on.exit(unlink(outputFolder, recursive = TRUE))
+
+ expect_warning(
+ results <- executeDqChecks(
+ connectionDetails = connectionDetailsEunomia,
+ cdmDatabaseSchema = cdmDatabaseSchemaEunomia,
+ resultsDatabaseSchema = resultsDatabaseSchemaEunomia,
+ cdmSourceName = "Eunomia",
+ checkNames = "measurePersonCompleteness",
+ outputFolder = outputFolder,
+ writeToTable = FALSE
+ ),
+ regexp = "^Missing check names.*"
+ )
+
+ jsonPath <- list.files(outputFolder, ".json", full.names = TRUE)
+ csvPath <- file.path(outputFolder, "results.csv")
+ writeJsonResultsToCsv(
+ jsonPath = jsonPath,
+ csvPath = csvPath
+ )
+ expect_true(file.exists(csvPath))
+
+ DataQualityDashboard::writeJsonResultsToTable(
+ connectionDetails = connectionDetailsEunomia,
+ resultsDatabaseSchema = resultsDatabaseSchemaEunomia,
+ jsonFilePath = jsonPath,
+ writeTableName = "dqd_results"
+ )
+ connection <- DatabaseConnector::connect(connectionDetailsEunomia)
+ on.exit(DatabaseConnector::disconnect(connection), add = TRUE)
+ tableNames <- DatabaseConnector::getTableNames(connection = connection, databaseSchema = resultsDatabaseSchemaEunomia)
+ expect_true("dqd_results" %in% tolower(tableNames))
+ DatabaseConnector::renderTranslateExecuteSql(connection, "DROP TABLE @database_schema.dqd_results;", database_schema = resultsDatabaseSchemaEunomia)
+})
diff --git a/vignettes/SqlOnly.rmd b/vignettes/SqlOnly.rmd
index 3363632d..9fabcce0 100644
--- a/vignettes/SqlOnly.rmd
+++ b/vignettes/SqlOnly.rmd
@@ -24,7 +24,7 @@ output:
# Description
-This article describes how to use DQD to generate only the SQL that executes all DataQualityDashoard checks, without actually executing them.
+This article describes how to use DQD to generate only the SQL that executes all DataQualityDashboard checks, without actually executing them.
There are a few main advantages of running DQD in Sql-only mode:
* Create queries locally, before sending to server. This allows for generation of the SQL on one machine and execution on another (e.g. when R cannot connect directly to the database server, or you want to run the DQD SQL as part of your ETL).