Пример #1
0
        public void Merge(PRPA_IN201304UV02 mergeEntity)
        {
            var olds = this.Select(mergeEntity?.controlActProcess?.subject?.registrationEvent?.replacementOf?.priorRegistration?.subject1?.priorRegisteredRole?.id?.extension);

            if (olds is null)
            {
                throw new Exception("不存在 先前的注册角色");
            }

            var news = this.Select(mergeEntity?.controlActProcess?.subject?.registrationEvent?.subject1?.patient?.id.extension);

            if (news is null || news.patient_id.IsEmpty(true))
            {
                throw new Exception("不存在 病人");
            }

            var wb = new WhereBuilder();

            wb["patient_id", true] = news.patient_id;
            DBaser.Delete("IAI_PATIENT", wb);

            DBaser.Update("IAI_PATIENT");
            DBaser["patient_id"] = news.patient_id;

            wb["patient_id", true] = olds.patient_id;
            DBaser.AcceptChanges(wb);
        }
Пример #2
0
        public bool DeleteById(string id)
        {
            var wb = new WhereBuilder();

            wb.And("patient_id", id, true);

            return(DBaser.Delete("IAI_PATIENT", wb) > 0);
        }