Closed WillLP-code closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
15179c5
) 95.27% compared to head (74191e7
) 95.27%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The add_col_to_episodes_CONTINUOUSLY_LOOKED_AFTER
function in lac_validator/utils.py may be of help with determining non-respite periods of care (the code logic within, not the actual function). E.g. using RNE
= "S" and REC
<> "X1" to identify breaks in periods of care.
I'm thinking something like this:
1) Make sure there is a SW episode where SW_DECOM
<= episode DEC
where REC
<> "X1"
2) Make sure there is a SW episode where SW_DECOM
>= episode DECOM
where RNE
= "S"
3) Exclude episodes from the above where LS
= V3/V4
I'm assuming another rule somewhere is testing "has a SW episode if open at end of year".
The
add_col_to_episodes_CONTINUOUSLY_LOOKED_AFTER
function in lac_validator/utils.py may be of help with determining non-respite periods of care (the code logic within, not the actual function). E.g. usingRNE
= "S" andREC
<> "X1" to identify breaks in periods of care.I'm thinking something like this:
- Make sure there is a SW episode where
SW_DECOM
<= episodeDEC
whereREC
<> "X1"- Make sure there is a SW episode where
SW_DECOM
>= episodeDECOM
whereRNE
= "S"- Exclude episodes from the above where
LS
= V3/V4I'm assuming another rule somewhere is testing "has a SW episode if open at end of year".
@SLornieCYC I've made a further attempt at this, trying to take into account what you said. I haven't written a test yet because I wanted to check if this was along the lines of what you had in mind? I'm happy for you to change/completely re-do this if you want to and find you have time
@SLornieCYC I've made a further attempt at this, trying to take into account what you said. I haven't written a test yet because I wanted to check if this was along the lines of what you had in mind? I'm happy for you to change/completely re-do this if you want to and find you have time
I've added some more feedback and written some test data based on what I think should pass and fail! (But I could be wrong!)
@SLornieCYC I can't believe how long I've worked at this only for you to manage it in an afternoon with a really elegant solution! Well done! I'm just getting it in and committing it, then, if you approve it, I'll work on getting a new version pushed with the new ingress and the last of these rules done!
Closes #680
I'm going to have to come back to this when I've done the other rules, it doesn't work and I need to think about how to calculate periods of non-respite care, separate them, and then calculate if SW episodes exist for each of them