/// <summary> /// 获取通用单据的详细信息 /// </summary> /// <param name="commonNoteFlow"></param> /// <returns></returns> public CommonNoteEntity GetDetailCommonNote(string commonNoteFlow) { try { CommonNoteEntity commonNoteEntity = new CommonNoteEntity(); SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@CommonNoteFlow", SqlDbType.VarChar, 50) }; sqlParams[0].Value = commonNoteFlow; DataSet dataTableElement = m_app.SqlHelper.ExecuteDataSet("EMR_CommonNote.usp_GetDetailCommonNote", sqlParams, CommandType.StoredProcedure); commonNoteEntity = DataTableToList <CommonNoteEntity> .ConvertToModelOne(dataTableElement.Tables[0]); commonNoteEntity.CommonNote_TabList = DataTableToList <CommonNote_TabEntity> .ConvertToModel(dataTableElement.Tables[1]); List <CommonNote_ItemEntity> commonNote_ItemList = new List <CommonNote_ItemEntity>(); commonNote_ItemList = DataTableToList <CommonNote_ItemEntity> .ConvertToModel(dataTableElement.Tables[2]); SetCommonNoteTabByItem(commonNoteEntity, commonNote_ItemList); SetCommonNoteSiteOne(commonNoteEntity); return(commonNoteEntity); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取打印模板的列表 /// </summary> /// <returns></returns> public List <EmrPrintTempEntity> GetPrintTempList() { string sql = @"select * from EMR_PRINTTEMP e where e.IsValide='1'"; DataTable dtPrintList = m_app.SqlHelper.ExecuteDataTable(sql, CommandType.Text); List <EmrPrintTempEntity> emrPrintTempEntityList = DataTableToList <EmrPrintTempEntity> .ConvertToModel(dtPrintList); return(emrPrintTempEntityList); }
/// <summary> /// 为单个配置单设置科室和病区 /// </summary> /// <param name="commonNoteitem"></param> private void SetCommonNoteSiteOne(CommonNoteEntity commonNoteitem) { try { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@commonnoteflow", SqlDbType.VarChar, 50) }; sqlParams[0].Value = commonNoteitem.CommonNoteFlow; DataSet dataSetSite = m_app.SqlHelper.ExecuteDataSet("EMR_CommonNote.usp_GetCommonNoteSite", sqlParams, CommandType.StoredProcedure); commonNoteitem.BaseDepartments = DataTableToList <BaseDictory> .ConvertToModel(dataSetSite.Tables[0]); commonNoteitem.BaseAreas = DataTableToList <BaseDictory> .ConvertToModel(dataSetSite.Tables[1]); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取通用配置单列表 /// </summary> /// <param name="commonNoteName"></param> /// <returns></returns> public List <CommonNoteEntity> GetSimpleCommonNote(string commonNoteName) { try { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@CommonNoteName", SqlDbType.VarChar, 50), }; sqlParams[0].Value = commonNoteName; DataTable dataTableElement = m_app.SqlHelper.ExecuteDataTable("EMR_CommonNote.usp_GetSimpleCommonNote", sqlParams, CommandType.StoredProcedure); List <CommonNoteEntity> commonNoteList = DataTableToList <CommonNoteEntity> .ConvertToModel(dataTableElement); SetSimpleCommonNoteSite(commonNoteList); return(commonNoteList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取当前科室或病区的所有配置单据 type 01科室 02病区 /// </summary> /// <returns></returns> public List <CommonNoteEntity> GetCommonNoteByDeptWard(string deptorwardCode, string type) { try { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@SiteCode", SqlDbType.VarChar, 50), new SqlParameter("@Type", SqlDbType.VarChar, 50) }; sqlParams[0].Value = deptorwardCode; sqlParams[1].Value = type; DataTable commonNoteDT = m_app.SqlHelper.ExecuteDataTable("EMR_CommonNote.usp_GetCommonNoteForDeptWard", sqlParams, CommandType.StoredProcedure); List <CommonNoteEntity> commonNoteList = DataTableToList <CommonNoteEntity> .ConvertToModel(commonNoteDT); return(commonNoteList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 获取所有科室和病区 只有id和name /// </summary> /// <returns></returns> public Dictionary <string, List <BaseDictory> > GetAllDepartAndAreas() { try { string sqlDeptAll = @"select de.id, de.name from department de where de.valid = '1' and de.sort='101'"; string sqlWardAll = @" select ward.id, ward.name from ward where ward.valid = '1'"; DataTable dtDepts = m_app.SqlHelper.ExecuteDataTable(sqlDeptAll, CommandType.Text); DataTable dtWards = m_app.SqlHelper.ExecuteDataTable(sqlWardAll, CommandType.Text); Dictionary <string, List <BaseDictory> > basedictoryList = new Dictionary <string, List <BaseDictory> >(); List <BaseDictory> baseDepart = DataTableToList <BaseDictory> .ConvertToModel(dtDepts); basedictoryList.Add("01", baseDepart); List <BaseDictory> baseAreas = DataTableToList <BaseDictory> .ConvertToModel(dtWards); basedictoryList.Add("02", baseAreas); return(basedictoryList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 根据条件获取数据元 用于展示 /// </summary> /// <param name="dataElementSearch"></param> /// <returns></returns> public List <DataElementEntity> GetDataElement(DataElementEntity dataElementSearch) { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@ElementId", SqlDbType.VarChar, 50), new SqlParameter("@ElementName", SqlDbType.VarChar, 50), new SqlParameter("@ElementClass", SqlDbType.VarChar, 50), new SqlParameter("@ElementPYM", SqlDbType.VarChar, 50) }; if (dataElementSearch.ElementPYM == null) { dataElementSearch.ElementPYM = ""; } dataElementSearch.ElementPYM = dataElementSearch.ElementPYM.ToUpper(); sqlParams[0].Value = dataElementSearch.ElementId; sqlParams[1].Value = dataElementSearch.ElementName; sqlParams[2].Value = dataElementSearch.ElementClass; sqlParams[3].Value = dataElementSearch.ElementPYM; DataTable dataTableElement = m_app.SqlHelper.ExecuteDataTable("EMR_CommonNote.usp_GetDateElement", sqlParams, CommandType.StoredProcedure); List <DataElementEntity> dataElementEntityList = DataTableToList <DataElementEntity> .ConvertToModel(dataTableElement); ConvertIsDataElementPropery(dataElementEntityList, 1); ConvertDataElemnetClass(dataElementEntityList, 1); return(dataElementEntityList); }