This repository was archived by the owner on Jun 26, 2025. It is now read-only.
feat: Add with_at_least_one_day_in_critical_care filter to admitted_to_hospital#854
Merged
feat: Add with_at_least_one_day_in_critical_care filter to admitted_to_hospital#854
Conversation
evansd
approved these changes
Aug 10, 2022
Contributor
evansd
left a comment
There was a problem hiding this comment.
Looks good. One small suggestion which I'll leave to your judgement as to whether it's helpful or not.
cohortextractor/tpp_backend.py
Outdated
| conditions.append(f"{supported_columns[column_name]} IN ({value_sql})") | ||
|
|
||
| if with_at_least_one_day_in_critical_care: | ||
| conditions.append("APCS_Der.Spell_PbR_CC_Day > 0") |
Contributor
There was a problem hiding this comment.
This is a bit superfluous because MSSQL will spot that we're comparing to an int and CAST the string column automatically, but it might be clearer to do this explicitly e.g.
Suggested change
| conditions.append("APCS_Der.Spell_PbR_CC_Day > 0") | |
| conditions.append("CAST(APCS_Der.Spell_PbR_CC_Day AS int) > 0") |
Contributor
Author
There was a problem hiding this comment.
Good point - while I was adding the tpp_backend code I'd thought about that and meant to come back to it, but I was kind of expecting the tests to compain and remind me :)
49a9a2f to
eeeed90
Compare
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #828