public IActionResult GetListByVisitJson(string visitId)
        {
            var data = _dialysisObservationApp.GetListByVisit(visitId)
                       .Select(t => t)
                       .ToList()
                       .OrderBy(t => t.F_NurseOperatorTime);

            return(Content(data.ToJson()));
        }
Esempio n. 2
0
        /// <summary>
        /// 根据治疗单主键查询观察记录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <IActionResult> GetListByVid(BaseInput input)
        {
            var visit = await _patVisitApp.GetForm(input.KeyValue);

            if (visit == null)
            {
                return(BadRequest("治疗单主键有误"));
            }
            var data = _dialysisObservationApp.GetListByVisit(input.KeyValue)
                       .Select(t => new
            {
                id           = t.F_Id,
                ssy          = t.F_SSY,
                szy          = t.F_SZY,
                hr           = t.F_HR,
                a            = t.F_A,
                bf           = t.F_BF,
                ufr          = t.F_UFR,
                v            = t.F_V,
                c            = t.F_C,
                t            = t.F_T,
                ufv          = t.F_UFV,
                tmp          = t.F_TMP,
                gsl          = t.F_GSL,
                memo         = t.F_MEMO,
                nurseName    = t.F_Nurse,
                operatorTime = t.F_NurseOperatorTime
            }).OrderBy(t => t.operatorTime).ToList();

            return(Ok(data));
        }
        /// <summary>
        /// 今日就诊-治疗单详情
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <IActionResult> GetIntactInfo(BaseInput input)
        {
            var entity = await _patVisitApp.GetForm(input.KeyValue);

            var patient = await _patientApp.GetForm(entity.F_Pid);

            var data = new GetIntactInfoOutput
            {
                checkPerson       = entity.F_CheckPerson,
                dialysisStartTime = entity.F_DialysisStartTime,
                dialysisEndTime   = entity.F_DialysisEndTime,
                endPerson         = entity.F_EndPerson,
                memo           = entity.F_Memo,
                percent        = 0,
                puncturePerson = entity.F_PuncturePerson,
                startPerson    = entity.F_StartPerson
            };

            data.patient = new Patients
            {
                patientId     = patient.F_Id,
                headIcon      = patient.F_HeadIcon,
                ideaWeight    = patient.F_IdealWeight,
                maritalStatus = patient.F_MaritalStatus,
                patientGender = patient.F_Gender,
                patientName   = patient.F_Name
            };
            if (patient.F_BirthDay != null)
            {
                data.patient.patientAge = ((DateTime.Now - patient.F_BirthDay.ToDate()).TotalDays / 365).ToInt();
            }
            data.vitalSigns = new VitalSigns
            {
                diastolicPressure = entity.F_DiastolicPressure,
                systolicPressure  = entity.F_SystolicPressure,
                temperature       = entity.F_Temperature,
                pulse             = entity.F_Pulse
            };
            data.dialysisParameter = new DialysisParameter
            {
                accessName           = entity.F_AccessName,
                bloodSpeed           = entity.F_BloodSpeed,
                Ca                   = entity.F_Ca,
                dialysateTemperature = entity.F_DialysateTemperature,
                dialysisType         = entity.F_DialysisType,
                dialyzerType1        = entity.F_DialyzerType1,
                dialyzerType2        = entity.F_DialyzerType2,
                dilutionType         = entity.F_DilutionType,
                estimateHours        = entity.F_EstimateHours,
                exchangeAmount       = entity.F_ExchangeAmount,
                exchangeSpeed        = entity.F_ExchangeSpeed,
                Hco3                 = entity.F_Hco3,
                heparinAddAmount     = entity.F_HeparinAddAmount,
                heparinAddSpeedUnit  = entity.F_HeparinAddSpeedUnit,
                heparinAmount        = entity.F_HeparinAmount,
                heparinType          = entity.F_HeparinType,
                heparinUnit          = entity.F_HeparinUnit,
                K              = entity.F_K,
                LowCa          = entity.F_LowCa,
                Na             = entity.F_Na,
                vascularAccess = entity.F_VascularAccess
            };
            data.weightSet = new WeightSet
            {
                weightYT = entity.F_WeightYT,
                weightST = entity.F_WeightST,
                weightTQ = entity.F_WeightTQ,
                weightTH = entity.F_WeightTH
            };
            var punctureRecord = await _punctureApp.GetSingle(entity.F_Pid, entity.F_VisitDate.ToDate());

            if (punctureRecord != null)
            {
                data.punctureRecord = new PunctureRecord
                {
                    point1 = punctureRecord.F_Point1,
                    point2 = punctureRecord.F_Point2
                }
            }
            ;
            //OrdersApp ordersApp = new OrdersApp();
            var orders = (await _ordersApp.GetList(entity.F_Pid, entity.F_VisitDate.ToDate(), entity.F_VisitDate.ToDate().AddDays(1), true))
                         .Where(t => t.F_OrderType.Equals("药疗")).OrderBy(t => t.F_IsTemporary).ToList();

            //医生医嘱
            foreach (var item in orders)
            {
                data.doctorOrders.Add(new DoctorOrder
                {
                    id                  = item.F_Id,
                    isTemporary         = item.F_IsTemporary,
                    orderText           = item.F_OrderText,
                    orderUnitSpec       = item.F_OrderUnitSpec,
                    orderAmount         = item.F_OrderAmount,
                    orderFrequency      = item.F_OrderFrequency,
                    orderAdministration = item.F_OrderAdministration,
                    orderStatus         = item.F_OrderStatus
                });
            }
            //护士医嘱
            //查询医嘱执行记录
            var orderExecRecord = await _ordersApp.GetPerformedOrderListJson(entity.F_Pid, entity.F_VisitDate.ToDate());

            foreach (var item in orders.Where(t => t.F_OrderStatus >= 1))
            {
                var nurserOrder = new NurserOrder
                {
                    id                  = item.F_Id,
                    isTemporary         = item.F_IsTemporary,
                    orderText           = item.F_OrderText,
                    orderUnitSpec       = item.F_OrderUnitSpec,
                    orderAmount         = item.F_OrderAmount,
                    orderFrequency      = item.F_OrderFrequency,
                    orderAdministration = item.F_OrderAdministration
                };
                var find = orderExecRecord.FirstOrDefault(t => t.F_Oid.Equals(item.F_Id));
                if (find != null)
                {
                    nurserOrder.execTime  = find.F_NurseOperatorTime;
                    nurserOrder.nurseName = find.F_Nurse;
                }
                data.nurserOrders.Add(nurserOrder);
            }
            //观察记录
            var obs = _dialysisObservationApp.GetListByVisit(entity.F_Id);

            foreach (var item in obs.OrderBy(t => t.F_NurseOperatorTime))
            {
                data.observations.Add(new Observations
                {
                    id           = item.F_Id,
                    ssy          = item.F_SSY,
                    szy          = item.F_SZY,
                    hr           = item.F_HR,
                    a            = item.F_A,
                    bf           = item.F_BF,
                    ufr          = item.F_UFR,
                    v            = item.F_V,
                    c            = item.F_C,
                    t            = item.F_T,
                    ufv          = item.F_UFV,
                    tmp          = item.F_TMP,
                    gsl          = item.F_GSL,
                    memo         = item.F_MEMO,
                    nurseName    = item.F_Nurse,
                    operatorTime = item.F_NurseOperatorTime
                });
            }
            return(Ok(data));
        }