Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

LAPTOP-KB9HII50\70708 3 năm trước cách đây
mục cha
commit
bb9c66bf9f

+ 158 - 81
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -42,6 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -300,7 +301,7 @@ public class HealthCareService {
            throw new Exception("事前提醒失败:居民生日信息有误");
        }
        data.put("birth",birth);//出生日期 	String	Y
        data.put("medical_type","");//医疗类别	String	Y
        data.put("medical_type","11");//医疗类别	String	Y
        data.put("ticket_no","");//单据流水号	String	Y
        data.put("disease_code","");//特殊门诊病情编码	String	Y
@ -432,8 +433,8 @@ public class HealthCareService {
        }
        data.put("birth",birth);//出生日期 	String	Y
        data.put("phone",patientDO.getMobile());//用户手机号
        data.put("medical_type","");//医疗类别	String	Y
        data.put("medical_type_name","");//医疗类别	String	Y
        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
@ -937,7 +938,7 @@ public class HealthCareService {
            throw new Exception("患者his信息不存在");
        }
        JSONObject data = new JSONObject();
        data.put("service_id","N20.17.01.01");
        data.put("service_id","10000");
        data.put("name",patientDO.getName());
        data.put("idcard",patientDO.getIdcard());
        data.put("cert_type","01");//TODO
@ -970,7 +971,7 @@ public class HealthCareService {
            throw new Exception("患者his信息不存在");
        }
        JSONObject data = new JSONObject();
        data.put("service_id","N20.17.01.01");
        data.put("service_id","10000");
        data.put("name",patientDO.getName());
        data.put("idcard",patientDO.getIdcard());
        data.put("cert_type","01");//TODO
