Skip to content

Commit 21d33a6

Browse files
committed
create templates for check docs
1 parent ead3cfb commit 21d33a6

30 files changed

+881
-22
lines changed

_pkgdown.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ navbar:
5353
- text: Index
5454
href: articles/checkIndex.html
5555
- text: cdmTable
56-
href: articles/cdmTable.html
56+
href: articles/checks/cdmTable.html
5757
- text: cdmField
58-
href: articles/cdmField.html
58+
href: articles/checks/cdmField.html
5959
- text: cdmDatatype
60-
href: articles/cdmDatatype.html
60+
href: articles/checks/cdmDatatype.html
6161
- text: isPrimaryKey
62-
href: articles/isPrimaryKey.html
62+
href: articles/checks/isPrimaryKey.html
6363
- text: isForeignKey
64-
href: articles/isForeignKey.html
64+
href: articles/checks/isForeignKey.html
6565
- text: isRequired
66-
href: articles/isRequired.html
66+
href: articles/checks/isRequired.html
6767
- text: fkDomain
68-
href: articles/fkDomain.html
68+
href: articles/checks/fkDomain.html
6969
- text: fkClass
7070
href: articles/fkClass.html
7171
- text: plausibleAfterBirth
72-
href: articles/plausibleAfterBirth.html
72+
href: articles/checks/plausibleAfterBirth.html
7373
hades:
7474
text: hadesLogo
7575
href: https://ohdsi.github.io/Hades

extras/checkDescriptionTemplate.Rmd

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "%s"
3+
author: "<authors>"
4+
date: "`r Sys.Date()`"
5+
output:
6+
html_document:
7+
number_sections: yes
8+
toc: yes
9+
---
10+
11+
## Summary
12+
13+
**Level**: %s\
14+
**Context**: %s\
15+
**Category**: %s\
16+
**Subcategory**: %s\
17+
**Severity**: %s
18+
19+
20+
## Description
21+
%s
22+
23+
24+
## Definition
25+
26+
- *Numerator*:
27+
- *Denominator*:
28+
- *Related CDM Convention(s)*:
29+
- *CDM Fields/Tables*:
30+
- *Default Threshold Value*:
31+
32+
33+
## User Guidance
34+
35+
36+
### Violated rows query
37+
```sql
38+
SELECT *
39+
FROM @cdmTable
40+
WHERE violated IS TRUE
41+
```
42+
43+
44+
### ETL Developers
45+
46+
47+
### Data Users
48+

extras/createCheckDoc.R

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Read check descriptions into a dataframe
2+
checkDescriptions <- read.csv("inst/csv/OMOP_CDMv5.4_Check_Descriptions.csv")
3+
4+
# Template
5+
templateText <- paste(readLines('extras/checkDescriptionTemplate.Rmd', encoding = 'UTF-8'), collapse = "\n")
6+
7+
checkText <- sprintf(
8+
templateText,
9+
checkDescriptions$checkName,
10+
checkDescriptions$checkLevel,
11+
checkDescriptions$kahnContext,
12+
checkDescriptions$kahnCategory,
13+
checkDescriptions$kahnSubcategory,
14+
checkDescriptions$severity,
15+
checkDescriptions$checkDescription
16+
)
17+
18+
# Write each element of checkText to a file
19+
for (i in seq_along(checkText)) {
20+
checkName <- checkDescriptions$checkName[i]
21+
writeLines(
22+
checkText[i],
23+
file.path('extras/checks', paste0(checkName, ".Rmd"))
24+
)
25+
cat(sprintf("- [%s](%s.html)\n", checkName, checkName))
26+
}
27+
for (checkName in checkDescriptions$checkName) {
28+
cat(sprintf(" - text: %s\n", checkName))
29+
cat(sprintf(" href: articles/checks/%s.html\n", checkName))
30+
}

vignettes/checkIndex.Rmd

+12-14
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,28 @@ output:
88
toc: yes
99
---
1010

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

17-
*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.*
15+
*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.*
1816

19-
**General guidance**:
17+
## General guidance
2018

2119
- 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
2220
- 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
23-
- 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
21+
- 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
2422

25-
**Checks**:
23+
## Checks
2624

