Esempio n. 1
0
        /// <summary>
        /// 获取麻醉单血气记录
        /// </summary>
        /// <param name="patientID"></param>
        /// <param name="visitID"></param>
        /// <param name="operID"></param>
        /// <returns></returns>
        public List <BloodGasMaster> GetBloodGasItems(string patientID, int visitID, int operID)
        {
            List <BloodGasMaster> list = new List <BloodGasMaster>();

            string[] detailList = ExtendApplicationContext.Current.DefaultBloodGasItem.ToArray();
            List <MED_BLOOD_GAS_MASTER> bloodGasMasterDataTable = operationInfoRepository.GetBloodGasMasterList(patientID, visitID, operID).Data;

            if (bloodGasMasterDataTable != null && bloodGasMasterDataTable.Count > 0)
            {
                List <MED_BLOOD_GAS_DETAIL> bloodGasDetailDataTable = null;
                bloodGasMasterDataTable.ForEach(row =>
                {
                    if (null == row.NURSE_MEMO2 || string.IsNullOrEmpty(row.NURSE_MEMO2))
                    {
                        string typeName = "静脉";
                        if (!string.IsNullOrEmpty(row.NURSE_MEMO1))
                        {
                            typeName = row.NURSE_MEMO1;
                        }
                        else
                        {
                            typeName = "静脉";
                        }
                        BloodGasMaster item     = new BloodGasMaster();
                        item.DetailId           = row.DETAIL_ID;
                        item.DisplayName        = typeName + "血气";
                        item.Recorddate         = row.RECORD_DATE;
                        bloodGasDetailDataTable = operationInfoRepository.GetBloodGasDetailList(row.DETAIL_ID).Data;
                        if (bloodGasDetailDataTable != null && bloodGasDetailDataTable.Count > 0)
                        {
                            bloodGasDetailDataTable.ForEach(gasRow =>
                            {
                                BloodGasDetail detail = null;
                                detail               = new BloodGasDetail();
                                detail.DetailId      = gasRow.DETAIL_ID;
                                detail.BloodGasCode  = gasRow.BLG_CODE;
                                detail.BloodGasValue = !string.IsNullOrEmpty(gasRow.BLG_VALUE) ? gasRow.BLG_VALUE : "";
                                item.Details.Add(detail);
                            });
                        }
                        list.Add(item);
                    }
                });
            }
            if (list.Count > 0)
            {
                foreach (BloodGasMaster item in list)
                {
                    foreach (BloodGasDetail detail in item.Details)
                    {
                        if (ExtendApplicationContext.Current.BloodGasItemDict.ContainsKey(detail.BloodGasCode))
                        {
                            detail.BloodGasName = ExtendApplicationContext.Current.BloodGasItemDict[detail.BloodGasCode];
                        }
                    }
                }
            }
            return(list);
        }
