Commit 189ff447 authored by Ryan Herbert's avatar Ryan Herbert

models/{patient,run}.py add dates for id_strings

only if they are defined.
parent 045f22b9
......@@ -42,8 +42,11 @@ class Patient(SampleSet):
def get_id_string(self, data):
name = self.get_name(data)
ident = "(%d)" % data['sample_set_id']
return ":p %s %s" % (name, ident)
ident = " (%d)" % data['sample_set_id']
birth = ""
if data['birth'] is not None:
birth = " (%s)" % data['birth']
return ":p %s%s%s" % (name, birth, ident)
def validate(self, data):
error = []
......
......@@ -38,8 +38,11 @@ class Run(SampleSet):
def get_id_string(self, data):
name = data['name']
ident = "(%d)" % data['sample_set_id']
return ":r %s %s" % (name, ident)
ident = " (%d)" % data['sample_set_id']
run_date = ""
if data['run_date'] is not None:
run_date = " (%s)" % data['run_date']
return ":r %s%s%s" % (name, run_date, ident)
def validate(self, data):
error = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment