Skip to content
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
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Tests added for the second dispatch
  • Loading branch information
Jay-sanjay committed Jun 7, 2024
commit 9039db84661b0b919e3e57cc77fec5ba0873b241
19 changes: 18 additions & 1 deletion test/Data-Preprocessing/preprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,24 @@ end

println(result)

# @test test_person_ids == result.cohort_definition_id[1:5]
@test test_person_ids == result.cohort_definition_id[1:5]
@test test_subject_ids == result.subject_id[1:5]

function start_date_on_person(cohort_id::Vector, tables)

tab = tables[:cohort]

sql = From(tab) |>
Where(Fun.in(Get.cohort_definition_id, cohort_id...)) |>
Select(Get.cohort_definition_id, Get.subject_id, Get.cohort_start_date) |>
q -> render(q, dialect = :sqlite)

return sql
end

result = period_prior_to_index(test_person_ids, start_date_on_person, sqlite_conn)

@test test_person_ids == result.cohort_definition_id[1:5]
@test test_subject_ids == result.subject_id[1:5]
Jay-sanjay marked this conversation as resolved.
Show resolved Hide resolved

end
Loading