import sys import csv from xhtml2pdf import pisa import os import pandas as pd rptData = {} rptData['Person Name'] = "row['Name']" rptData['Age'] = "row['Age']" rptData['Gender'] = "row['Gender']" rptData['Age / Sex'] = "Male" rptData['Sample type'] = 'Capillary Whole Blood' rptData['Family History of Sickle Cell Anemia'] = 'Unknown' rptData['Marital Status'] = "row['Marital Status']" rptData['Test Date'] = "date" rptData['Patient ID'] = "row['ABHA ID']" rptData['Sample ID'] = "row['_id']" rptData['value'] = "row['Measured Deovix Ratio']" rd = rptData # template_path = os.path.join(THIS_DIR, 'report_template.html') report_template =r'''
|
Person Name: {{ reportData["Person Name"] }}
Age / Sex: {{reportData['Age']}} / {{reportData['Gender']}}
Sample type:{{ reportData["Sample type"] }}
Family History of Sickle Cell Anemia:{{ reportData["Family History of Sickle Cell Anemia"] }}
|
Marital Status:{{ reportData["Marital Status"] }}
Test Date:{{ reportData["Test Date"] }}
ABHA ID:{{ reportData["Patient ID"] }}
Sample ID:{{ reportData["Sample ID"] }}
|
| Test Description | RESULT | REFERENCE RANGES |
|---|---|---|
|
Sickle Cell
Anemia
(Method: HPOS)
|
Ra = {{ reportData["value"] }}
|
< 0.16: Normal (HbA)
0.165 – 0.235: Sickle-cell Trait (HbAS)
> 0.24: Sickle-cell Disease (HbSS)
0.16-0.165: Inconclusive (Negative Borderline)
0.235 – 0.24: Inconclusive (Positive Borderline)
|