Skip to content

Commit

Permalink
create templates for check docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximMoinat committed Jan 26, 2024
1 parent ead3cfb commit 21d33a6
Show file tree
Hide file tree
Showing 30 changed files with 881 additions and 22 deletions.
16 changes: 8 additions & 8 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@ navbar:
- text: Index
href: articles/checkIndex.html
- text: cdmTable
href: articles/cdmTable.html
href: articles/checks/cdmTable.html
- text: cdmField
href: articles/cdmField.html
href: articles/checks/cdmField.html
- text: cdmDatatype
href: articles/cdmDatatype.html
href: articles/checks/cdmDatatype.html
- text: isPrimaryKey
href: articles/isPrimaryKey.html
href: articles/checks/isPrimaryKey.html
- text: isForeignKey
href: articles/isForeignKey.html
href: articles/checks/isForeignKey.html
- text: isRequired
href: articles/isRequired.html
href: articles/checks/isRequired.html
- text: fkDomain
href: articles/fkDomain.html
href: articles/checks/fkDomain.html
- text: fkClass
href: articles/fkClass.html
- text: plausibleAfterBirth
href: articles/plausibleAfterBirth.html
href: articles/checks/plausibleAfterBirth.html
hades:
text: hadesLogo
href: https://ohdsi.github.io/Hades
Expand Down
48 changes: 48 additions & 0 deletions extras/checkDescriptionTemplate.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "%s"
author: "<authors>"
date: "`r Sys.Date()`"
output:
html_document:
number_sections: yes
toc: yes
---

## Summary

**Level**: %s\
**Context**: %s\
**Category**: %s\
**Subcategory**: %s\
**Severity**: %s


## Description
%s


## Definition

- *Numerator*:
- *Denominator*:
- *Related CDM Convention(s)*:
- *CDM Fields/Tables*:
- *Default Threshold Value*:


## User Guidance


### Violated rows query
```sql
SELECT *
FROM @cdmTable
WHERE violated IS TRUE
```


### ETL Developers


### Data Users

30 changes: 30 additions & 0 deletions extras/createCheckDoc.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Read check descriptions into a dataframe
checkDescriptions <- read.csv("inst/csv/OMOP_CDMv5.4_Check_Descriptions.csv")

# Template
templateText <- paste(readLines('extras/checkDescriptionTemplate.Rmd', encoding = 'UTF-8'), collapse = "\n")

checkText <- sprintf(
templateText,
checkDescriptions$checkName,
checkDescriptions$checkLevel,
checkDescriptions$kahnContext,
checkDescriptions$kahnCategory,
checkDescriptions$kahnSubcategory,
checkDescriptions$severity,
checkDescriptions$checkDescription
)

# Write each element of checkText to a file
for (i in seq_along(checkText)) {
checkName <- checkDescriptions$checkName[i]
writeLines(
checkText[i],
file.path('extras/checks', paste0(checkName, ".Rmd"))
)
cat(sprintf("- [%s](%s.html)\n", checkName, checkName))
}
for (checkName in checkDescriptions$checkName) {
cat(sprintf(" - text: %s\n", checkName))
cat(sprintf(" href: articles/checks/%s.html\n", checkName))
}
26 changes: 12 additions & 14 deletions vignettes/checkIndex.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,28 @@ output:
toc: yes
---

## Index

This section contains detailed descriptions of the data quality checks included in the DataQualityDashboard package.
Each check is described on its own page; click on the check name in the list below or in the dropdown menu
above to navigate to the check's documentation page.\

