def _compute_name(self):
comp_name = '/'
for hc_res_condition in self:
if hc_res_condition.subject_type == 'patient':
comp_name = hc_res_condition.subject_patient_id.name
if hc_res_condition.subject_patient_id.birth_date:
subject_patient_birth_date = datetime.strftime(datetime.strptime(hc_res_condition.subject_patient_id.birth_date, DF), "%Y-%m-%d")
comp_name = comp_name + "("+ subject_patient_birth_date + ")"
if hc_res_condition.subject_type == 'group':
comp_name = hc_res_condition.subject_group_id.name
if hc_res_condition.code_id:
comp_name = comp_name + ", " + hc_res_condition.code_id.name or ''
if hc_res_condition.asserted_date:
patient_asserted_date = datetime.strftime(datetime.strptime(hc_res_condition.asserted_date, DTF), "%Y-%m-%d")
comp_name = comp_name + ", " + patient_asserted_date
hc_res_condition.name = comp_name
评论列表
文章目录