diff --git a/mysite/mrn2hash.py b/mysite/mrn2hash.py index 0a967d4..6c16441 100644 --- a/mysite/mrn2hash.py +++ b/mysite/mrn2hash.py @@ -32,12 +32,14 @@ def hashptid(mrn, hosp='NTUH'): PATIENTS = [] -for p in Patient.objects.all(): +for p in Patient.objects.all().order_by('medical_records'): md5, hash = hashptid(p.medical_records) print (p.medical_records, hash) PATIENTS.append({ 'ChartNo': p.medical_records, 'hash': hash, + 'gender': p.gender, + 'birthday': p.birthday, })