27-
- [cdmTable](cdmTable.html)
28-
- [cdmField](cdmField.html)
29-
- [cdmDatatype](cdmDatatype.html)
30-
- [isPrimaryKey](isPrimaryKey.html)
31-
- [isForeignKey](isForeignKey.html)
32-
- [isRequired](isRequired.html)
33-
- [fkDomain](fkDomain.html)
34-
- [fkClass](fkClass.html)
25+
- [cdmTable](checks/cdmTable.html)
26+
- [cdmField](checks/cdmField.html)
27+
- [cdmDatatype](checks/cdmDatatype.html)
28+
- [isPrimaryKey](checks/isPrimaryKey.html)
29+
- [isForeignKey](checks/isForeignKey.html)
30+
- [isRequired](checks/isRequired.html)
31+
- [fkDomain](checks/fkDomain.html)
32+
- [fkClass](checks/fkClass.html)
3533
- measurePersonCompleteness (PAGE UNDER CONSTRUCTION)
3634
- measureConditionEraCompleteness (PAGE UNDER CONSTRUCTION)
3735
- isStandardValidConcept (PAGE UNDER CONSTRUCTION)
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "isStandardValidConcept"
3+
author: ""
4+
date: "`r Sys.Date()`"
5+
output:
6+
html_document:
7+
number_sections: yes
8+
toc: yes
9+
---
10+
11+
## Summary
12+
13+
**Level**: FIELD\
14+
**Context**: Verification\
15+
**Category**: Conformance\
16+
**Subcategory**: Value\
17+
**Severity**:
18+
19+
20+
## Description
21+
The number and percent of records that do not have a standard, valid concept in the @cdmFieldName field in the @cdmTableName table.
22+
23+
24+
## Definition
25+
26+
- *Numerator*:
27+
- *Denominator*:
28+
- *Related CDM Convention(s)*:
29+
- *CDM Fields/Tables*:
30+
- *Default Threshold Value*:
31+
32+
33+
## User Guidance
34+
35+
36+
### Violated rows query
37+
```sql
38+
39+
```
40+
41+
42+
### ETL Developers
43+
44+
45+
### Data Users
46+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "measureConditionEraCompleteness"
3+
author: ""
4+
date: "`r Sys.Date()`"
5+
output:
6+
html_document:
7+
number_sections: yes
8+
toc: yes
9+
---
10+
11+
## Summary
12+
13+
**Level**: TABLE\
14+
**Context**: Validation\
15+
**Category**: Completeness\
16+
**Subcategory**: \
17+
**Severity**:
18+
19+
20+
## Description
21+
The number and Percent of persons that does not have condition_era built successfully,
22+
for all persons in condition_occurrence
23+
24+
25+
## Definition
26+
27+
- *Numerator*:
28+
- *Denominator*:
29+
- *Related CDM Convention(s)*:
30+
- *CDM Fields/Tables*:
31+
- *Default Threshold Value*:
32+
33+
34+
## User Guidance
35+
36+
37+
### Violated rows query
38+
```sql
39+
40+
```
41+
42+
43+
### ETL Developers
44+
45+
46+
### Data Users
47+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "measurePersonCompleteness"
3+
author: ""
4+
date: "`r Sys.Date()`"
5+
output:
6+
html_document:
7+
number_sections: yes
8+
toc: yes
9+
---
10+
11+
## Summary
12+
13+
**Level**: TABLE\
14+
**Context**: Validation\
15+
**Category**: Completeness\
16+
**Subcategory**: \
17+
**Severity**:
18+
19+
20+
## Description
21+
The number and percent of persons in the CDM that do not have at least one record in the @cdmTableName table
22+
23+
24+
## Definition
25+
26+
- *Numerator*:
27+
- *Denominator*:
28+
- *Related CDM Convention(s)*:
29+
- *CDM Fields/Tables*:
30+
- *Default Threshold Value*:
31+
32+
33+
## User Guidance
34+
35+
36+
### Violated rows query
37+
```sql
38+
39+
```
40+
41+
42+
### ETL Developers
43+
44+
45+
### Data Users
46+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "measureValueCompleteness"
3+
author: ""
4+
date: "`r Sys.Date()`"
5+
output:
6+
html_document:
7+
number_sections: yes
8+
toc: yes
9+
---
10+
11+
## Summary
12+
13+
**Level**: FIELD\
14+
**Context**: Verification\
15+
**Category**: Completeness\
16+
**Subcategory**: \
17+
**Severity**:
18+
19+
20+
## Description
21+
The number and percent of records with a NULL value in the @cdmFieldName of the @cdmTableName.
22+
23+
24+
## Definition
25+
26+
- *Numerator*:
27+
- *Denominator*:
28+
- *Related CDM Convention(s)*:
29+
- *CDM Fields/Tables*:
30+
- *Default Threshold Value*:
31+
32+
33+
## User Guidance
34+
35+
36+
### Violated rows query
37+
```sql
38+
39+
```
40+
41+
42+
### ETL Developers
43+
44+
45+
### Data Users
46+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "plausibleAfterBirth"
3+
author: ""
4+
date: "`r Sys.Date()`"
5+
output:
6+
html_document:
7+
number_sections: yes
8+
toc: yes
9+
---
10+
11+
## Summary
12+
13+
**Level**: FIELD\
14+
**Context**: Verification\
15+
**Category**: Plausibility\
16+
**Subcategory**: Temporal\
17+
**Severity**:
18+
19+
20+
## Description
21+
The number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs prior to birth.
22+
23+
24+
## Definition
25+
26+
- *Numerator*:
27+
- *Denominator*:
28+
- *Related CDM Convention(s)*:
29+
- *CDM Fields/Tables*:
30+
- *Default Threshold Value*:
31+
32+
33+
## User Guidance
34+
35+
36+
### Violated rows query
37+
```sql
38+
39+
```
40+
41+
42+
### ETL Developers
43+
44+
45+
### Data Users
46+
File renamed without changes.

0 commit comments

Comments
 (0)