@ -998,19 +999,19 @@ public class HealthCareService {
            throw new Exception("上传医保失败:门诊为空!");
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("cert_type","01");//证件类型
        data.put("medical_mode","");//医疗就诊方式
        data.put("medical_type","");//医疗类别
        data.put("medical_mode","10");//医疗就诊方式
        data.put("medical_type","11");//医疗类别
        data.put("his_serial",outpatientDO.getRegisterNo());//his流水号
        data.put("his_dept_code",outpatientDO.getDept());//his内部科室编码
        data.put("his_dept_name",outpatientDO.getDeptName());//his内部科室名称
        data.put("emergency_sign",0);//急诊标志0 否,1 是
        data.put("trauma_sign",0);//外伤标志0 否,1 是
        data.put("date", DateUtil.dateToStrLong(outpatientDO.getAdmDate()));//实际门诊/入院日期 若为空,默认取系统时间
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        String result = requestYlz(data,funid,"医保挂号");
        if (result==null){
            throw new Exception("上传医保挂号失败!");
@ -1044,15 +1045,15 @@ public class HealthCareService {
            throw new Exception("上传医保失败:门诊为空!");
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("cert_type","01");//证件类型
        data.put("medical_mode","");//医疗就诊方式
        data.put("medical_type","");//医疗类别
        data.put("medical_mode","10");//医疗就诊方式
        data.put("medical_type","11");//医疗类别
        data.put("his_serial",outpatientDO.getRegisterNo());//his流水号
        data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保流水号
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        String result = requestYlz(data,funid,"医保挂号冲销");
        if (result==null){
            throw new Exception("上传医保挂号冲销失败!");
@ -1087,6 +1088,8 @@ public class HealthCareService {
        if (doctorDO==null){
            throw new Exception("上传医保费用明细失败:医生信息为空!");
        }
        String peopleType = "";
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findByHospitalAndDictCode("doctorType",doctorDO.getJobTitleName());
        Double register = outpatientDO.getFee();
        Double drugFee= 0.0;
        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(outpatientId);
@ -1094,16 +1097,16 @@ public class HealthCareService {
            drugFee +=wlyyPrescriptionDO.getDrugFee();
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("region_code","350200");//参保地区划代码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("cert_type","01");//证件类型 TODO
        data.put("medical_mode","");//医疗就诊方式
        data.put("medical_mode","10");//医疗就诊方式
        data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保流水号
        data.put("his_serial",outpatientDO.getRegisterNo());//his流水号
        data.put("item_count",2);//明细项目数量
        data.put("total_amount",drugFee+register);//医疗费总金额
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        String icd10 = outpatientDO.getIcd10();
        String icd10Name = outpatientDO.getIcd10Name();
        String icd[] = icd10.split(",");
@ -1113,8 +1116,8 @@ public class HealthCareService {
            JSONObject icdObj = new JSONObject();
            icdObj.put("disease_code_icd10",icd[i]);//诊断或症状编码
            icdObj.put("disease_name_icd10",icdName[i]);//诊断或症状名称
            icdObj.put("disease_type","");//诊断或症状类型
            icdObj.put("disease_order","");//诊断或症状序号
            icdObj.put("disease_type","01");//诊断或症状类型
            icdObj.put("disease_order",i);//诊断或症状序号
            icdArray.add(icdObj);
        }
        data.put("zdlist",icdArray);
@ -1124,12 +1127,12 @@ public class HealthCareService {
            for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:prescriptionInfoDOS){
                JSONObject infoObj = new JSONObject();
                infoObj.put("prescription_code",wlyyPrescriptionDO.getRealOrder());//医院处方编号
                infoObj.put("his_detail_sn","");//his处方明细流水号
                infoObj.put("item_name","");//医保项目名称
                infoObj.put("item_code","");//医保项目编码
                infoObj.put("his_detail_sn",wlyyPrescriptionDO.getVoucherNo());//his处方明细流水号
                infoObj.put("item_name","西药费");//医保项目名称
                infoObj.put("item_code","61");//医保项目编码
                infoObj.put("specification_type",wlyyPrescriptionInfoDO.getSpecification());//规格型号
                infoObj.put("dosage_form",wlyyPrescriptionInfoDO.getDosage());//剂型
                infoObj.put("charge_unit","");//单位
                infoObj.put("charge_unit",wlyyPrescriptionInfoDO.getPackUnitName());//单位
                infoObj.put("price",wlyyPrescriptionInfoDO.getPackRetprice());//单价
                infoObj.put("amount",wlyyPrescriptionInfoDO.getQuantity());//数量
                infoObj.put("total_money",wlyyPrescriptionInfoDO.getPackRetprice()*Integer.parseInt(wlyyPrescriptionInfoDO.getQuantity()));//金额
@ -1139,11 +1142,16 @@ public class HealthCareService {
                infoObj.put("medical_per_name",wlyyPrescriptionDO.getDoctorName());//医疗服务人员姓名
                infoObj.put("medical_per_id",doctorDO.getIdcard());//医疗服务人员证件号码
                infoObj.put("limit_type","");//限制范围类别
                infoObj.put("actg_date","");//记帐日期
                infoObj.put("actg_date",DateUtil.dateToStr(wlyyPrescriptionDO.getPrescribeTime(),DateUtil.YYYYMMDD));//记帐日期
                infoObj.put("his_item_name",wlyyPrescriptionInfoDO.getDrugName());//HIS院内项目名称
                infoObj.put("his_item_code",wlyyPrescriptionInfoDO.getDrugNo());//HIS院内项目编码
                infoObj.put("clerk_days","");//记帐日期
                infoObj.put("people_type","");//医保服务人员类别
                infoObj.put("clerk_days",DateUtil.dateToStrLong(wlyyPrescriptionDO.getPrescribeTime()));//记帐日期
                if (hospitalSysDictDO==null){
                    infoObj.put("people_type","03");//医保服务人员类别
                }else {
                    infoObj.put("people_type",hospitalSysDictDO.getDictValue());//医保服务人员类别
                }
                infoArray.add(infoObj);
            }
        }
@ -1182,18 +1190,18 @@ public class HealthCareService {
            throw new Exception("上传医保失败:门诊为空!");
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("medical_mode","");//医疗就诊方式
        data.put("medical_type","");//医疗类别
        data.put("medical_mode","10");//医疗就诊方式
        data.put("medical_type","11");//医疗类别
        if (StringUtils.isNoneBlank(prescriptionId)){
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
            data.put("detail_serial",wlyyPrescriptionDO.getDetailSerial());//医保明细流水号
        }
        data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保流水号
        data.put("invalidation_reason",remark);//作废原因
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        String result = requestYlz(data,funid,"医保费用明细上传冲销");
        if (result==null){
            throw new Exception("医保费用明细上传冲销失败!");
@ -1229,28 +1237,53 @@ public class HealthCareService {
        String funid = "N20.17.04.05";
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        if (outpatientDO==null){
            throw new Exception("上传医保失败:门诊为空!");
            throw new Exception("上传医保预结算服务失败:门诊为空!");
        }
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        if (doctorDO==null){
            throw new Exception("上传医保预结算服务失败:医生信息为空!");
        }
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findByHospitalAndDictCode("doctorType",doctorDO.getJobTitleName());
        Double register = outpatientDO.getFee();
        Double drugFee= 0.0;
        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(outpatientId);
        List<String> list = new ArrayList<>();
        for (WlyyPrescriptionDO wlyyPrescriptionDO:wlyyPrescriptionDOS){
            drugFee +=wlyyPrescriptionDO.getDrugFee();
            if (list!=null&&list.size()!=0&&!list.contains(wlyyPrescriptionDO.getRealOrder())){
                list.add(wlyyPrescriptionDO.getRealOrder());
            }
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("cert_type","");//证件类型
        data.put("medical_mode","");//医疗就诊方式
        data.put("medical_type","");//医疗类别
        data.put("cert_type","01");//证件类型
        data.put("medical_mode","10");//医疗就诊方式
        data.put("medical_type","11");//医疗类别
        data.put("his_bill_serial",outpatientDO.getXtgzh());//his收费单据流水号
        data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保流水号
        data.put("settlement_sign",0);//结算标识
        data.put("date",outpatientDO.getAdmDate());//实际就诊日期
        data.put("leave_method","");//离院方式
        data.put("pre_count","");//处方项目数
        data.put("total_amount","");//医疗费总金额
        data.put("data_source","");//数据来源
        data.put("leave_method","09");//离院方式
        data.put("pre_count",list.size());//处方项目数
        data.put("total_amount",drugFee+register);//医疗费总金额
        data.put("data_source","53");//数据来源
        data.put("his_serial",outpatientDO.getRegisterNo());//his流水号
        data.put("doctor_level","");//医师诊查费等级
        if (hospitalSysDictDO==null){
            data.put("doctor_level","03");//医师诊查费等级
            data.put("trt_fee_level","03");//医师诊查费等级
        }else {
            data.put("doctor_level",hospitalSysDictDO.getDictValue());//医师诊查费等级
            data.put("trt_fee_level",hospitalSysDictDO.getDictValue());//医师诊查费等级
        }
        data.put("dept_code",outpatientDO.getDept());//科室编码
        data.put("charge_qty","");//本次收费次数
        data.put("trt_fee_level","");//医师诊查费等级
        data.put("charge_qty",1+list.size());//本次收费次数
        String result = requestYlz(data,funid,"医保预结算服务");
        if (result==null){
            throw new Exception("医保预结算服务失败!");
@ -1325,16 +1358,16 @@ public class HealthCareService {
            throw new Exception("上传医保失败:门诊为空!");
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("cert_type","");//证件类型
        data.put("medical_mode","");//医疗就诊方式
        data.put("cert_type","01");//证件类型
        data.put("medical_mode","10");//医疗就诊方式
        data.put("bill_serial",outpatientDO.getBillSerial());//医保收费流水号
        data.put("his_bill_serial",outpatientDO.getXtgzh());//his收费单据流水号
        data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保流水号
        data.put("data_source","");//数据来源
        data.put("refund_serial","");//医院退费操作流水号
        data.put("data_source","53");//数据来源
        data.put("refund_serial",outpatientDO.getRegisterNo());//医院退费操作流水号
        String result = requestYlz(data,funid,"医保结算冲销服务");
        if (result==null){
            throw new Exception("医保结算冲销服务失败!");
@ -1371,24 +1404,45 @@ public class HealthCareService {
        if (wlyyHospitalSysDictDO==null){
            throw new Exception("获取医保结算页面地址失败:回调地址为空");
        }
        data.put("region_code","");//参保地区划代码
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        if (doctorDO==null){
            throw new Exception("获取医保结算页面地址失败:医生信息为空!");
        }
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findByHospitalAndDictCode("doctorType",doctorDO.getJobTitleName());
        Double register = outpatientDO.getFee();
        Double drugFee= 0.0;
        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(outpatientId);
        List<String> list = new ArrayList<>();
        for (WlyyPrescriptionDO wlyyPrescriptionDO:wlyyPrescriptionDOS){
            drugFee +=wlyyPrescriptionDO.getDrugFee();
            if (list!=null&&list.size()!=0&&!list.contains(wlyyPrescriptionDO.getRealOrder())){
                list.add(wlyyPrescriptionDO.getRealOrder());
            }
        }
        data.put("region_code","350200");//参保地区划代码
        data.put("name",outpatientDO.getPatientName());//姓名
        data.put("idcard",outpatientDO.getIdcard());//证件号码
        data.put("cert_type","");//证件类型
        data.put("cert_type","01");//证件类型
        data.put("medical_mode",ylzMedicalRelationDO.getMedicalMode());//医疗就诊方式
        data.put("medical_type",ylzMedicalRelationDO.getMedicalType());//医疗类别
        data.put("insurance_serial",ylzMedicalRelationDO.getInsuranceSerial());//
        data.put("his_bill_serial",ylzMedicalRelationDO.getHisBillSerial());//his收费单据流水号
        data.put("date",ylzMedicalRelationDO.getDate());//实际就诊日期
        data.put("leave_method","");//离院方式
        data.put("pre_count","");//处方项目数
        data.put("leave_method","09");//离院方式
        data.put("pre_count",list.size());//处方项目数
        data.put("total_amount",ylzMedicalRelationDO.getTotalAmount());//医疗费总金额
        data.put("person_cash",ylzMedicalRelationDO.getPersonCash());//个人现金支付金额(实付现金)
        data.put("person_account",ylzMedicalRelationDO.getPersonAccount());//个人账户支付金额
        data.put("fund_price",ylzMedicalRelationDO.getFundPrice());//基金支付总额
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        data.put("his_serial",outpatientDO.getRegisterNo());//his流水号
        data.put("doctor_level","");//医师诊查费等级
        if (hospitalSysDictDO==null){
            data.put("doctor_level","03");//医师诊查费等级
        }else {
            data.put("doctor_level",hospitalSysDictDO.getDictValue());//医师诊查费等级
        }
        data.put("redirect_url",wlyyHospitalSysDictDO.getDictValue());//回调地址
        String result = requestYlz(data,funid,"获取医保结算结果");
        if (result==null){
@ -1422,30 +1476,40 @@ public class HealthCareService {
     *
     * 返回值
     *
     * @param code
     * @param outpatientId
     * @return
     * @throws Exception
     */
    public String uploadMedicalHistory(String code) throws Exception{
    public String uploadMedicalHistory(String outpatientId) throws Exception{
        String funid = "N20.17.06.01";
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("idcard","");//身份证号
        data.put("name","");//姓名
        data.put("cert_type","");//证件类型
        data.put("insurance_serial","");//医保流水号
        data.put("blood_type","");//血型
        data.put("allergy","");//过敏史
        data.put("diagnosis","");//病理诊断
        data.put("describe","");//病情描述
        data.put("difficult_cases","");//疑难病例
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
        if (wlyyOutpatientDO==null){
            throw new Exception("医保上传户病史病情及医学报告失败!门诊为空");
        }
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",wlyyOutpatientDO.getId());//身份证号
        data.put("name",wlyyOutpatientDO.getPatientName());//姓名
        data.put("cert_type","01");//证件类型
        data.put("insurance_serial",wlyyOutpatientDO.getInsuranceSerial());//医保流水号
        data.put("blood_type",wlyyOutpatientDO.getBloodType());//血型
        data.put("allergy",wlyyOutpatientDO.getAllergy());//过敏史
        data.put("diagnosis",wlyyOutpatientDO.getIcd10Name());//病理诊断
        data.put("describe",wlyyOutpatientDO.getDescription());//病情描述
        data.put("difficult_cases","无");//疑难病例
        data.put("file_list_count",0);//医学报告附件数量
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        String result = requestYlz(data,funid,"上传用户病史病情及医学报告");
        if (result==null){
            throw new Exception("上传用户病史病情及医学报告失败!");
        }
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            wlyyOutpatientDO.setInsuranceMedHistserial(encryptData.getString("insurance_med_hist_serial"));
            logger.info("上传用户病史病情及医学报告保存成功");
        }
        return result;
    }
@ -1454,21 +1518,26 @@ public class HealthCareService {
     *
     * 返回值
     *
     * @param code
     * @param outpatientId
     * @return
     * @throws Exception
     */
    public String RefundMedicalHistory(String code,String remark) throws Exception{
    public String refundMedicalHistory(String outpatientId,String remark) throws Exception{
        String funid = "N20.17.06.06";
        JSONObject data = new JSONObject();
        data.put("insurance_serial","");//医保流水号
        data.put("insurance_med_hist_serial","");//医保病史上传流水号
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
        if (wlyyOutpatientDO==null){
            throw new Exception("医保上传户病史病情及医学报告失败!门诊为空");
        }
        data.put("insurance_serial",wlyyOutpatientDO.getInsuranceSerial());//医保流水号
        data.put("insurance_med_hist_serial",wlyyOutpatientDO.getInsuranceMedHistserial());//医保病史上传流水号
        data.put("invalid_reason",remark);//作废原因
        data.put("data_source","");//数据来源
        data.put("data_source","53");//数据来源
        String result = requestYlz(data,funid,"作废用户病史病情及医学报告");
        if (result==null){
            throw new Exception("作废用户病史病情及医学报告失败!");
        }
        return result;
    }
@ -1477,25 +1546,33 @@ public class HealthCareService {
     *
     * 返回值
     *
     * @param code
     * @param outpatientId
     * @return
     * @throws Exception
     */
    public String uploadIcdProcess(String code) throws Exception{
    public String uploadIcdProcess(String outpatientId) throws Exception{
        String funid = "N20.17.06.02";
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
        if (wlyyOutpatientDO==null){
            throw new Exception("获取问诊过程数据失败!门诊为空");
        }
        BaseDoctorDO doctorDO = doctorDao.findById(wlyyOutpatientDO.getDoctor());
        if (doctorDO==null){
            throw new Exception("获取问诊过程数据失败!医生信息为空");
        }
        JSONObject data = new JSONObject();
        data.put("region_code","");//参保地区划代码
        data.put("idcard","");//身份证号
        data.put("name","");//姓名
        data.put("cert_type","");//证件类型
        data.put("service_serial_id","");//问诊流水号
        data.put("doctor_id_card","");//医师身份证
        data.put("doctor_name","");//医师姓名
        data.put("file_list_count","");//附件总数
        data.put("region_code","350200");//参保地区划代码
        data.put("idcard",wlyyOutpatientDO.getIdcard());//身份证号
        data.put("name",wlyyOutpatientDO.getPatientName());//姓名
        data.put("cert_type","01");//证件类型
        data.put("service_serial_id",wlyyOutpatientDO.getRegisterNo());//问诊流水号
        data.put("doctor_id_card",doctorDO.getIdcard());//医师身份证
        data.put("doctor_name",wlyyOutpatientDO.getDoctorName());//医师姓名
        /*data.put("file_list_count","");//附件总数
        data.put("filelist","");//附件列表
        data.put("file_bytes","");//二进制字节流
        data.put("file_name","");//文件名
        data.put("order_num",0);//顺序号
        data.put("order_num",0);//顺序号*/
        String result = requestYlz(data,funid,"获取问诊过程数据");
        if (result==null){

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/httplog/YlzHttpLogDO.java

@ -92,6 +92,7 @@ public class YlzHttpLogDO extends UuidIdentityEntity {
        this.createTime = createTime;
    }
    @Column(name = "request_encrypt")
    public String getRequestEncrypt() {
        return requestEncrypt;
    }
@ -100,6 +101,7 @@ public class YlzHttpLogDO extends UuidIdentityEntity {
        this.requestEncrypt = requestEncrypt;
    }
    @Column(name = "response_encrpty")
    public String getResponseEncrypt() {
        return responseEncrypt;
    }

+ 33 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java

@ -299,6 +299,39 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    private String billSerial;//医保收费流水号
    private String insuranceMedHistserial;//医保病史上传流水号
    private String bloodType;//血型
    private String allergy;//过敏史
    @Column(name = "blood_type")
    public String getBloodType() {
        return bloodType;
    }
    public void setBloodType(String bloodType) {
        this.bloodType = bloodType;
    }
    @Column(name = "allergy")
    public String getAllergy() {
        return allergy;
    }
    public void setAllergy(String allergy) {
        this.allergy = allergy;
    }
    @Column(name = "insurance_med_hist_serial")
    public String getInsuranceMedHistserial() {
        return insuranceMedHistserial;
    }
    public void setInsuranceMedHistserial(String insuranceMedHistserial) {
        this.insuranceMedHistserial = insuranceMedHistserial;
    }
    @Column(name = "bill_serial")
    public String getBillSerial() {
        return billSerial;

+ 100 - 93
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/healthCare/HealthCareEndPoint.java

@ -1,111 +1,21 @@
package com.yihu.jw.hospital.endpoint.healthCare;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dict.service.BaseDictJobTitleService;
import com.yihu.jw.dict.service.HospitalDeptService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.service.yqfk.YqfkService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.healthCare.service.HealthCareService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.message.service.BaseBannerDoctorService;
import com.yihu.jw.hospital.message.service.BaseUserMsgService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
import com.yihu.jw.hospital.service.consult.KnowledgeCategoryService;
import com.yihu.jw.hospital.service.consult.QrcodeService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.utils.PayLogService;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.service.WechatInfoService;
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
import com.ylzinfo.onepay.sdk.OnepayClient;
import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
import com.ylzinfo.onepay.sdk.domain.WebHook;
import com.ylzinfo.onepay.sdk.domain.ext.WaitPayDetailVO;
import com.ylzinfo.onepay.sdk.exception.PayException;
import com.ylzinfo.onepay.sdk.utils.SecurityUtil;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.xml.XMLSerializer;
import org.apache.axis.utils.StringUtils;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.TimeUnit;
import static com.yihu.jw.utils.sfutils.SHAUtils.SHA1;
/**
 * @author zmk
 * 患者不用登陆访问居民PC端控制类
 * Created at 2019/12/25。
 * @author wangzhinan
 *
 * Created at 20211003
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.HealthCare.PREFIX)
@ -208,4 +118,101 @@ public class HealthCareEndPoint extends EnvelopRestEndpoint {
        return ObjEnvelop.getSuccess("ok",healthCareService.getYlzToken());
    }
    @PostMapping(value = "/authorized")
    @ApiOperation(value = "渠道应用是否已授权", notes = "渠道应用是否已授权")
    public ObjEnvelop authorized(@ApiParam(name = "patient", value = "患者id", required = true)
                                     @RequestParam(value = "patient", required = true)String patient)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.authorized(patient));
    }
    @PostMapping(value = "/medicareOnline")
    @ApiOperation(value = "医保在线服务授权表单(H5表单/小程序)(N20.17.01.02)", notes = "医保在线服务授权表单(H5表单/小程序)(N20.17.01.02)")
    public ObjEnvelop medicareOnline(@ApiParam(name = "patient", value = "患者id", required = true)
                                 @RequestParam(value = "patient", required = true)String patient)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.medicareOnline(patient));
    }
    @PostMapping(value = "/register")
    @ApiOperation(value = "2.5.1医保挂号(N20.17.04.01)", notes = "2.5.1医保挂号(N20.17.04.01)")
    public ObjEnvelop register(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                     @RequestParam(value = "outpatientId", required = true)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.register(outpatientId));
    }
    @PostMapping(value = "/registerBack")
    @ApiOperation(value = " 2.5.2医保挂号冲销(N20.17.04.02)", notes = " 2.5.2医保挂号冲销(N20.17.04.02)")
    public ObjEnvelop registerBack(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                               @RequestParam(value = "outpatientId", required = true)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.registerBack(outpatientId));
    }
    @PostMapping(value = "/feeDetailUpload")
    @ApiOperation(value = " 2.5.3医保费用明细上传(N20.17.04.03)", notes = " 2.5.3医保费用明细上传(N20.17.04.03)")
    public ObjEnvelop feeDetailUpload(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                   @RequestParam(value = "outpatientId", required = true)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.feeDetailUpload(outpatientId));
    }
    @PostMapping(value = "/feeDetailRefund")
    @ApiOperation(value = " 2.5.4医保费用明细上传冲销(N20.17.04.04)", notes = " 2.5.4医保费用明细上传冲销(N20.17.04.04)")
    public ObjEnvelop feeDetailRefund(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                      @RequestParam(value = "outpatientId", required = false)String outpatientId,
                                      @ApiParam(name = "prescriptionId", value = "处方id", required = true)
                                      @RequestParam(value = "prescriptionId", required = false)String prescriptionId,
                                      @ApiParam(name = "remark", value = "作废原因", required = false)
                                          @RequestParam(value = "remark", required = true)String remark)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.feeDetailRefund(outpatientId,prescriptionId,remark));
    }
    @PostMapping(value = "/preSettlement")
    @ApiOperation(value = " 2.5.5医保预结算服务(N20.17.04.05)", notes = " 2.5.5医保预结算服务(N20.17.04.05)")
    public ObjEnvelop preSettlement(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                      @RequestParam(value = "outpatientId", required = false)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.preSettlement(outpatientId));
    }
    @PostMapping(value = "/preSettlementRefund")
    @ApiOperation(value = " 2.5.6医保结算冲销服务(N20.17.04.06)", notes = " 2.5.6医保结算冲销服务(N20.17.04.06)")
    public ObjEnvelop preSettlementRefund(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                    @RequestParam(value = "outpatientId", required = false)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.preSettlementRefund(outpatientId));
    }
    @PostMapping(value = "/getSettlementResultUrl")
    @ApiOperation(value = " 2.5.7获取医保结算页面地址(N20.17.04.07)", notes = " 2.5.7获取医保结算页面地址(N20.17.04.07)")
    public ObjEnvelop getSettlementResultUrl(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                          @RequestParam(value = "outpatientId", required = false)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.getSettlementResultUrl(outpatientId));
    }
    @PostMapping(value = "/getSettlementResult")
    @ApiOperation(value = " 2.5.8获取医保结算结果(N20.17.04.08)", notes = " 2.5.8获取医保结算结果(N20.17.04.08)")
    public ObjEnvelop getSettlementResult(@ApiParam(name = "code", value = "结果回参", required = true)
                                             @RequestParam(value = "code", required = false)String code)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.getSettlementResult(code));
    }
    @PostMapping(value = "/uploadMedicalHistory")
    @ApiOperation(value = " 2.7.1上传用户病史病情及医学报告(N20.17.06.01)", notes = " 2.7.1上传用户病史病情及医学报告(N20.17.06.01)")
    public ObjEnvelop uploadMedicalHistory(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                          @RequestParam(value = "outpatientId", required = false)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.uploadMedicalHistory(outpatientId));
    }
    @PostMapping(value = "/refundMedicalHistory")
    @ApiOperation(value = " 2.7.2作废用户病史病情及医学报告(N20.17.06.06)", notes = " 2.7.2作废用户病史病情及医学报告(N20.17.06.06)")
    public ObjEnvelop refundMedicalHistory(@ApiParam(name = "outpatientId", value = "门诊id", required = false)
                                          @RequestParam(value = "outpatientId", required = false)String outpatientId,
                                           @ApiParam(name = "remark", value = "作废原因", required = false)
                                           @RequestParam(value = "remark", required = false)String remark)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.refundMedicalHistory(outpatientId,remark));
    }
    @PostMapping(value = "/uploadIcdProcess")
    @ApiOperation(value = " 2.7.3获取问诊过程数据(N20.17.06.02)", notes = " 2.7.3获取问诊过程数据(N20.17.06.02)")
    public ObjEnvelop uploadIcdProcess(@ApiParam(name = "outpatientId", value = "门诊id", required = false)
                                           @RequestParam(value = "outpatientId", required = false)String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.uploadIcdProcess(outpatientId));
    }
}