Skip to content

Commit

Permalink
minor clean-ups in R and SQL code (#135)
Browse files Browse the repository at this point in the history
* extras folder creation

* update to rule overview file

* some changes hinted in #133

* #133 documentation improvement and cleanup of sql code
  • Loading branch information
vojtechhuser authored and chrisknoll committed Jul 26, 2016
1 parent 2493d4b commit aa431e1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 94 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
^.travis.yml$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type: Package
Title: Creates descriptive statistics summary for an entire OMOP CDM instance.
Version: 1.3
Date: 2016-06-10
Author: Patrick Ryan, Martijn Schuemie
Author: Patrick Ryan, Martijn Schuemie, Vojtech Huser, Chris Knoll
Maintainer: Patrick Ryan <[email protected]>
LazyData: true
Description: creates descriptive statistics summary for an entire OMOP CDM
Expand Down
21 changes: 21 additions & 0 deletions R/Achilles.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,27 @@ achilles <- function (connectionDetails,
result
}

#' execution of data quality rules
#'
#' @description
#' \code{achillesHeel} executes data quality rules (or checks) on pre-computed analyses (or measures).
#'
#' @details
#' \code{achillesHeel} contains number of rules (authored in SQL) that are executed againts achilles results tables.
#'
#' @param connectionDetails An R object of type ConnectionDetail (details for the function that contains server info, database type, optionally username/password, port)
#' @param cdmDatabaseSchema string name of database schema that contains OMOP CDM. On SQL Server, this should specifiy both the database and the schema, so for example 'cdm_instance.dbo'.
#' @param oracleTempSchema For Oracle only: the name of the database schema where you want all temporary tables to be managed. Requires create/insert permissions to this database.
#' @param resultsDatabaseSchema string name of database schema that we can write results to. Default is cdmDatabaseSchema. On SQL Server, this should specifiy both the database and the schema, so for example 'results.dbo'.
#' @param sourceName string name of the database, as recorded in results
#' @param cdmVersion Define the OMOP CDM version used: currently support "4" and "5". Default = "4"
#' @param vocabDatabaseSchema string name of database schema that contains OMOP Vocabulary. Default is cdmDatabaseSchema. On SQL Server, this should specifiy both the database and the schema, so for example 'results.dbo'.
#'
#' @return nothing is returned
#' @examples \dontrun{
#' connectionDetails <- createConnectionDetails(dbms="sql server", server="RNDUSRDHIT07.jnj.com")
#' achillesHeel <- achilles(connectionDetails, cdmDatabaseSchema="mycdm", resultsDatabaseSchema="scratch", vocabDatabaseSchema="vocabulary")
#' }
#' @export
achillesHeel <- function (connectionDetails,
cdmDatabaseSchema,
Expand Down
File renamed without changes.
7 changes: 5 additions & 2 deletions inst/csv/achilles_rule.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ rule_id,rule_name,severity,rule_description
26,implausible quantity for drug,warning,quantity > 600
27,more than 1 percent of unmapped rows (concept_0 rows),warning,for multiple analyses (4xx;6xx;7xx;8xx;18xx)
28,percentage of deceased patients,warning,fires if (deceased/all person count * 100) is less than 1 (anusual if dataset represents a general healthcare data warehouse)
29,infant diagnosis at senior age,error,mecconium condition
31,ratio of providers to total patients,notification,ratio
29,infant diagnosis at senior age of over 50yo,error,mecconium condition 195075; This rule is example of a terminology depended data quality tool
31,ratio of providers to total patients,notification,ratio
32,NOTIFICATION: Percentage of patients with no visits exceeds threshold,notification, checks if there are too many patients with no visits
33,NOTIFICATION: [GeneralPopulationOnly] Not all deciles represented at first observation,notification, the rule only applies to general population datasets
34,NOTIFICATION: Count of unmapped source values in a domain exceeds threshold,notification,looks at values that are mapped to concept0 and their source values by table
91 changes: 0 additions & 91 deletions inst/sql/sql_server/AchillesReport_v5.sql

This file was deleted.

0 comments on commit aa431e1

Please sign in to comment.