/// <summary> /// 入院登记 /// </summary> /// <returns></returns> public HospitalizationRegisterDto HospitalizationRegister(HospitalizationRegisterParam param) { HospitalizationRegisterDto resultData = new HospitalizationRegisterDto(); // var Data = XmlHelp.DeSerializerModel(new IdentificationSpecialDownloadListDto()); var xmlStr = XmlHelp.SaveXml(param); if (xmlStr) { int result = WorkersMedicalInsurance.CallService_cxjb("CXJB002"); if (result == 1) { resultData = XmlHelp.DeSerializerModel(new HospitalizationRegisterDto()); } } return(resultData); }
/// <summary> /// 入院登记 /// </summary> /// <returns></returns> public async Task <HospitalizationRegisterDto> HospitalizationRegister(HospitalizationRegisterParam param) { return(await Task.Run(async() => { var data = new HospitalizationRegisterDto(); var xmlStr = XmlHelp.SaveXml(param); if (xmlStr) { int result = WorkersMedicalInsurance.CallService_cxjb("CXJB002"); if (result == 1) { data = XmlHelp.DeSerializerModel(new HospitalizationRegisterDto()); } else { throw new Exception("居民入院登记执行失败!!!"); } } return data; })); }
public ApiJsonResultData HospitalizationRegister(QueryInpatientInfoBasicParam param, HisBaseParam baseParam) { // 1.查询中间库当前病人是否入院 // 1.1.1如果入院直接返回查询结果 // 1.1.2如果住院病人无数据则对当前病人进行基础入院信息下载(GetInpatientInfo),再进行查询并返回结果 // 1.2 判断医保信息回写至基层系统CXJB002数据是否存在入院数据 // 1.2.1 如果已有入院登记记录(则返回已有入院记录) // 1.2.2 居民医保进行入院办理(HospitalizationRegister) // 1.2.3 更新医保人员信息 // 1.2.4 医保信息回写至基层系统CXJB002 //------------------------------- var resultData = new ApiJsonResultData(); try { //1. 1.1.1 1.1.2 var result = HttpHelp.HttpPost(Logs.ToJson(param), "QueryInpatientInfo", new QueryInpatientInfoBasicLevelDto()); if (result != null && !string.IsNullOrWhiteSpace(result.Id)) //判断是否存在 { var residentInfoParam = new ResidentInfoBasiclevelParam() { BusinessId = baseParam.BID, IdCard = result.身份证号, OrgCode = baseParam.OrgID }; // 1.2 var saveDataAllQueryData = HttpHelp.HttpPost(Logs.ToJson(residentInfoParam), "QueryMedicalInsuranceResidentInfo", new MedicalInsuranceResidentInfoBasiclevelDto()); if (saveDataAllQueryData != null && !string.IsNullOrWhiteSpace(saveDataAllQueryData.DataAllId)) //判断是否存在 { //获取社保卡信息 if (saveDataAllQueryData.DataType == "003") { //医保办理入院 //1.2.2居民医保进行入院办理(HospitalizationRegister) var dateTime = HttpHelp.HttpPost("", "GetServiceTime", new ApiJsonResultData()); var RegisterParam = new HospitalizationRegisterParam() { PI_SFBZ = param.PI_SFBZ, PI_CRBZ = param.PI_CRBZ, PI_YLLB = param.PI_YLLB, PI_TES = param.PI_TES, PI_HKXZ = param.PI_HKXZ, PI_RYRQ = Convert.ToDateTime(result.入院日期).ToString("yyyyMMdd"), PI_ICD10 = result.入院主诊断ICD10, PI_ICD10_2 = result.入院次诊断ICD10, PI_RYZD = result.入院主诊断, PI_ZYBQ = result.入院科室, PI_CWH = result.入院床位, PI_YYZYH = Convert.ToDateTime(dateTime.Data).ToString("yyyyMMddHHmmss") + baseParam.OrgID.ToString().Substring(0, 6), PI_JBR = baseParam.EmpIDCode, }; var RegisterData = Resident.HospitalizationRegister(RegisterParam); if (RegisterData.PO_FHZ == "1") { // 1.2.3 更新医保人员信息 var saveResidentInfoParam = new SaveMedicalInsuranceResidentInfoBasiclevelParam() { YbOrgCode = baseParam.YbOrgCode, BID = baseParam.YbOrgCode, BsCode = baseParam.BsCode, TransKey = baseParam.TransKey, EmpID = baseParam.EmpID, OrgID = baseParam.OrgID, BusinessId = baseParam.BID, ContentJson = Logs.ToJson(RegisterParam), ResultDatajson = Logs.ToJson(RegisterData), DataAllId = saveDataAllQueryData.DataAllId, DataId = baseParam.BID, DataType = baseParam.BsCode }; var resultSaveData = HttpHelp.HttpPost(Logs.ToJson(residentInfoParam), "SaveMedicalInsuranceResidentInfo", new ApiJsonResultData()); //1.2.4医保信息回写至基层系统CXJB002 var DataAllBasiclevelParam = new SaveXmlDataServiceParam() { YbOrgCode = baseParam.YbOrgCode, OrgID = baseParam.OrgID, BID = baseParam.BID, EmpID = baseParam.EmpID, BsCode = baseParam.BsCode, TransKey = baseParam.TransKey, Participation = Logs.ToJson(RegisterParam), ResultData = Logs.ToJson(RegisterData), BusinessNumber = "CXJB002", }; //CXJB001 存入基层 var SaveDataAll = HttpHelp.HttpPost(Logs.ToJson(DataAllBasiclevelParam), "SaveMedicalInsuranceDataAll", new ApiJsonResultData()); if (SaveDataAll.Success == false) { throw new Exception(SaveDataAll.Message); } } else { throw new Exception(RegisterData.PO_MSG); } } else { throw new Exception("BusinessId:" + saveDataAllQueryData.BusinessId + "DataType" + saveDataAllQueryData.DataType + "病人状态不正确"); } } } else { throw new Exception("IdCard:" + param.IdCard + "该病人未在基层系统中住院,请检查该病人是否离院!!!"); } } catch (Exception e) { resultData.Success = false; resultData.Message = e.Message; Logs.LogWrite(new LogParam() { //Msg = data.Po_MSG, Msg = e.Message, OperatorCode = baseParam.EmpID.ToString(), }); } return(resultData); }