Skip to content
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
rebkwok merged 1 commit intomainfrom
critical-care-days-filter
Aug 10, 2022
Merged

feat: Add with_at_least_one_day_in_critical_care filter to admitted_to_hospital#854
rebkwok merged 1 commit intomainfrom
critical-care-days-filter

Conversation

@rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Aug 10, 2022

Fixes #828

Copy link
Contributor

@evansd evansd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One small suggestion which I'll leave to your judgement as to whether it's helpful or not.

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

@rebkwok rebkwok force-pushed the critical-care-days-filter branch from 49a9a2f to eeeed90 Compare August 10, 2022 10:27
@rebkwok rebkwok merged commit 76eb09f into main Aug 10, 2022
@rebkwok rebkwok deleted the critical-care-days-filter branch August 10, 2022 10:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add with_at_least_one_day_in_critical_care filter to admitted_to_hospital

2 participants