diff --git a/care/facility/management/commands/load_icd11_diagnoses_data.py b/care/facility/management/commands/load_icd11_diagnoses_data.py index 92d90417bd..4ad383bba7 100644 --- a/care/facility/management/commands/load_icd11_diagnoses_data.py +++ b/care/facility/management/commands/load_icd11_diagnoses_data.py @@ -1,7 +1,14 @@ +import json + from django.core.management import BaseCommand, CommandError from care.facility.models.icd11_diagnosis import ICD11Diagnosis -from care.facility.static_data.icd11 import fetch_data + + +def fetch_data(): + with open("data/icd11.json", "r") as json_file: + return json.load(json_file) + ICD11_ID_SUFFIX_TO_INT = { "mms": 1, diff --git a/care/facility/static_data/icd11.py b/care/facility/static_data/icd11.py index 109dda5b04..0d4ed4368a 100644 --- a/care/facility/static_data/icd11.py +++ b/care/facility/static_data/icd11.py @@ -1,5 +1,4 @@ import contextlib -import json from django.db import connection from littletable import Table @@ -7,11 +6,6 @@ from care.facility.models.icd11_diagnosis import ICD11Diagnosis -def fetch_data(): - with open("data/icd11.json", "r") as json_file: - return json.load(json_file) - - def fetch_from_db(): # This is a hack to prevent the migration from failing when the table does not exist all_tables = connection.introspection.table_names()