fix(medcat-trainer): Fix Concepts tab for CDBs with no heirarchy#532
Conversation
tomolopolis
left a comment
There was a problem hiding this comment.
lgtm - thanks for fixing the obv issues with this screen. a 'warning' / notice or even disabling this tab gracefully for those cdb's with no pt2ch map likely makes sense
| {'cui': FLAT_CDB_ROOT_CUI, 'pretty_name': 'All concepts'}, | ||
| ]}) | ||
| cuis = sorted(cdb.cui2info)[:FLAT_CDB_CHILDREN_LIMIT] | ||
| return Response({'results': [ |
There was a problem hiding this comment.
Can we 'warn' that the model does not allow ontology navigation due to pt2ch map metadata missing? and / or this has been limited to CHILDREN_LIMIT in the resp?
The whole idea of the concepts tab was an easy way to build out a filter for a given project. Which this still allows over just throwing an error so does make sense.
There was a problem hiding this comment.
Would agree some UI side warning would be really useful. In general as well we could do with more toasts/errors etc shown around
Made a ticket on https://app.clickup.com/t/20516280/869dnb54u
Existing Behavior
When used with a CDB that isn't a full SNOMED one, the concepts tab currently fails silently for the user. The network call gives a 400 "Requested MedCAT CDB model does not include parent2child metadata to explore a concept hierarchy"
This change fixes it by supporting a flat tree under a dummy root node. It just returns the first 500 concepts, a limit hardcoded for now
New Behavior