|
@ -407,122 +407,7 @@ public class HealthCareService {
|
|
|
if (outpatientDO == null){
|
|
|
throw new Exception("门诊信息不存在");
|
|
|
}
|
|
|
BasePatientDO patientDO = patientDao.findById(outpatientDO.getPatient());
|
|
|
if(patientDO == null){
|
|
|
throw new Exception("居民不存在");
|
|
|
}
|
|
|
JSONObject data = new JSONObject();
|
|
|
data.put("his_serial",outpatientDO.getRegisterNo());//HIS 门诊挂号号
|
|
|
data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保门诊挂号流水号
|
|
|
data.put("order_id","");//订单号 String Y
|
|
|
|
|
|
data.put("medical_mode","");//就诊类型 String Y
|
|
|
data.put("prescription_code",wlyyPrescriptionDO.getRealOrder());//医院处方编号
|
|
|
data.put("region_code","");//参保地区划代码 String Y
|
|
|
data.put("name",patientDO.getName());//姓名
|
|
|
data.put("idcard",patientDO.getIdcard());//证件号码
|
|
|
data.put("cert_type","01");//证件类型
|
|
|
String sex = IdCardUtil.getSexForIdcard_new(patientDO.getIdcard(),patientDO.getSex());
|
|
|
if("3".equals(sex)){
|
|
|
sex = "9";
|
|
|
}
|
|
|
data.put("sex",sex);//性别 String Y
|
|
|
String birth = IdCardUtil.getBirthdayForIdcardStr(patientDO.getIdcard(),patientDO.getBirthday());
|
|
|
if(StringUtils.isBlank(birth)){
|
|
|
throw new Exception("事前提醒失败:居民生日信息有误");
|
|
|
}
|
|
|
data.put("birth",birth);//出生日期 String Y
|
|
|
data.put("phone",patientDO.getMobile());//用户手机号
|
|
|
data.put("medical_type","11");//医疗类别 String Y
|
|
|
data.put("medical_type_name","普通门诊");//医疗类别 String Y
|
|
|
// data.put("insurance_ticket_no","");//诊查费结算后的收费单据号 String N
|
|
|
data.put("medical_time",DateUtil.dateToStr(outpatientDO.getCreateTime(),DateUtil.YYYY_MM_DD_HH_MM_SS));//特殊门诊病情编码 String Y
|
|
|
data.put("disease_code","");//特殊门诊病情编码 String Y
|
|
|
|
|
|
String doctorId = outpatientDO.getDoctor();
|
|
|
BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
|
|
|
if(doctorDO == null){
|
|
|
throw new Exception("事前提醒失败:医生不存在");
|
|
|
}
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId);
|
|
|
if(doctorHospitalDOS.size()<=0){
|
|
|
throw new Exception("事前提醒失败:未找到医生科室编码");
|
|
|
}
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorId);
|
|
|
if(doctorMappingDO == null){
|
|
|
throw new Exception("事前提醒失败:未找到医生his编码");
|
|
|
}
|
|
|
data.put("dept_code",doctorHospitalDO.getDeptCode());//科室代码
|
|
|
data.put("dept_name",doctorHospitalDO.getDeptName());//科室名称
|
|
|
data.put("doctor_code",doctorMappingDO.getMappingCode());//医师编号
|
|
|
data.put("doctor_name",doctorDO.getName());//医生名称
|
|
|
data.put("doctor_idcard",doctorDO.getIdcard());//医师身份证号
|
|
|
|
|
|
/* pharmacist_code 医院药师证件号码 String N
|
|
|
pharmacist_name 医院药师姓名 String N
|
|
|
pharmacist_audit_date 医院药师处方审核时间 String N
|
|
|
prescription _valid_date 处方过期时间 String N
|
|
|
prescription_type_code 处方类别编号 String N
|
|
|
tcm_nums 中药剂数 String N
|
|
|
tcm_method_code 中药药品用法编号 String N
|
|
|
tcm_method_name 中药药品用法名称 String N
|
|
|
tcm_freq_code 中药频次编号 String N
|
|
|
tcm_freq_name 中药频次名称 String N*/
|
|
|
|
|
|
data.put("prescription_date", DateUtil.dateToStr(outpatientDO.getCreateTime(),DateUtil.YYYY_MM_DD));//处方日期
|
|
|
data.put("prescription_counts","1");//处方项目数
|
|
|
data.put("prescription_source","");//处方来源 String Y 0:非外配处方;1:外配处方
|
|
|
|
|
|
//诊断
|
|
|
JSONArray zdlist = new JSONArray();
|
|
|
String icd10 = outpatientDO.getIcd10();
|
|
|
String icd10Name = outpatientDO.getIcd10Name();
|
|
|
String icd10sz[] = icd10.split(",");
|
|
|
String icd10Namesz[] = icd10Name.split(",");
|
|
|
for (int i=0;i<icd10sz.length;i++){
|
|
|
JSONObject zd = new JSONObject();
|
|
|
zd.put("disease_code_icd10",icd10sz[i].trim());//诊断或症状编码 String Y 见icd-10或症状表编码
|
|
|
zd.put("disease_name_icd10",icd10Namesz[i].trim());//诊断或症状名称 String Y 见icd-10或症状表名称
|
|
|
zd.put("disease_type","");//诊断或症状类型 String Y 参见编码附件
|
|
|
zd.put("disease_order","");//诊断或症状序号 String Y 参见编码附件
|
|
|
}
|
|
|
data.put("zdlist",zdlist);
|
|
|
|
|
|
//医嘱明细
|
|
|
JSONArray mxlist = new JSONArray();
|
|
|
List<WlyyPrescriptionInfoDO> prescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
|
|
|
for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:prescriptionInfoDOS){
|
|
|
JSONObject infoObj = new JSONObject();
|
|
|
infoObj.put("catalog_item","");//社保三大目录统一编码 String Y
|
|
|
infoObj.put("his_item_name",wlyyPrescriptionInfoDO.getDrugName());//HIS院内项目名称
|
|
|
infoObj.put("his_item_code",wlyyPrescriptionInfoDO.getDrugNo());//HIS院内项目编码
|
|
|
infoObj.put("item_name","");//医保项目名称
|
|
|
infoObj.put("item_code","");//医保项目编码
|
|
|
infoObj.put("prescription_code",wlyyPrescriptionDO.getRealOrder());//医院处方编号
|
|
|
infoObj.put("his_detail_sn","");//his处方明细流水号
|
|
|
infoObj.put("his_drug_no",wlyyPrescriptionInfoDO.getDrugNo());//院内药品编码
|
|
|
infoObj.put("invoice_type","");//发票项目类别
|
|
|
infoObj.put("specification_type",wlyyPrescriptionInfoDO.getSpecification());//规格型号
|
|
|
infoObj.put("dosage_form",wlyyPrescriptionInfoDO.getDosage());//剂型
|
|
|
infoObj.put("charge_unit","");//单位
|
|
|
infoObj.put("price",wlyyPrescriptionInfoDO.getPackRetprice());//单价
|
|
|
infoObj.put("amount",wlyyPrescriptionInfoDO.getQuantity());//数量
|
|
|
infoObj.put("total_money",wlyyPrescriptionInfoDO.getPackRetprice()*Integer.parseInt(wlyyPrescriptionInfoDO.getQuantity()));//金额
|
|
|
infoObj.put("single_dose",wlyyPrescriptionInfoDO.getDosage());//每次用量
|
|
|
infoObj.put("use_frequency",wlyyPrescriptionInfoDO.getUsageName());//使用频次
|
|
|
infoObj.put("medical_way","");//给药途径
|
|
|
|
|
|
infoObj.put("prescription_date", DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime()));//处方日期
|
|
|
infoObj.put("medication_days",wlyyPrescriptionInfoDO.getDays());//执行天数
|
|
|
infoObj.put("his_dept_code",wlyyPrescriptionDO.getDept());//his内部科室编码
|
|
|
infoObj.put("his_dept_name",wlyyPrescriptionDO.getDeptName());//his内部科室名称
|
|
|
infoObj.put("limit_type","");//限制范围类别
|
|
|
mxlist.add(infoObj);
|
|
|
}
|
|
|
|
|
|
data.put("mxlist",mxlist);
|
|
|
|
|
|
String result = requestYlz(data,"N20.17.03.01","医师开方上传");
|
|
|
if(result == null){
|