-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Period_prior_to_index
function
#35
Open
Jay-sanjay
wants to merge
27
commits into
dev
Choose a base branch
from
period_prior_to_index
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
01cc575
Intiaial dispatch for period_prior_to_index function
Jay-sanjay 6c6780c
trying to debug
Jay-sanjay b239985
Added the second dispatch
Jay-sanjay 9039db8
Tests added for the second dispatch
Jay-sanjay a0a64b1
debugging
Jay-sanjay a3e1c10
debugging
Jay-sanjay ec9d500
print
Jay-sanjay f90444d
print
Jay-sanjay ce88cd5
Docs Strings added
Jay-sanjay 57a4ab1
Added to api.md
Jay-sanjay d989ab3
Added to api.md
Jay-sanjay 01ac533
added to api.md
Jay-sanjay 6ce8bd3
Update preprocessing.jl
Jay-sanjay 96f8457
Create cohort on Eunomia for testing
TheCedarPrince 6b1e001
Merge branch 'dev' into period_prior_to_index
TheCedarPrince bb3856c
Update preprocessing.jl
Jay-sanjay 3cdc4e3
added requested changes
Jay-sanjay 65cfe3e
added more changes
Jay-sanjay e23dab5
added requested changes
Jay-sanjay 0488869
Merge branch 'dev' into period_prior_to_index
Jay-sanjay 13b1f45
Update api.md
Jay-sanjay f446cbc
Update preprocessing.jl
Jay-sanjay 6fe7490
Update preprocessing.jl
Jay-sanjay c929d81
bug fixed
Jay-sanjay ac4410a
Update preprocessing.jl
Jay-sanjay a5f59dd
Merge branch 'dev' into period_prior_to_index
Jay-sanjay 1432c24
Update preprocessing.jl
Jay-sanjay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added the second dispatch
- Loading branch information
commit b239985e8181900f646c4f92d974d63c5754e9df
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,31 @@ function period_prior_to_index(cohort_id::Vector, conn; date_prior=Day(100), tab | |
return df | ||
end | ||
|
||
""" | ||
TODO: Add Doc-Strings. | ||
""" | ||
function period_prior_to_index( | ||
person_ids::Vector, | ||
Jay-sanjay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
start_date_on_person::Function, | ||
conn; | ||
date_prior=Day(100) | ||
) | ||
|
||
tables = GenerateTables(conn, inplace = false, exported=true) | ||
|
||
sql = start_date_on_person(person_ids, tables) | ||
|
||
df = DBInterface.execute(conn, String(sql)) |> DataFrame | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll need to put this line before sql to compute the cohorts. |
||
|
||
# Check if the DataFrame is not empty | ||
# TODO: Is it really necessary to add this check ?? | ||
Jay-sanjay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if nrow(df) > 0 | ||
# Convert the cohort_start_date to DateTime and subtract the date_prior | ||
df.cohort_start_date = DateTime.(df.cohort_start_date) .- date_prior | ||
end | ||
|
||
return df | ||
end | ||
|
||
|
||
export Dummy, period_prior_to_index |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add an example section here about how to call this function and how to pass in a function into the argument which accepts a user defined function? So show how to make a function? Thanks!