smart-on-fhir / chart-review

Measure agreement between chart reviewers.
https://docs.smarthealthit.org/cumulus/chart-review/
Apache License 2.0
1 stars 0 forks source link

feat: add new config option 'grouped-labels' to combine labels #18

Closed mikix closed 5 months ago

mikix commented 5 months ago

This is basically the reverse of implied-labels. Instead of expanding labels, we restrict the whole set down to a smaller one.

Example:

labels: [Fever, Cough, Pain]
grouped-labels:
  Sick: [Fever, Cough, Pain]

Would result in not 3 separate labels being scored, but just one.

I also took this opportunity to refactor things a bit.

I basically expanded the idea of "simplifying the export data" into a real class model and moved some code from agree.py to simplify.py.

mikix commented 5 months ago

This looks fine - if you refactoring already and you feel like it, i still always bump against the verb module names (agree, simplify), which should be replaced with nouns, but that doesn't have to happen here if you don't feel want to.

Fair. What we have now is a bunch of verb-oriented code that operates on shared data structures. So agree.py holds the agreement/confusion matrix code. simplify.py holds some code that reduces the complicated Label Studio export down to just what we care about. Etc.

I've been adding better typing for the shared data structures. Adding little dataclasses where appropriate. And a possible move in the future is to grow that into class-oriented code (vs verb-oriented code).