/// <summary> /// 住院正式结算 /// </summary> /// <returns></returns> public static CompResult OutZYPatientCharge(PatientComp hisData) { string strParameter = Newtonsoft.Json.JavaScriptConvert.SerializeObject(hisData); Message recieveMsg = new Message(); recieveMsg.DES = false; recieveMsg.GZipCompress = false; recieveMsg.dataContent = strParameter; Message retMsg = new Message(); try { retMsg = ncmsInterface.patientComp(recieveMsg); if (retMsg.DES) { retMsg.dataContent = NccmFunction.decrypt(retMsg.dataContent, sKey); } if (retMsg.GZipCompress) { retMsg.dataContent = NccmFunction.gZipDeCompress(retMsg.dataContent); } Type type = typeof(CompResult); CompResult result = (CompResult)Newtonsoft.Json.JavaScriptConvert.DeserializeObject(retMsg.dataContent, type); return(result); } catch (Exception err) { throw err; } }
/// <summary> /// 出院结算 /// </summary> /// <param name="hashtable"></param> /// <returns></returns> public object Charge(System.Collections.Hashtable hashtable) { FeeDetail[] prescriptions = (FeeDetail[])hashtable["FeeDetail"]; string Is_midWay = hashtable["midWay"].ToString(); string Nccm_NO = hashtable["Nccm_NO"].ToString(); ZY_PresOrder zypo = new ZY_PresOrder(); int[] presID = new int[prescriptions.Length]; for (int i = 0; i < prescriptions.Length; i++) { presID[i] = Convert.ToInt32(prescriptions[i].item_sn); } zypo.UpdateComp(presID);//更新为上传标识 PatientComp patComp = new PatientComp(); patComp.uploadorg = "1"; DataClass dataClass = new DataClass(); dataClass.dataClassValue = "2";//门诊是1,住院是2 patComp.dataClass = dataClass; JoinArea joinArea = new JoinArea(); joinArea.code = JOIN_AREA_CODE; joinArea.name = JOIN_AREA_NAME; patComp.joinArea = joinArea; DataType dataType = new DataType(); dataType.dataTypeName = "门诊数据"; dataType.dataTypeValue = "2"; patComp.dataType = dataType; ZyPatBaseData zyPat = new ZyPatBaseData(); zyPat.area_id = JOIN_AREA_CODE; zyPat.medorg_code = MED_ORG_CODE; zyPat.hisID = zyPatlist.Nccm_NO;//zyPatlist.CureNo + zyPatlist.PatListID.ToString(); zyPat.his_billno = Nccm_NO; zyPat.person_code = zyPatlist.patientInfo.PatCode; zyPat.name = zyPatlist.patientInfo.PatName; zyPat.sex = zyPatlist.patientInfo.PatSex == "男" ? "1" : "2"; zyPat.idCard = zyPatlist.patientInfo.PatNumber; zyPat.family_code = zyPatlist.patientInfo.FamilyCode; zyPat.medcard_id = zyPatlist.patientInfo.MediCard; zyPat.medorg_level = ((HospitalInfo)hospitalInfo).hos_level; zyPat.is_midway = Is_midWay; //1,中途2出院 zyPat.visit_type = "2"; zyPat.comp_classs = "2"; //? zyPat.adm_date = zyPatlist.CureDate.ToString(); //入院日期 zyPat.status = zyPatlist.CureState; //? zyPat.maindiag_code = zyPatlist.DiseaseCode; zyPat.dis_date = zyPatlist.OutDate.ToString(); patComp.zyPat = zyPat; patComp.zyDetail = prescriptions; patComp.uploadorg = MED_ORG_CODE; CompResult CR = NccmInterfaces.OutZYPatientCharge(patComp); if (CR.resultId) { prescriptions = CR.feeDetail; presID = new int[prescriptions.Length]; for (int i = 0; i < prescriptions.Length; i++) { presID[i] = Convert.ToInt32(prescriptions[i].item_sn); } zypo.DelComp(presID);//更新上传失败的项目 return(Convert.ToDecimal(CR.compData[0].comp_money)); } else { throw new Exception("农合接口调用失败:" + CR.resultString); } }
/// <summary> /// 出院预算 /// </summary> /// <param name="hashtable"></param> /// <returns></returns> public object PreviewCharge(System.Collections.Hashtable hashtable) { FeeDetail[] prescriptions = (FeeDetail[])hashtable["FeeDetail"]; string Is_midWay = hashtable["midWay"].ToString(); PatientComp patComp = new PatientComp(); patComp.uploadorg = "1"; DataClass dataClass = new DataClass(); dataClass.dataClassValue = "2"; patComp.dataClass = dataClass; JoinArea joinArea = new JoinArea(); joinArea.code = JOIN_AREA_CODE; joinArea.name = JOIN_AREA_NAME; patComp.joinArea = joinArea; DataType dataType = new DataType(); dataType.dataTypeName = "住院数据"; dataType.dataTypeValue = "2"; patComp.dataType = dataType; ZyPatBaseData zyPat = new ZyPatBaseData(); zyPat.hisID = zyPatlist.Nccm_NO; zyPat.area_id = JOIN_AREA_CODE; zyPat.medorg_code = MED_ORG_CODE; zyPat.person_code = zyPatlist.patientInfo.PatCode; zyPat.name = zyPatlist.patientInfo.PatName; zyPat.sex = zyPatlist.patientInfo.PatSex == "男" ? "1" : "2"; zyPat.idCard = zyPatlist.patientInfo.PatNumber; zyPat.family_code = zyPatlist.patientInfo.FamilyCode; zyPat.medcard_id = zyPatlist.patientInfo.MediCard; zyPat.medorg_level = ((HospitalInfo)hospitalInfo).hos_level; zyPat.visit_type = "2"; zyPat.comp_classs = "2"; //?住院2 zyPat.adm_date = zyPatlist.CureDate.ToString(); //入院日期 zyPat.status = "1"; //(未补)//zyPatlist.CureState;//? zyPat.maindiag_code = zyPatlist.DiseaseCode; zyPat.dis_date = DateTime.Now.ToString(); zyPat.is_midway = "1";//1,中途结算.2,出院结算 patComp.zyPat = zyPat; patComp.zyDetail = prescriptions; patComp.uploadorg = MED_ORG_CODE; //调用接口预算功能 CompResult compresult = NccmInterfaces.OutZYPatientBudegt(patComp); if (compresult.resultId) { return(Convert.ToDecimal(compresult.compData[0].comp_money)); } else { throw new Exception("农合接口调用失败:" + compresult.resultString); } }