Add support for ICD10MultiCodeString type#2274
Conversation
bd6dde7 to
9954f4e
Compare
Deploying databuilder-docs with
|
| Latest commit: |
905e801
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://be0fec54.databuilder.pages.dev |
| Branch Preview URL: | https://rw-list-of-icd10-codes-as-st.databuilder.pages.dev |
There was a problem hiding this comment.
This is looking really good. I think the ratio of usefulness of feature to lines of production code is particularly high here, which is always nice to see.
I've made a few minor comments. I think the major thing we still need to do is validation for strings, but that should be reasonably straightforward to add.
There's also some messing around with exactly where tests live which isn't significant in one sense but worth getting right.
I agree with your call to leave the inherited methods in place, even thought they don't quite make sense. The cleanest way to deal with this would be to fiddle with the class hierarchy a bit so we have some lighter weight base classes to inherit from and then classes providing the standard methods which other types can use by default. But that's definitely out of scope here.
Oh micro-nit, but the PR title could do with changing from the default!
|
Couple of other things to note about the implementation - mainly around the fact we want a spec test table to contain
|
evansd
left a comment
There was a problem hiding this comment.
Great! I'm happy this does all the right things. A few minor comments but nothing that's immediately blocking.
ICD10MultiCodeString type
fixes #2010
Notes
all_diagnosesfield ofapcs. If successful I will then also implement theall_proceduresfield as anOPCS4MultiCodeString.all_diagnoses == "N170", which would run previously (but return no results). I'm overriding__eq__(and__ne__) so that the error is more helpful. I've also updated the docstrings so it's clear that it doesn't make sense to use these operators.is_in,map_values, andcount_distinct_for_patients. They all appear in the docs (reference/language/#MultiCodeStringEventSeries). I could have overriden them as well, but thought a better solution (in the future) would be to have a better way to hide, or remove, these methods in some way@marshal.register(BaseMultiCodeString)decorator - or if the fact that it's just a string means that it's fine.