*N.B. This section is currently under development. A documentation page is not yet available for all checks. The links below will be updated as more pages are added. In the meantime, see the [Check Type Descriptions](https://ohdsi.github.io/DataQualityDashboard/articles/CheckTypeDescriptions) page for a brief description of each check.*
*N.B. This section is currently under development. A documentation page is not yet available for all checks. The links below will be updated as more pages are added. In the meantime, see the [Check Type Descriptions](checks/https://ohdsi.github.io/DataQualityDashboard/articles/CheckTypeDescriptions) page for a brief description of each check.*

**General guidance**:
## General guidance

- These documentation pages are intended to provide a detailed description of each check and guidance for users on how to interpret the results of each check
- Guidance is provided for both *ETL developers* and *OMOP CDM users* (e.g. analysts, data managers, etc). CDM users are strongly encouraged to work with their ETL development team, if possible, to understand and address any check failures attributable to ETL design. However, guidance is also provided in case this is not possible
- In some cases, SQL snippets are provided to help investigate the cause of a check failure. These snippets are written in OHDSI SQL and can be rendered to run against your OMOP CDM using the [SQLRender](https://ohdsi.github.io/SqlRender/) package. As always, it is also recommended to utilize the "violated rows" SQL (indicated by the comment lines `/*violatedRowsBegin*/` and `/*violatedRowsEnd*/`) from the SQL query displayed in the DQD results viewer for a given check to inspect rows that failed the check
- In some cases, SQL snippets are provided to help investigate the cause of a check failure. These snippets are written in OHDSI SQL and can be rendered to run against your OMOP CDM using the [SQLRender](checks/https://ohdsi.github.io/SqlRender/) package. As always, it is also recommended to utilize the "violated rows" SQL (indicated by the comment lines `/*violatedRowsBegin*/` and `/*violatedRowsEnd*/`) from the SQL query displayed in the DQD results viewer for a given check to inspect rows that failed the check

**Checks**:
## Checks

- [cdmTable](cdmTable.html)
- [cdmField](cdmField.html)
- [cdmDatatype](cdmDatatype.html)
- [isPrimaryKey](isPrimaryKey.html)
- [isForeignKey](isForeignKey.html)
- [isRequired](isRequired.html)
- [fkDomain](fkDomain.html)
- [fkClass](fkClass.html)
- [cdmTable](checks/cdmTable.html)
- [cdmField](checks/cdmField.html)
- [cdmDatatype](checks/cdmDatatype.html)
- [isPrimaryKey](checks/isPrimaryKey.html)
- [isForeignKey](checks/isForeignKey.html)
- [isRequired](checks/isRequired.html)
- [fkDomain](checks/fkDomain.html)
- [fkClass](checks/fkClass.html)
- measurePersonCompleteness (PAGE UNDER CONSTRUCTION)
- measureConditionEraCompleteness (PAGE UNDER CONSTRUCTION)
- isStandardValidConcept (PAGE UNDER CONSTRUCTION)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 46 additions & 0 deletions vignettes/checks/isStandardValidConcept.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "isStandardValidConcept"
author: ""
date: "`r Sys.Date()`"
output:
html_document:
number_sections: yes
toc: yes
---

## Summary

**Level**: FIELD\
**Context**: Verification\
**Category**: Conformance\
**Subcategory**: Value\
**Severity**:


## Description
The number and percent of records that do not have a standard, valid concept in the @cdmFieldName field in the @cdmTableName table.


## Definition

- *Numerator*:
- *Denominator*:
- *Related CDM Convention(s)*:
- *CDM Fields/Tables*:
- *Default Threshold Value*:


## User Guidance


### Violated rows query
```sql

```


### ETL Developers


### Data Users

47 changes: 47 additions & 0 deletions vignettes/checks/measureConditionEraCompleteness.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: "measureConditionEraCompleteness"
author: ""
date: "`r Sys.Date()`"
output:
html_document:
number_sections: yes
toc: yes
---

## Summary

**Level**: TABLE\
**Context**: Validation\
**Category**: Completeness\
**Subcategory**: \
**Severity**:


## Description
The number and Percent of persons that does not have condition_era built successfully,
for all persons in condition_occurrence


## Definition

- *Numerator*:
- *Denominator*:
- *Related CDM Convention(s)*:
- *CDM Fields/Tables*:
- *Default Threshold Value*:


## User Guidance


### Violated rows query
```sql

```


### ETL Developers


### Data Users

46 changes: 46 additions & 0 deletions vignettes/checks/measurePersonCompleteness.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "measurePersonCompleteness"
author: ""
date: "`r Sys.Date()`"
output:
html_document:
number_sections: yes
toc: yes
---

## Summary

**Level**: TABLE\
**Context**: Validation\
**Category**: Completeness\
**Subcategory**: \
**Severity**:


## Description
The number and percent of persons in the CDM that do not have at least one record in the @cdmTableName table


## Definition

- *Numerator*:
- *Denominator*:
- *Related CDM Convention(s)*:
- *CDM Fields/Tables*:
- *Default Threshold Value*:


## User Guidance


### Violated rows query
```sql

```


### ETL Developers


### Data Users

46 changes: 46 additions & 0 deletions vignettes/checks/measureValueCompleteness.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "measureValueCompleteness"
author: ""
date: "`r Sys.Date()`"
output:
html_document:
number_sections: yes
toc: yes
---

## Summary

**Level**: FIELD\
**Context**: Verification\
**Category**: Completeness\
**Subcategory**: \
**Severity**:


## Description
The number and percent of records with a NULL value in the @cdmFieldName of the @cdmTableName.


## Definition

- *Numerator*:
- *Denominator*:
- *Related CDM Convention(s)*:
- *CDM Fields/Tables*:
- *Default Threshold Value*:


## User Guidance


### Violated rows query
```sql

```


### ETL Developers


### Data Users

46 changes: 46 additions & 0 deletions vignettes/checks/plausibleAfterBirth copy.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "plausibleAfterBirth"
author: ""
date: "`r Sys.Date()`"
output:
html_document:
number_sections: yes
toc: yes
---

## Summary

**Level**: FIELD\
**Context**: Verification\
**Category**: Plausibility\
**Subcategory**: Temporal\
**Severity**:


## Description
The number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs prior to birth.


## Definition

- *Numerator*:
- *Denominator*:
- *Related CDM Convention(s)*:
- *CDM Fields/Tables*:
- *Default Threshold Value*:


## User Guidance


### Violated rows query
```sql

```


### ETL Developers


### Data Users

File renamed without changes.
Loading

0 comments on commit 21d33a6

Please sign in to comment.