Skip to content

Commit

Permalink
Merge Dev Branch into Main To Trigger Rebuild of Docs (#45)
Browse files Browse the repository at this point in the history
* bug report added

* feature request added

* Made the bug report template a bit more explicit

* Added guide for how to explain the feature you want to see

* Fixing dependencies

* Fixing dependencies issue

* Added Eunomia Dataset

* dataset testing

* added makeTable

* tests added

* Update OMOPCDMPathways.jl

* Update preprocessing.jl

* Fixed project dependencies around package

* Removed compat entry for Vitepress

* Initial  Docs Setup (#25)

* initial docs

* work in progress .

* Update make.jl

* Delete docs/src/using_omopcdmcohortcreator_with_r.md

* resources providing instructions for forking a repo added

* Starting a thorough review

* bug report and feature request templates added

* Added some more notes about why pathways

* Small edits to the contributing guide

* Added WIP note for tutorials

---------

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

* Trying to get branch deployment to run again for dev

* Update Project.toml

* Update make.jl (#41)

* Update Project.toml (#42)

* Update Project.toml

* Update make.jl

* Update make.jl again

* docs-test

* Update make.jl

* run CI on the dev branch:

* dev

* Update make.jl (these line are not necessary to add)

* Update documentation.yml

* png and ico added

---------

Co-authored-by: Jay-sanjay <[email protected]>
  • Loading branch information
TheCedarPrince and Jay-sanjay authored Jun 11, 2024
1 parent d8ba0a4 commit 64d2d04
Show file tree
Hide file tree
Showing 15 changed files with 342 additions and 34 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug Report
about: Create an error or bug report to help us improve
title: '[BUG]: Title of the Error You Encountered'
labels: bug
assignees: ''

---

**Before Filing a Report**

- Did I look through the [documentation](https://juliahealth.org/OMOPCDMPathways.jl/)?

- Did I search the [OMOPCDMPathways.jl GitHub Issues](https://github.com/JuliaHealth/OMOPCDMPathways.jl/issues?q=is%3Aissue+sort%3Aupdated-desc+) to see if this bug has already been reported?

- Do I have the latest version of [OMOPCDMPathways.jl](https://github.com/JuliaHealth/OMOPCDMPathways.jl/releases) installed?

**Describe the Bug or Error**

A clear and concise description of what the bug is.

**How To Reproduce the Bug or Error**

1. Julia Version (i.e. output of `julia -v`):

2. Operating system (Mac, Linux, Windows):

3. OMOPCDMPathways.jl version (i.e output of `] status OMOPCDMPathways` in the Julia REPL)

4. Minimum working code example that led to bug:

**Expected Behavior and Actual Behavior**

A clear and concise description of what you expected to happen followed up with an explanation of what actually happened.

**Additional context**
Add any other context about the problem here.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature Request
about: Suggest a new feature for this package
title: '[FEATURE REQUEST]: Title for Your Request'
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please explain.**

A clear and concise description of what the problem is. (Examples: "I'm always frustrated when [...]", "I did not expect this function to do [...]")

**Describe the solution you'd like**

- A clear and concise description of what you would like to do
- How you imagine the package could support this
- An example of how you see using this feature

**Describe alternatives you've considered**

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context (blogs, papers, videos) or screenshots about the feature request here.
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ authors = ["Jay-sanjay <[email protected]> and contributors"]
version = "0.0.1"

[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FunSQL = "cf6cc811-59f4-4a10-b258-a8547a8f6407"
OMOPCDMCohortCreator = "f525a15e-a73f-4eef-870f-f901257eae22"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"

[compat]
Documenter = "1"
DocumenterVitepress = "0.0.19, 0.0.20"
LiveServer = "1"
julia = "1.6"

[extras]
Expand Down
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
OMOPCDMPathways = "413b2380-0cee-426e-ad22-874d5a2600da"

[compat]
DocumenterVitepress = "0.0.19"
12 changes: 4 additions & 8 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ DocMeta.setdocmeta!(OMOPCDMPathways, :DocTestSetup, :(using OMOPCDMPathways); re

pgs=[
"Home" => "index.md",
"Tutorials" => "tutorials.md",
"Tutorials" => [
"Tutorials" => "tutorials.md",
"Beginner Tutorial 🐣" => "beginner_tutorial.md",
],
"Api" => "api.md",
"Contributing" => "contributing.md"
]

fmt = DocumenterVitepress.MarkdownVitepress(
repo="https://github.com/JuliaHealth/OMOPCDMPathways.jl",
devbranch = "main",
devurl = "dev"
)

makedocs(;
Expand All @@ -24,11 +25,6 @@ makedocs(;
sitename = "OMOPCDMPathways.jl",
format = fmt,
pages = pgs,
warnonly = true,
draft = false,
source = "src",
build = "build",
checkdocs=:all
)

deploydocs(;
Expand Down
Binary file added docs/src/assets/favicon.ico
Binary file not shown.
Binary file added docs/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/src/beginner_tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Beginner Tutorial 🐣

> NOTE: Tutorials are forthcoming and will be made available soon!
119 changes: 118 additions & 1 deletion docs/src/contributing.md
Original file line number Diff line number Diff line change
@@ -1 +1,118 @@
# Contributing to OMOPCDMPathways 😁
# Contributing to `OMOPCDMPathways.jl` 😁

`OMOPCDMPathways.jl` is currently under heavy development as we push to a primary release version.
We follow a workflow pattern that is directly inspired by the [development workflow guide](http://docs.juliaplots.org/latest/contributing/#Development-Workflow-1) found in [`Plots.jl`](https://github.com/JuliaPlots/Plots.jl).
The general workflow we expect contributors to adhere to is as follows:

## 1. Create an Issue about the Problem 📝

If you want to [add functionality] or to work on a bug you found, open an issue first. Also, it is highly recommended to go through this [Bug Template](https://github.com/JuliaHealth/OMOPCDMPathways.jl/blob/dev/.github/ISSUE_TEMPLATE/bug_report.md) before filling a Bug and this [Feature Addition Template](https://github.com/JuliaHealth/OMOPCDMPathways.jl/blob/dev/.github/ISSUE_TEMPLATE/feature_request.md) before filling a Feature request.
That'll save you from doing work that we may not support for OMOPCDMPathways.

## 2. Fork the repo to your account 🍴

A complete step-by-step procedure to fork any repository can be found [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)

## 3. Create a branch based on what you are developing 🌳

Before making a branch, make sure to check that you are even with master via the following commands within your fork:

```sh
git fetch origin
git checkout master
git merge --ff-only origin/main
```

> The `--ff-only` flag will "fast forward" to newer commits. It will not create new merge commits.
Then, go ahead and create a branch that you could edit with the changes you want to see.
This is done by going into the root and typing: `git branch -b [name of your branch]`

## 4. Test, code, and commit ✏️

Once you have a fork, it is useful to make sure the fork was successful.
To verify that everything is operational, let's test it.
The following procedure is as follows:

1. Go into the root of your fork:

`cd OMOPCDMPathways`

2. Open your Julia REPL and type the following within the repo:
```julia
julia> ]
pkg> activate .
pkg> test
```

This might take some time, but if the installation on your computer is successful, it should say all tests passed.

After making the changes you wanted to make, run the tests again to make sure you did not introduce any breaking changes.
If everything passed, we can continue on to the next step.
If not, it is the responsibility of the contributor to resolve any conflicts or failing tests.
Don't worry!
We're happy to help you resolve errors. 😄
If you are stuck, go ahead and continue with this tutorial.

The way we do this is in three steps:

1. Add the files you have added or changed via `git add`

2. After adding the files, we need to say what you did to the files (i.e. commit the files). This can be accomplished thusly: `git commit -m "your message"`

3. Finally, let's push these changes to GitHub using `git push --set-upstream origin [name of the branch you made]`

## 5. Submitting your changes to the main project ✅

Almost done! Go to your fork and there should be a section that asks you to make a pull request (PR) from your branch. This allows the maintainers of `OMOPCDMPathways.jl` to see if they can add your changes to the main project. If not, you can click the "New pull request" button.

Make sure the "base" branch is `dev` and the "compare" branch is the branch on your fork.
To your PR, add an informative title and description, and link your PR to relevant issues or discussions.
Finally, click "Create pull request".

You may get some questions about it, and possibly suggestions of how to make it ready to go into the main project.
If you had test errors or problems, we are happy to help you.
Then, if all goes according to plan, it gets merged... **Thanks for the contribution!!** 🎉 🎉 🎉

## Note on Adding Dependencies 📚

As a rule, we try to avoid having too many dependencies.
Therefore, we request that if you have a PR that adds a new dependency, please have opened an issue previously.

### Adding Core Dependencies 📒

If you are working on introducing a new core dependency, make sure to add that dependency to the main `Project.toml` for `OMOPCDMPathways.jl`.
To do this, follow these steps:

1. Enter the root of the `OMOPCDMPathways` directory

```sh
cd /path/to/OMOPCDMPathways.jl
```

2. Activate the `OMOPCDMPathways` environment and add the dependency:

```julia
julia> ]
pkg> activate .
(OMOPCDMPathways) pkg> add [NAME OF DEPENDENCY]
```

### Adding Test Dependencies 📋

If you are introducing a new test dependency, make sure to add that dependency to the `Project.toml` located in the `OMOPCDMPathways` test directory.
To do this, follow these steps:

1. Enter the test directory inside of the `OMOPCDMPathways` directory

```sh
cd /path/to/OMOPCDMPathways.jl/test/
```

2. Activate the `OMOPCDMPathways` test environment and add the dependency:

```julia
julia> ]
pkg> activate .
(test) pkg> add [NAME OF DEPENDENCY]
```
27 changes: 17 additions & 10 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
```@meta
CurrentModule = OMOPCDMPathways
```

# Welcome to the `OMOPCDMPathways.jl` Docs! 👋

Documentation for [OMOPCDMPathways](https://github.com/JuliaHealth/OMOPCDMPathways.jl).
> Find the pathways patients take while receiving care!
This package allows one to extract the various pathways a patient could take while receiving treatments and care.
It expects patient data to be formatted within a database that adheres to the [OMOP Common Data Model](https://www.ohdsi.org/data-standardization/the-common-data-model/).

**Here's how to get started with the package**:

- Visit the [Tutorials](https://github.com/JuliaHealth/OMOPCDMPathways.jl/blob/main/docs/src/tutorials.md) section to see how this package can be used.

- Check out the [API](https://github.com/JuliaHealth/OMOPCDMPathways.jl/blob/main/docs/src/api.md) section to see all the functions available.

If you want to contribute, please check out our [Contributing](https://github.com/JuliaHealth/OMOPCDMPathways.jl/blob/main/docs/src/contributing.md) guide!

```@index
```
## Why Research Patient Pathways? 🤔

```@autodocs
Modules = [OMOPCDMPathways]
```
[Patient pathways outline](https://bmcpsychiatry.biomedcentral.com/articles/10.1186/s12888-019-2418-7) a patient’s care process, from initial contact to subsequent future patient and health provider interactions.
Understanding patient pathways is an active area of research within observational health studies as they give insight into combinations of drugs patients may be prescribed, duration of treatments, where care is received and overlaps with other treatment regimens patients may be receiving simultaneously.
This package provides a generalized methodology to interrogate patient care evolution in OMOP CDM database settings to further motivate the investigation of questions in health economics (such as costs of care), pharmacovigilance, access to care, and observational health research.
By analyzing these pathways, researchers can identify patterns, assess adherence to treatment, identify gaps in care, optimize resource allocation, and potentially improve patient outcomes and the quality of healthcare delivery.
44 changes: 39 additions & 5 deletions src/OMOPCDMPathways.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
module OMOPCDMPathways
using DataFrames
using Dates
using DBInterface
using FunSQL:
SQLTable,
Agg,
As,
Define,
From,
Fun,
Get,
Group,
Join,
Order,
Select,
WithExternal,
Where,
render,
Limit,
ID,
LeftJoin,
reflect
using TimeZones

# Write your package code here.
function hello()
"world"
end

export hello
using OMOPCDMCohortCreator

function MakeTables(conn, dialect, schema)

@eval global dialect = $(QuoteNode(dialect))
GenerateDatabaseDetails(dialect, schema)
db_info = GenerateTables(conn, inplace = false, exported = true)
for key in keys(db_info)
@eval global $(Symbol(lowercase(string(key)))) = $(db_info[key])
@info "$(lowercase(string(key))) table generated internally"
end

end

export MakeTables

include("preprocessing.jl")
end
29 changes: 29 additions & 0 deletions src/preprocessing.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Dates

function Dummy(
drug_exposure_ids,
conn;
tab = drug_exposure
)

df = DBInterface.execute(conn, Dummy(drug_exposure_ids; tab=tab)) |> DataFrame

return df
end

function Dummy(
drug_exposure_ids;
tab = drug_exposure
)

sql =
From(tab) |>
Where(Fun.in(Get.drug_exposure_id, drug_exposure_ids...)) |>
Select(Get.drug_exposure_id, Get.drug_exposure_start_date) |>
q -> render(q, dialect=dialect)

return String(sql)

end

export Dummy
13 changes: 13 additions & 0 deletions test/Data-Preprocessing/preprocessing.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Test

@testset "Dummy Tests" begin
MakeTables(sqlite_conn, :sqlite, "main")
test_drug_exposure_ids = [1.0, 2.0, 3.0, 4.0]
test_drug_exposure_start_date = [-3.727296e8, 2.90304e7, -5.333472e8, -8.18208e7]
test_df1 = DataFrame(drug_exposure_id = test_drug_exposure_ids, drug_exposure_start_date = test_drug_exposure_start_date)
result = Dummy(test_drug_exposure_ids, sqlite_conn)

@test test_drug_exposure_start_date == result.drug_exposure_start_date[1:4]
@test test_drug_exposure_ids == result.drug_exposure_id[1:4]

end
12 changes: 12 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[deps]
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FunSQL = "cf6cc811-59f4-4a10-b258-a8547a8f6407"
HealthSampleData = "b8464e9a-ae38-46a4-977b-86f00930f698"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
OHDSICohortExpressions = "b1469e29-13af-4897-a4a9-3c363a260582"
OMOPCDMCohortCreator = "f525a15e-a73f-4eef-870f-f901257eae22"
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
Loading

0 comments on commit 64d2d04

Please sign in to comment.