Skip to content

Commit

Permalink
add symptom display values
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Jan 27, 2025
1 parent 819c4c2 commit 2461c85
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions care/facility/migrations/0484_migrate_symptoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@ def migrate_symptoms(apps, schema_editor):
Condition = apps.get_model("emr", "Condition")

symptom_sct_map = {
SymptomChoices.FEVER: "386661006",
SymptomChoices.SORE_THROAT: "267102003",
SymptomChoices.COUGH: "49727002",
SymptomChoices.BREATHLESSNESS: "267036007",
SymptomChoices.MYALGIA: "68962001",
SymptomChoices.ABDOMINAL_DISCOMFORT: "43364001",
SymptomChoices.VOMITING: "249497008",
SymptomChoices.SPUTUM: "248596009",
SymptomChoices.NAUSEA: "422587007",
SymptomChoices.CHEST_PAIN: "29857009",
SymptomChoices.HEMOPTYSIS: "66857006",
SymptomChoices.NASAL_DISCHARGE: "64531003",
SymptomChoices.BODY_ACHE: "82991003",
SymptomChoices.DIARRHOEA: "62315008",
SymptomChoices.PAIN: "22253000",
SymptomChoices.PEDAL_EDEMA: "102576009",
SymptomChoices.WOUND: "225552003",
SymptomChoices.CONSTIPATION: "14760008",
SymptomChoices.HEADACHE: "25064002",
SymptomChoices.BLEEDING: "131148009",
SymptomChoices.DIZZINESS: "404640003",
SymptomChoices.CHILLS: "43724002",
SymptomChoices.GENERAL_WEAKNESS: "13791008",
SymptomChoices.IRRITABILITY: "55929007",
SymptomChoices.CONFUSION: "40917007",
SymptomChoices.ABDOMINAL_PAIN: "21522001",
SymptomChoices.JOINT_PAIN: "57676002",
SymptomChoices.REDNESS_OF_EYES: "703630003",
SymptomChoices.ANOREXIA: "79890006",
SymptomChoices.NEW_LOSS_OF_TASTE: "36955009",
SymptomChoices.NEW_LOSS_OF_SMELL: "44169009",
SymptomChoices.OTHERS: "404684003",
SymptomChoices.FEVER: ("386661006", "Fever"),
SymptomChoices.SORE_THROAT: ("267102003", "Sore throat"),
SymptomChoices.COUGH: ("49727002", "Cough"),
SymptomChoices.BREATHLESSNESS: ("267036007", "Breathlessness"),
SymptomChoices.MYALGIA: ("68962001", "Myalgia"),
SymptomChoices.ABDOMINAL_DISCOMFORT: ("43364001", "Abdominal discomfort"),
SymptomChoices.VOMITING: ("249497008", "Vomiting"),
SymptomChoices.SPUTUM: ("248596009", "Sputum"),
SymptomChoices.NAUSEA: ("422587007", "Nausea"),
SymptomChoices.CHEST_PAIN: ("29857009", "Chest pain"),
SymptomChoices.HEMOPTYSIS: ("66857006", "Hemoptysis"),
SymptomChoices.NASAL_DISCHARGE: ("64531003", "Nasal discharge"),
SymptomChoices.BODY_ACHE: ("82991003", "Body ache"),
SymptomChoices.DIARRHOEA: ("62315008", "Diarrhea"),
SymptomChoices.PAIN: ("22253000", "General pain"),
SymptomChoices.PEDAL_EDEMA: ("102576009", "Pedal edema"),
SymptomChoices.WOUND: ("225552003", "Wound"),
SymptomChoices.CONSTIPATION: ("14760008", "Constipation"),
SymptomChoices.HEADACHE: ("25064002", "Headache"),
SymptomChoices.BLEEDING: ("131148009", "Bleeding"),
SymptomChoices.DIZZINESS: ("404640003", "Dizziness"),
SymptomChoices.CHILLS: ("43724002", "Chills"),
SymptomChoices.GENERAL_WEAKNESS: ("13791008", "General weakness"),
SymptomChoices.IRRITABILITY: ("55929007", "Irritability"),
SymptomChoices.CONFUSION: ("40917007", "Confusion"),
SymptomChoices.ABDOMINAL_PAIN: ("21522001", "Abdominal pain"),
SymptomChoices.JOINT_PAIN: ("57676002", "Joint pain"),
SymptomChoices.REDNESS_OF_EYES: ("703630003", "Redness of eyes"),
SymptomChoices.ANOREXIA: ("79890006", "Anorexia"),
SymptomChoices.NEW_LOSS_OF_TASTE: ("36955009", "Loss of taste"),
SymptomChoices.NEW_LOSS_OF_SMELL: ("44169009", "Loss of smell"),
SymptomChoices.OTHERS: ("404684003", "Others"),
}

clinical_status_map = {
Expand Down Expand Up @@ -86,7 +86,8 @@ def migrate_symptoms(apps, schema_editor):
category="problem_list_item",
code={
"system": "http://snomed.info/sct",
"code": symptom_sct_map.get(symptom.symptom, "404684003")
"code": symptom_sct_map.get(symptom.symptom, symptom_sct_map[SymptomChoices.OTHERS])[0],
"display": symptom_sct_map.get(symptom.symptom, symptom_sct_map[SymptomChoices.OTHERS])[1]
},
note=symptom.other_symptom,
onset={
Expand Down

0 comments on commit 2461c85

Please sign in to comment.