Пример #1
0
        public override ServiceAux Read(System.Data.Common.DbDataReader reader, int number)
        {
            ServiceAux result = new ServiceAux();

            result.ServiceId = ReadString(reader["SERVICE_ID"]);

            result.ServiceCode = ReadInt(reader["SERVICE_CODE"]);
            result.Result      = ReadString(reader["RESULT"]);
            result.BedProfile  = ReadString(reader["BED_PROFILE"]);
            result.Quantity    = ReadInt(reader["QUANTITY"]);
            result.Tariff      = (decimal)reader["TARIFF"];
            result.Total       = (decimal)reader["TOTAL"];

            result.SpecialityCode = SpecialityDict.Get(ReadString(reader["SPECIALITY_ID"]));
            // По-новому профиль МП должен соответствовать специальности врача, а не только быть привязанным к услуге
            result.AidProfile = Dict.AidProfileBySpeciality.Instance.Get(ReadString(reader["AID_PROFILE"]), result.SpecialityCode);

            result.DoctorCode   = ReadString(reader["DOCTOR_CODE"]);
            result.Date         = ReadDate(reader["D_U"]);
            result.Newborn      = ReadBool(reader["NOVOR"]);
            result.DirectedFrom = ReadString(reader["DIRECTION_FROM"]);
            result.BirthWeight  = ReadInt(reader["BIRTH_WEIGHT"]);

            result.Outcome = ReadString(reader["OUTCOME"]);
            // Dict.Outcome.Get(result.AidConditions, ReadString(reader["OUTCOME"]).TrimStart('0'));

            result.Transfer = ServiceAux.GetTransfer(ReadInt(reader["TRANSFER"]));
            result.Reason1  = ReadString(reader["REASON1"]); //
            result.BedDays  = ReadInt(reader["BED_DAYS"]);

            // Не смущаем ФОМС первичным диагнозом: он необязателен
            //result.PrimaryDiagnosis = ReadString(reader["DS_PRIMARY"]);

            result.ConcurrentDiagnosis   = ReadString(reader["DS_CONCURRENT"]);
            result.ComplicationDiagnosis = ReadString(reader["DS_COMPLICATION"]);
            result.ConcurrentMesCode     = ReadString(reader["CONCURRENT_MES_CODE"]);
            result.StatisticCode         = (StatisticCode)ReadInt(reader["CHARACTER"]);

            //if (result.ServiceCode == 3034 || result.ServiceCode == 3038) {
            //    Console.WriteLine(result.BedDays);
            //}

            int dummy = ReadInt(reader["DISPENSARY_SUPERVISION"]);

            result.DispensarySupervision = ServiceAux.GetDispensarySupervision(dummy, ReadInt(reader["DCANCEL_REASON"]));

            return(result);
        }
Пример #2
0
        public override RecourseAux Read(System.Data.Common.DbDataReader reader, int number)
        {
            RecourseAux result = new RecourseAux();

            result.OrdinalNumber = number;

            result.PersonId   = ReadString(reader["PERSON_ID"]);
            result.ServiceId  = ReadString(reader["SERVICE_ID"]);
            result.Department = ReadString(reader["DEPT"]);
            result.Unit       = ReadString(reader["UNIT"]);

            //result.AidProfile = Dict.AidProfile.Instance.Get(ReadString(reader["AID_PROFILE"]));
            result.SpecialityCode = SpecialityDict.Get(ReadString(reader["SPECIALITY_ID"]));

            // TODO: Which is more precise?
            result.AidProfile = ReadString(reader["AID_PROFILE"]);
            //result.AidProfile = Dict.AidProfileBySpeciality.Instance.Get(ReadString(reader["MSP"]), result.SpecialityCode);

            result.PayKind = ReadString(reader["PAY_KIND"]);
            int dummy = ReadInt(ReadString(reader["AID_CONDITIONS"]));

            result.AidConditions = Dict.Condition.Instance.Get(dummy.ToString());

            result.ServiceCode      = ReadInt(reader["SERVICE_CODE"]);
            result.Result           = ReadString(reader["RESULT"]);
            result.Outcome          = ReadString(reader["OUTCOME"]);
            result.PayType          = (Model.PayType)ReadInt(reader["PAY_TYPE"]);
            result.MobileBrigade    = ReadBool(reader["MOBILE_BRIGADE"]);
            result.RecourseResult   = ReadString(reader["RECOURSE_RESULT"]);
            result.Child            = ReadBool(reader["DET"]);
            result.CardNumber       = ReadString(reader["CARD_NUMBER"]);
            result.MainDiagnosis    = ReadString(reader["DS_MAIN"]);
            result.Rehabilitation   = ReadBool(reader["REHABILITATION"]);
            result.InterventionKind = ReadString(reader["INTERVENTION_KIND"]);
            result.Quantity         = ReadInt(reader["QUANTITY"]);
            result.Tariff           = (decimal)reader["TARIFF"];
            result.Total            = (decimal)reader["TOTAL"];
            result.DoctorCode       = ReadString(reader["DOCTOR_CODE"]);
            result.Date             = ReadDate(reader["D_U"]);
            result.ServiceKind      = ReadInt(reader["SERVICE_KIND"]);

            // Дневной стационар у нас - поликлиническое отделение, не имеющее профиля койки.
            // Отсюда вручную прописываем терапию или неврологию в зависимости от диагноза
            if (dummy == 1 || dummy == 2)
            {
                result.BedProfile = Dict.BedProfile.Instance.Get(ReadString(reader["BED_PROFILE"]));
                if (result.BedProfile == "???")
                {
                    if (result.MainDiagnosis.StartsWith("I6"))
                    {
                        result.BedProfile = "34";
                    }
                    else
                    {
                        result.BedProfile = "71";
                    }
                }
            }

            result.Update();

            return(result);
        }