Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ICD11 Table; Cleanup in-memory search #1636

Merged
merged 10 commits into from
Oct 5, 2023

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Sep 25, 2023

Proposed Changes

  • All ICD11 diagnoses are loaded into the DB from now on. None is skipped.
  • ID for entries with icd ID of format (.../<possible_duplicate_id>/mms/...) is now mapped in the following manner:
http://id.who.int/icd/entity/594985340                    -> 594985340  👈 Did not multiply by 1e3 as then it would break existing relations.
http://id.who.int/icd/entity/594985340/mms                -> 5949853400001
http://id.who.int/icd/entity/594985340/mms/unspecified    -> 5949853400003
  • New ICD Entries are a superset of previous entries.
  • The new table can be used to build relations (for production use, not just metabase purposes anymore)
  • The old MetaICD11Diagnosis table can be deleted once metabase queries are updated to the new table.
  • Only necessary fields: id and label are loaded onto the in-memory table.
  • Lazy load the in-memory table (to prevent read from db before table is created)

Associated Issue

Architecture changes

  • Remove this section if not used

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@rithviknishad rithviknishad marked this pull request as ready for review September 25, 2023 13:49
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (0a4a4c4) 59.11% compared to head (1cc07e6) 59.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1636      +/-   ##
==========================================
+ Coverage   59.11%   59.46%   +0.34%     
==========================================
  Files         207      208       +1     
  Lines       11264    11283      +19     
  Branches     1599     1597       -2     
==========================================
+ Hits         6659     6709      +50     
+ Misses       4405     4372      -33     
- Partials      200      202       +2     
Files Coverage Δ
...y/management/commands/load_icd11_diagnoses_data.py 85.71% <100.00%> (ø)
care/facility/models/__init__.py 100.00% <100.00%> (ø)
care/facility/models/meta_icd11_diagnosis.py 95.00% <ø> (ø)
care/facility/models/icd11_diagnosis.py 95.45% <95.45%> (ø)
care/facility/static_data/icd11.py 70.00% <75.00%> (-14.85%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

care/facility/static_data/icd11.py Outdated Show resolved Hide resolved
care/facility/static_data/icd11.py Outdated Show resolved Hide resolved
@rithviknishad
Copy link
Member Author

rithviknishad commented Oct 4, 2023

marking as hold for ohcnetwork/care_fe#5293

Edit: planned to be done as a follow-up PR as more understanding is required about how ICD11 is structured.

@rithviknishad rithviknishad removed the Hold label Oct 5, 2023
@nihal467
Copy link
Member

nihal467 commented Oct 5, 2023

LGTM, Tested in local

@vigneshhari vigneshhari merged commit fd7fd29 into master Oct 5, 2023
7 checks passed
@vigneshhari vigneshhari deleted the refactor-icd11-table branch October 5, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NE6Z (ICD-11) not appearing in search ICD-11- DONOT allow users to pick ICD-11 groups as diagnosis
5 participants