/// <summary> /// 在Page中添加病程预览区 /// </summary> /// <param name="emrModel">当前需要显示的病历EmrModel</param> /// <param name="page">当前的选中的XtraTabPage</param> private void AddDailyEmrPreView(EmrModel emrModel, XtraTabPage page) { try { if (page == null || emrModel == null) { return; } if (emrModel.ModelCatalog == ContainerCatalog.BingChengJiLu) { UCEmrInputPreView inputPreView = null; if (null != emrModel.DeptChangeID && m_TempDailyPreViewCollection.ContainsKey(emrModel.DeptChangeID)) { //获取集合中的病程预览 inputPreView = m_TempDailyPreViewCollection[emrModel.DeptChangeID]; //inputPreView.Restore(); } else { //新建的病程预览加入到集合中 inputPreView = new UCEmrInputPreView(emrModel.DeptChangeID, emrModel.InstanceId.ToString()); inputPreView.Height = 0; m_TempDailyPreViewCollection.Add(emrModel.DeptChangeID, inputPreView); } if (page != null) { SplitterControl splitter = GetControlByType <SplitterControl>(page); if (splitter == null) { CurrentInputTabPages.AddSplitterControl(page); } UCEmrInputPreView preView = GetControlByType <UCEmrInputPreView>(page); if (preView == null) { CurrentInputTabPages.AddEmrInputPreView(inputPreView, page); } } } } catch (Exception) { throw; } }
/// <summary> /// 移除m_TempDailyPreViewCollection中对应的emrModel /// </summary> /// <param name="emrModel"></param> private void RemoveDailyPreViewCollection(EmrModel emrModel, XtraTabPage page) { if (emrModel != null && emrModel.ModelCatalog == ContainerCatalog.BingChengJiLu) { //获取m_TempModelPages中还存在同样科室病程的数目 int count = m_TempModelPages.Where(pair => { if (pair.Key.ModelCatalog == ContainerCatalog.BingChengJiLu && pair.Key.DeptChangeID == emrModel.DeptChangeID) { return(true); } return(false); }).Count(); if (count == 0) { m_TempDailyPreViewCollection.Remove(emrModel.DeptChangeID); var preView = m_TempDailyPreViewCollection.FirstOrDefault(p => p.Key == emrModel.DeptChangeID); CurrentInputTabPages.RemoveEmrInputPreView(preView.Value, page); } } }