hc_res_encounter.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:odoo-fhir 作者: luigisison 项目源码 文件源码
def _compute_name(self):            
        comp_name = '/'     
        for hc_res_encounter in self:
            if hc_res_encounter.subject_type == 'patient':
                comp_name = hc_res_encounter.subject_patient_id.name
                if hc_res_encounter.subject_patient_id.birth_date:
                    subject_patient_birth_date = datetime.strftime(datetime.strptime(hc_res_encounter.subject_patient_id.birth_date, DF), "%Y-%m-%d")
                    comp_name = comp_name + "("+ subject_patient_birth_date + ")"
            if hc_res_encounter.subject_type == 'group':
                    comp_name = hc_res_encounter.subject_group_id.name
            # if hc_res_encounter.type_id:   
            #     comp_name = comp_name + ", " + hc_res_encounter.type_id.name or ''
            if hc_res_encounter.start_date:
                subject_start_date =  datetime.strftime(datetime.strptime(hc_res_encounter.start_date, DTF), "%Y-%m-%d")
                comp_name = comp_name + ", " + subject_start_date
            hc_res_encounter.name = comp_name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号