private List <KeyValue> GetFieldNames(string tableName) { List <KeyValue> list = new List <KeyValue>(); DataTable dataTable = new DataTable(); if (tableName.ToUpper().Trim().Equals("MED_OPERATION_MASTER")) { MED_OPERATION_MASTER master = new MED_OPERATION_MASTER(); foreach (string column in master.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_MASTER_EXT")) { MED_OPERATION_MASTER_EXT ext = new MED_OPERATION_MASTER_EXT(); foreach (string column in ext.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PAT_MASTER_INDEX")) { MED_PAT_MASTER_INDEX tmp = new MED_PAT_MASTER_INDEX(); foreach (string column in tmp.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PATS_IN_HOSPITAL")) { MED_PATS_IN_HOSPITAL pats = new MED_PATS_IN_HOSPITAL(); foreach (string column in pats.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_RECOVER")) { MED_ANESTHESIA_RECOVER tmp = new MED_ANESTHESIA_RECOVER(); foreach (string column in tmp.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_INQUIRY")) { MED_ANESTHESIA_INQUIRY tmp = new MED_ANESTHESIA_INQUIRY(); foreach (string column in tmp.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_SAFETY_CHECKS")) { MED_SAFETY_CHECKS safety = new MED_SAFETY_CHECKS(); foreach (string column in safety.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PAT_VISIT")) { MED_PAT_VISIT visit = new MED_PAT_VISIT(); foreach (string column in visit.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_PLAN")) { MED_ANESTHESIA_PLAN plan = new MED_ANESTHESIA_PLAN(); foreach (string column in plan.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_PLAN_EXAM")) { MED_ANESTHESIA_PLAN_EXAM plan = new MED_ANESTHESIA_PLAN_EXAM(); foreach (string column in plan.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_PLAN_PMH")) { MED_ANESTHESIA_PLAN_PMH plan = new MED_ANESTHESIA_PLAN_PMH(); foreach (string column in plan.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_HIS_USERS")) { MED_HIS_USERS users = new MED_HIS_USERS(); foreach (string column in users.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_DEPT_DICT")) { MED_DEPT_DICT dept = new MED_DEPT_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_DIAGNOSIS_DICT")) { MED_DIAGNOSIS_DICT dept = new MED_DIAGNOSIS_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_DICT")) { MED_OPERATION_DICT dept = new MED_OPERATION_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_DICT")) { MED_ANESTHESIA_DICT dept = new MED_ANESTHESIA_DICT(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATING_ROOM")) { MED_OPERATING_ROOM dept = new MED_OPERATING_ROOM(); foreach (string column in dept.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PREOPERATIVE_EXPANSION")) { MED_PREOPERATIVE_EXPANSION row = new MED_PREOPERATIVE_EXPANSION(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_EXTENDED")) { MED_OPERATION_EXTENDED row = new MED_OPERATION_EXTENDED(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_POSTOPERATIVE_EXTENDED")) { MED_POSTOPERATIVE_EXTENDED row = new MED_POSTOPERATIVE_EXTENDED(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_PACU_SORCE")) { MED_PACU_SORCE row = new MED_PACU_SORCE(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPERATION_ANALGESIC_MASTER")) { MED_OPERATION_ANALGESIC_MASTER row = new MED_OPERATION_ANALGESIC_MASTER(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPER_ANALGESIC_MEDICINE")) { MED_OPER_ANALGESIC_MEDICINE row = new MED_OPER_ANALGESIC_MEDICINE(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPER_ANALGESIC_TOTAL")) { MED_OPER_ANALGESIC_TOTAL row = new MED_OPER_ANALGESIC_TOTAL(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_OPER_RISK_ESTIMATE")) { MED_OPER_RISK_ESTIMATE row = new MED_OPER_RISK_ESTIMATE(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_INPUT_DICT")) { MED_ANESTHESIA_INPUT_DICT row = new MED_ANESTHESIA_INPUT_DICT(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } else if (tableName.ToUpper().Trim().Equals("MED_ANESTHESIA_INPUT_DATA")) { MED_ANESTHESIA_INPUT_DATA row = new MED_ANESTHESIA_INPUT_DATA(); foreach (string column in row.GetPropsName()) { list.Add(new KeyValue(GetFieldAlias(column), column)); } } if (!string.IsNullOrEmpty(_tableName)) { foreach (DataRow row in dataTable.Rows) { list.Add(new KeyValue(row[_codeField].ToString(), row[_nameField].ToString())); } } else { foreach (DataColumn column in dataTable.Columns) { list.Add(new KeyValue(GetFieldAlias(column.ColumnName), column.ColumnName)); } } return(list); }
private void SyncPatientByPatientId(string patientID) { if (!string.IsNullOrEmpty(patientID)) { if (ExtendApplicationContext.Current.IsSync) { string ret = ""; ret = syncInfoRepository.SyncPatientInfoAndInHospital(patientID).Data; ret += syncInfoRepository.SyncScheduleInfo(patientID, accountRepository.GetServerTime().Data).Data; if (!string.IsNullOrEmpty(ret)) { MessageBoxFormPC.Show(ret); } } } bool flag = true; if (patientID != "") { patMasterIndex = operationInfoRepository.GetPatMasterIndex(patientID).Data; MED_PATS_IN_HOSPITAL patsInHospital = null; if (patMasterIndex == null) { patsInHospital = operationInfoRepository.GetPatsInHospital(patientID).Data; if (patsInHospital != null) { patientID = patsInHospital.PATIENT_ID; patMasterIndex = operationInfoRepository.GetPatMasterIndex(patientID).Data; } } List <MED_PAT_VISIT> patVisitList = operationInfoRepository.GetPatVisitList(patientID).Data; if (patVisitList != null && patVisitList.Count > 0) { flag = flag & false; patVisit = patVisitList[0]; _visitID = Convert.ToInt32(patVisitList[0].GetValue("VISIT_ID")); } else { flag = flag & true; patVisit = new MED_PAT_VISIT(); _visitID = 1; patVisit.SetValue("PATIENT_ID", patientID); } if (patMasterIndex == null) { flag = flag & true; patMasterIndex = new MED_PAT_MASTER_INDEX(); patMasterIndex.SetValue("PATIENT_ID", patientID); MessageBoxFormPC.Show("当前输入患者ID,需要手动输入患者信息进行急诊登记", "系统提示"); // return; } List <MED_OPERATION_MASTER> operMasterList = operationInfoRepository.GetOperMasterList(patientID, _visitID).Data; if (operMasterList != null && operMasterList.Count > 0) { _operID = Convert.ToInt32(operMasterList[0].GetValue("OPER_ID")) + 1; } operationMaster = new MED_OPERATION_MASTER(); operationMaster.PATIENT_ID = patientID; operationMaster.VISIT_ID = _visitID; operationMaster.OPER_ID = _operID; operationMaster.OPER_ROOM = ExtendApplicationContext.Current.OperRoom; operationMaster.OPER_ROOM_NO = ExtendApplicationContext.Current.OperRoomNo; operationMaster.HOSP_BRANCH = ExtendApplicationContext.Current.HospBranchCode; operationMaster.SCHEDULED_DATE_TIME = accountRepository.GetServerTime().Data; if (patsInHospital != null) { patVisit.INP_NO = patsInHospital.INP_NO; operationMaster.WARD_CODE = patsInHospital.WARD_CODE; operationMaster.DEPT_CODE = patsInHospital.WARD_CODE; operationMaster.BED_NO = patsInHospital.BED_NO; } else { patsInHospital = operationInfoRepository.GetPatsInHospitalByID(patientID, _visitID).Data; patVisit.INP_NO = patsInHospital.INP_NO; operationMaster.WARD_CODE = patsInHospital.WARD_CODE; operationMaster.DEPT_CODE = patsInHospital.WARD_CODE; operationMaster.BED_NO = patsInHospital.BED_NO; } ExtendApplicationContext.Current.MED_PAT_MASTER_INDEX = patMasterIndex; ExtendApplicationContext.Current.MED_OPERATION_MASTER = operationMaster; ExtendApplicationContext.Current.MED_PAT_VISIT = patVisit; anesPlan = new DocDataRepository().GetAnesthesiaPlan(_patientID, _visitID, _operID); _patientCard = new MED_PATIENT_CARD(); foreach (string column in _patientCard.GetPropsName()) { foreach (string col in patMasterIndex.GetPropsName()) { if (column == col) { _patientCard.SetValue(column, patMasterIndex.GetValue(col)); } } foreach (string col in operationMaster.GetPropsName()) { if (column == col) { _patientCard.SetValue(column, operationMaster.GetValue(col)); } } foreach (string col in patVisit.GetPropsName()) { if (column == col) { _patientCard.SetValue(column, patVisit.GetValue(col)); } } } } }