示例#1
0
 protected virtual void StoreSpecimen(SpecimenIntegrationDto specimen)
 {
     //插入我们的数据库
     using (var conn = ConnectionFactory.Create())
     {
         var specimenId = Guid.NewGuid();
         specimen.Id = specimenId;
         specimen.Patient.SpecimenId = specimenId;
         specimen.SpecimenInspectionItems.ForEach(p => p.SpecimenId = specimenId);
         specimen.Barcode += "8989";
         using (var transaction = conn.BeginTransaction())
         {
             try
             {
                 conn.Insert(specimen, transaction);
                 conn.Insert(specimen.Patient, transaction);
                 specimen.SpecimenInspectionItems.ForEach(p => conn.Insert(p, transaction));
                 transaction.Commit();
             }
             catch (Exception e)
             {
                 transaction.Rollback();
             }
         }
     }
 }
示例#2
0
        private void BindSpecimen(SpecimenIntegrationDto specimen)
        {
            if (specimen == null)
            {
                throw new ArgumentNullException(nameof(specimen));
            }
            lblBarcode.Text           = specimen.Barcode;
            lblPatientTypeName.Text   = specimen.PatientTypeName;
            lblDepartmentName.Text    = specimen.DepartmentName;
            lblInpatientAreaName.Text = specimen.InpatientAreaName;
            lblBedNo.Text             = specimen.BedNo;
            lblDoctorName.Text        = specimen.DoctorName;
            lblSpecimenTypeName.Text  = specimen.SpecimenTypeName;
            lblApplyAccount.Text      = specimen.ApplicantName;
            lblApplyTime.Text         = specimen.ApplyDate?.ToString(ToolConstant.DateTimeFormatt);
            lblCollectAccount.Text    = specimen.CollectAccount;
            lblCollectTime.Text       = specimen.CollectDate?.ToString(ToolConstant.DateTimeFormatt);
            lblChargeTypeName.Text    = specimen.ChargeTypeName;
            lblDiagnosis.Text         = specimen.Diagnosis;
            lblRemark.Text            = specimen.Remark;
            //Patient
            lblPatientCode.Text     = specimen.Patient.Code;
            lblPatientName.Text     = specimen.Patient.Name;
            lblMedicalRecordNo.Text = specimen.Patient.MedicalRecordNo;
            lblPatientAge.Text      = specimen.Patient.Age;
            lblAgeUnit.Text         = specimen.Patient.AgeUnit;
            lblPatientSex.Text      = specimen.Patient.Sex;
            lblIdentityCard.Text    = specimen.Patient.IdCard;
            lblPhoneNo.Text         = specimen.Patient.Phone;
            lblAddress.Text         = specimen.Patient.Address;

            var n = 0;

            foreach (var specimenInspectionItemIntegrtionDto in specimen.SpecimenInspectionItems)
            {
                var uc = new UcSpecimenInspetionItem(specimenInspectionItemIntegrtionDto)
                {
                    Location = new Point(0, 76 * n)
                };
                pnlInspectionItems.Controls.Add(uc);
                n++;
            }
        }