Esempio n. 2
0
        private void resetListView()
        {
            btnOK.Enabled = false;
            listView1.Items.Clear();
            listView2.Items.Clear();
            List <BloodGasMaster>       leftBloodGasMasters     = new List <BloodGasMaster>();
            List <BloodGasMaster>       rightBloodGasMasters    = new List <BloodGasMaster>();
            List <MED_BLOOD_GAS_MASTER> bloodGasMasterDataTable = operationInfoRepository.GetBloodGasMasterAllList().Data;

            if (bloodGasMasterDataTable.Count > 0)
            {
                bloodGasMasterDataTable = bloodGasMasterDataTable.Where(x => x.RECORD_DATE >= dateEdit1.DateTime && x.RECORD_DATE < dateEdit1.DateTime.AddDays(1)).ToList();
            }
            if (bloodGasMasterDataTable != null && bloodGasMasterDataTable.Count > 0)
            {
                BloodGasMaster bloodGasMaster;
                foreach (MED_BLOOD_GAS_MASTER row in bloodGasMasterDataTable)
                {
                    if (!string.IsNullOrEmpty(row.PATIENT_ID) && row.PATIENT_ID == _patientID && row.VISIT_ID == _visitID && row.OPER_ID == _operID)
                    {
                        bloodGasMaster             = new BloodGasMaster();
                        bloodGasMaster.DisplayName = GetDisplayName(row);
                        bloodGasMaster.Recorddate  = row.RECORD_DATE;
                        bloodGasMaster.DetailId    = row.DETAIL_ID;
                        leftBloodGasMasters.Add(bloodGasMaster);
                    }
                    else if (string.IsNullOrEmpty(row.PATIENT_ID) || (row.PATIENT_ID == "0" && row.VISIT_ID == 0))
                    {
                        bloodGasMaster             = new BloodGasMaster();
                        bloodGasMaster.DisplayName = GetDisplayName(row);
                        bloodGasMaster.Recorddate  = row.RECORD_DATE;
                        bloodGasMaster.DetailId    = row.DETAIL_ID;
                        rightBloodGasMasters.Add(bloodGasMaster);
                    }
                }
                leftBloodGasMasters.Sort(new Comparison <BloodGasMaster>(delegate(BloodGasMaster bloodGasMaster1, BloodGasMaster bloodGasMaster2)
                {
                    return(bloodGasMaster1.Recorddate.CompareTo(bloodGasMaster2.Recorddate));
                }));
                rightBloodGasMasters.Sort(new Comparison <BloodGasMaster>(delegate(BloodGasMaster bloodGasMaster1, BloodGasMaster bloodGasMaster2)
                {
                    return(bloodGasMaster1.Recorddate.CompareTo(bloodGasMaster2.Recorddate));
                }));
                ListViewItem item;
                foreach (BloodGasMaster blgMaster in leftBloodGasMasters)
                {
                    item             = listView1.Items.Add(blgMaster.Recorddate.ToString());
                    item.Tag         = blgMaster.DetailId;
                    item.ToolTipText = blgMaster.DisplayName;
                }
                foreach (BloodGasMaster blgMaster in rightBloodGasMasters)
                {
                    item             = listView2.Items.Add(blgMaster.Recorddate.ToString());
                    item.Tag         = blgMaster.DetailId;
                    item.ToolTipText = blgMaster.DisplayName;
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获取麻醉单血气记录,修改数据另存
        /// </summary>
        public List <BloodGasMaster> GetBloodGasItems(string patientID, int visitID, int operID)
        {
            List <BloodGasMaster>     list         = new List <BloodGasMaster>();
            List <MED_BLOOD_GAS_DICT> bloodGasDict = ApplicationModel.Instance.AllDictList.BloodGasDictList;

            string[] detailList = ExtendAppContext.Current.DefaultBloodGasItem.ToArray();
            List <MED_BLOOD_GAS_MASTER> bloodGasMasterDataTable = AnesInfoService.ClientInstance.GetBloodGasMasterList(patientID, visitID, operID);

            if (bloodGasMasterDataTable != null && bloodGasMasterDataTable.Count > 0)
            {
                List <MED_BLOOD_GAS_DETAIL_SHOW> bloodGasDetailDataTable = null;
                bloodGasMasterDataTable.ForEach(row =>
                {
                    if (!string.IsNullOrEmpty(row.NURSE_MEMO2) && row.NURSE_MEMO2.StartsWith("ok@"))
                    {
                        string typeName = "静脉";
                        if (!string.IsNullOrEmpty(row.NURSE_MEMO1))
                        {
                            typeName = row.NURSE_MEMO1;
                        }

                        BloodGasMaster item = new BloodGasMaster();
                        item.DetailId       = row.DETAIL_ID;
                        item.DisplayName    = typeName + "血气";
                        item.Recorddate     = row.RECORD_DATE;
                        //bloodGasDetailDataTable = AnesInfoService.ClientInstance.GetBloodGasDetailList(row.DETAIL_ID);
                        bloodGasDetailDataTable = this.GetDetailShowList(row.DETAIL_ID);
                        if (bloodGasDetailDataTable != null && bloodGasDetailDataTable.Count > 0)
                        {
                            bloodGasDetailDataTable.ForEach(detailRow =>
                            {
                                if (!string.IsNullOrEmpty(detailRow.BLG_VALUE))
                                {
                                    //foreach (var bloodGasDictItem in bloodGasDict)
                                    //{
                                    //MED_BLOOD_GAS_DETAIL tmpItem = bloodGasDetailDataTable.Find(x => x.BLG_CODE == bloodGasDictItem.BLG_CODE);
                                    //if (bloodGasDictItem != null && !string.IsNullOrEmpty(tmpItem.BLG_VALUE))
                                    //{
                                    BloodGasDetail detail = null;
                                    detail               = new BloodGasDetail();
                                    detail.DetailId      = detailRow.DETAIL_ID;
                                    detail.BloodGasCode  = detailRow.BLG_CODE;
                                    detail.BloodGasValue = !string.IsNullOrEmpty(detailRow.BLG_VALUE) ? detailRow.BLG_VALUE : "";
                                    item.Details.Add(detail);
                                }
                            });
                        }

                        list.Add(item);
                    }
                });
            }

            if (list.Count > 0)
            {
                foreach (BloodGasMaster item in list)
                {
                    foreach (BloodGasDetail detail in item.Details)
                    {
                        if (ExtendAppContext.Current.BloodGasItemDict.ContainsKey(detail.BloodGasCode))
                        {
                            detail.BloodGasName = ExtendAppContext.Current.BloodGasItemDict[detail.BloodGasCode];
                        }
                    }
                }
            }

            return(list);
        }