Skip to content

Commit

Permalink
Dev (#38)
Browse files Browse the repository at this point in the history
* Fix three bugs in feasibility assessment workflow (#34)

* Hotfix conn variable

* Fix the issue with site_path and paste()

* Add missing schema variable to table name

* Characterization Analysis Tutorial (#37)

* Simplified phenotype definition generation

* DVC controlled initial phenotype definition information

* Initial draft of the characterization scheme

* Cleaned up repository of misc files

* Added todo for README for the future

* Added additional todos for characterization work

* Completed to-dos for database connections and queries

* Added todos and did initial review

* Completed todos and added set-up and testing documents

* Tweaking tutorial to better accommodate Julia packages

* Removed Julia installation instructions

* Added OHDSI HADES packages

* Placeholder for baseline directory

* Get patients who match a condition set

* Query patients to get their age, race, and gender

* Overhaul of characterization script to only require HADES and SQL

* Updated baseline characterization scheme

* Updated instructions to the README

---------

Co-authored-by: TheCedarPrince <[email protected]>

* Updated for release of v0.1.0 of package

* Updated for release of v0.1.0 of package

---------

Co-authored-by: Kyle Zollo <[email protected]>
Co-authored-by: malinahy <[email protected]>
  • Loading branch information
3 people authored Feb 28, 2023
1 parent 8a231a0 commit 1202414
Show file tree
Hide file tree
Showing 24 changed files with 2,015 additions and 1,146 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.0.2] - January 23rd, 2022
## [0.1.0] - February 28th, 2023

New minor release for package to execute baseline characterizations

### Added

- Characterization script added
- Instructions for characterization script
- Queries to run for characterization
- `renv` environment management
- `Rprofile` for RStudio work

### Changed

- Directory for data now includes a `baseline` folder
- `study` now includes in progress `test` scripts

### Fixed

- Numerous issues opened by @kzollove (thank you!)

## [0.0.2] - January 23rd, 2023

Patch release of MentalHealthEquity package for small updates and compliance

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MentalHealthEquity
Title: Assessing Health Equity in Mental Healthcare Delivery Using a
Federated Network Research Model
Version: 0.0.2
Version: 0.1.0
Authors@R:
person("Jacob", "Zelko", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4531-1614"))
Expand Down
32 changes: 0 additions & 32 deletions _scripts/conceptDefinitions.R

This file was deleted.

2 changes: 1 addition & 1 deletion _scripts/description_updater.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ usethis.description <- list(
Language = "en",
Package = "MentalHealthEquity",
Title = "Assessing Health Equity in Mental Healthcare Delivery Using a Federated Network Research Model",
Version = "0.0.2",
Version = "0.1.0",
Description = "This is a network research package which assesses health disparities in populations with chronic mental illness. There are two components in this package: a feasibility component (to assess site feasibility) and a study component (to generate statistics of interest at each site)."
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,29 @@ get_atlas_concept_set <- function(filename) {
concept_set_df <- do.call(rbind, cohort_list)
return(concept_set_df)
}

# Getting concept sets for condition using concept ID and writing to json file
bipolar_id <- 436665
depression_id <- 440383
suicidality_id <- 4273391

ids <- c(bipolar_id, depression_id, suicidality_id)
names <- c("bipolar", "depression", "suicidality")

base_filename <- "data/concept_sets/"

# Output condition concept set JSON file paths
condition_paths <- paste0(base_filename, names, "_computable_phenotype_definition.csv")

# Write condition concept set JSON representation to files
condition_json <- lapply(ids, FUN = get_atlas_concept)
mapply(FUN = write, condition_json, condition_paths)

# Output condition concept set CSV file paths
concept_paths <- paste0(base_filename, names, "_concept_set.csv")
concept_sets <- lapply(condition_paths, FUN = get_atlas_concept_set)

# Write concepts from concept set to CSV
for (i in 1:length(concept_paths)) {
write.csv(concept_sets[[i]], concept_paths[[i]])
}
Empty file added data/baseline/placeholder
Empty file.
4 changes: 2 additions & 2 deletions feasibility/feasibility_assessment_instructions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ And here is the code block needed to update:
```{r, eval = FALSE}
site_name <- "Fill in here"
site_path <- paste("../data/", site_name, sep = ""), row.names = FALSE
dir.create(path = site_name)
site_path <- paste("../data/", site_name, sep = "")
dir.create(path = site_path)
```
#### Stratified Person Query
Expand Down
2 changes: 1 addition & 1 deletion feasibility/sql/state_person.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM (
"LOCATION_1"."state"
FROM @schema.location AS "LOCATION_1"
) AS "LOCATION_2"
JOIN person AS "PERSON_1" ON ("LOCATION_2"."location_id" = "PERSON_1"."location_id")
JOIN @schema.person AS "PERSON_1" ON ("LOCATION_2"."location_id" = "PERSON_1"."location_id")
GROUP BY "LOCATION_2".state;', schema = schema)
location_sql <- translate(sql = location_sql, targetDialect = dbms)

Expand Down
2 changes: 1 addition & 1 deletion feasibility/tests/test_environment.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test_that("Running query", {
# Testing feasibility assessment queries
##############################################################

connection <- DatabaseConnector::connect(eunomia_details)
conn <- DatabaseConnector::connect(eunomia_details)

schema <- "main"
dbms <- "sqlite"
Expand Down
23 changes: 23 additions & 0 deletions phenotypes/bipolar_computable_phenotype_definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"items": [
{
"concept": {
"CONCEPT_ID": 436665,
"CONCEPT_NAME": "Bipolar disorder",
"STANDARD_CONCEPT": "S",
"STANDARD_CONCEPT_CAPTION": "Standard",
"INVALID_REASON": "V",
"INVALID_REASON_CAPTION": "Valid",
"CONCEPT_CODE": "13746004",
"DOMAIN_ID": "Condition",
"VOCABULARY_ID": "SNOMED",
"CONCEPT_CLASS_ID": "Clinical Finding",
"VALID_START_DATE": 1012435200000,
"VALID_END_DATE": 4102358400000
},
"isExcluded": false,
"includeDescendants": true,
"includeMapped": true
}
]
}
Loading

0 comments on commit 1202414

Please sign in to comment.