Skip to content

Commit b71f4c5

Browse files
committed
fix mother hid
1 parent 1b2b4a1 commit b71f4c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/reportgen/definitions/BirthLog.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def _create_table(self):
8282
def _add_report_to_table(self, table, report):
8383
""" add report to table """
8484
patient = report.encounter.patient
85+
try:
86+
mother_id = patient.mother.health_id.upper()
87+
except:
88+
mother_id = ""
89+
8590
table.add_row([
8691
Text(patient.location),
8792
Text(patient.health_id.upper()),
@@ -90,7 +95,7 @@ def _add_report_to_table(self, table, report):
9095
Text(patient.dob.strftime("%d/%m/%y")),
9196
Text(patient.humanised_age()),
9297
Text(patient.household.health_id.upper()),
93-
Text(patient.mother.health_id.upper()),
98+
Text(mother_id),
9499
Text(report.clinic_delivery_text),
95100
Text(report.encounter.encounter_date.strftime("%d/%m/%y")),
96101
Text(patient.chw)])

0 commit comments

Comments
 (0)