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

Exclude ICD11 entries from redis that does not have a meta_chapter_short #2207

Merged
merged 3 commits into from
Jun 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions care/facility/static_data/icd11.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ def load_icd11_diagnosis():
print("Loading ICD11 Diagnosis into the redis cache...", end="", flush=True)

icd_objs = ICD11Diagnosis.objects.order_by("id").values_list(
"id", "label", "meta_chapter_short"
"id", "label", "meta_chapter_short", "meta_chapter"
)
paginator = Paginator(icd_objs, 5000)
for page_number in paginator.page_range:
for diagnosis in paginator.page(page_number).object_list:
ICD11(
id=diagnosis[0],
label=diagnosis[1],
chapter=diagnosis[2] or "",
chapter=diagnosis[2] or diagnosis[3],
has_code=1 if re.match(DISEASE_CODE_PATTERN, diagnosis[1]) else 0,
vec=diagnosis[1].replace(".", "\\.", 1),
).save()
Expand Down
Loading