Esempio n. 1
0
        private void CreateMergeInfos(
            ObjectType objectType,
            string parameterName,
            string ownValue,
            string foreignValue,
            CPatient diffPatient,
            out CMergeInfo ownPatientMergeInfo,
            out CMergeInfo foreignPatientMergeInfo)
        {
            const string differenceStr = "Пациент: '{0}'. Нозология:'{1}'.\r\nНазвание параметра: '{2}'. Значение: '{3}'";

            ownPatientMergeInfo = new CMergeInfo
            {
                IdOwnPatient = Id,
                TypeOfObject = objectType,
                Value        = ownValue,
                Difference   = string.Format(differenceStr, GetFullName(), Nosology, parameterName, ownValue)
            };

            foreignPatientMergeInfo = new CMergeInfo
            {
                IdForeignPatient = diffPatient.Id,
                TypeOfObject     = objectType,
                Value            = foreignValue,
                Difference       = string.Format(differenceStr, diffPatient.GetFullName(), diffPatient.Nosology, parameterName, foreignValue)
            };
        }
Esempio n. 2
0
        public CPatientView(CPatient patientInfo, CWorkersKeeper workersKeeper)
        {
            Id                 = patientInfo.Id.ToString(CultureInfo.InvariantCulture);
            Nosology           = patientInfo.Nosology;
            FullName           = patientInfo.GetFullName();
            HospitalizationCnt = workersKeeper.HospitalizationWorker.GetCountByPatientId(patientInfo.Id).ToString(CultureInfo.InvariantCulture);
            VisitCnt           = workersKeeper.VisitWorker.GetCountByPatientId(patientInfo.Id).ToString(CultureInfo.InvariantCulture);
            COperation[] operations = workersKeeper.OperationWorker.GetListByPatientId(patientInfo.Id);
            OperationCnt = operations.Length.ToString(CultureInfo.InvariantCulture);
            Age          = CConvertEngine.GetAge(patientInfo.Birthday);

            var operationTypeSB = new StringBuilder();

            foreach (COperation operation in operations)
            {
                foreach (string operationType in operation.OperationTypes)
                {
                    if (!operationTypeSB.ToString().Contains(operationType))
                    {
                        operationTypeSB.Append(operationType + ", ");
                    }
                }
            }

            OperationTypes = operationTypeSB.Length > 0
                ? operationTypeSB.ToString().Substring(0, operationTypeSB.Length - 2)
                : operationTypeSB.ToString();

            int    hospitalizationCnt = Convert.ToInt32(HospitalizationCnt);
            int    visitCnt           = Convert.ToInt32(VisitCnt);
            CVisit lastVisit          = null;

            if (visitCnt > 0)
            {
                lastVisit = workersKeeper.VisitWorker.GetListByPatientId(patientInfo.Id)[visitCnt - 1];
            }

            CHospitalization lastHospitalization = null;

            if (hospitalizationCnt > 0)
            {
                lastHospitalization = workersKeeper.HospitalizationWorker.GetListByPatientId(patientInfo.Id)[hospitalizationCnt - 1];
            }

            if (lastHospitalization != null)
            {
                DeliveryDateString = CConvertEngine.DateTimeToString(lastHospitalization.DeliveryDate, true);

                ReleaseDateString = CConvertEngine.DateTimeToString(lastHospitalization.ReleaseDate, false);

                KD = lastHospitalization.KD;

                if (lastVisit == null)
                {
                    Diagnose = lastHospitalization.DiagnoseOneLine;
                }
            }

            if (lastVisit != null)
            {
                VisitDateString = CConvertEngine.DateTimeToString(lastVisit.VisitDate, true);
            }

            if (lastHospitalization == null && lastVisit != null)
            {
                Diagnose = lastVisit.DiagnoseOneLine;
            }
            else if (lastHospitalization != null && lastVisit != null)
            {
                int dateCompareResult = CCompareEngine.CompareDateTime(lastHospitalization.DeliveryDate, lastVisit.VisitDate);
                Diagnose = dateCompareResult >= 0
                    ? lastHospitalization.DiagnoseOneLine
                    : lastVisit.DiagnoseOneLine;
            }
        }
Esempio n. 3
0
 public static int Compare(CPatient patientInfo1, CPatient patientInfo2)
 {
     return(string.CompareOrdinal(patientInfo1.GetFullName(), patientInfo2.GetFullName()));
 }