LAPTOP-KB9HII50\70708 3 år sedan
förälder
incheckning
6552029b83

+ 65 - 20
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -9,10 +9,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalBillDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalIcdDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalMxDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import com.yihu.jw.entity.hospital.healthCare.*;
import com.yihu.jw.entity.hospital.httplog.YlzHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
@ -23,10 +20,7 @@ import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.healthCare.utils.AES;
import com.yihu.jw.healthCare.utils.SafeUtil;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailBillDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailIcdDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailMxDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
import com.yihu.jw.hospital.healthCare.*;
import com.yihu.jw.hospital.httplog.dao.YlzHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
@ -82,6 +76,8 @@ public class HealthCareService {
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private YlzMedicalPrescriptionUploadDao ylzMedicalPrescriptionUploadDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private YlzMedicailRelationDao ylzMedicailRelationDao;
@ -99,6 +95,8 @@ public class HealthCareService {
    private String ylzConfigSignKey;
    private String ylzConfigOrgCode;
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
    public void initConfig() throws Exception{
        logger.info("初始话参数!");
@ -406,7 +404,7 @@ public class HealthCareService {
    /**
     * 2.4.2	医师开方上传
     */
    public String doctorPrescriptionUpload(String prescriptionId)throws Exception{
    public String doctorPrescriptionUpload(String prescriptionId) throws Exception{
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (wlyyPrescriptionDO == null){
            throw new Exception("续方信息不存在");
@ -415,8 +413,49 @@ public class HealthCareService {
        if (outpatientDO == null){
            throw new Exception("门诊信息不存在");
        }
        JSONObject data = new JSONObject();
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("ylzConfigOrgCode");
        if(hospitalSysDictDO == null){
            throw new Exception("未配置网点编号");
        }
        String icCardNo = outpatientDO.getCardNo();
        String his_serial = outpatientDO.getRegisterNo();
        String org_code = hospitalSysDictDO.getDictCode();
        JSONObject data;
        //获取his处方信息
        String getSettleInfoUrl = entranceUrl + "getSettleInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code;
        String infoResponse = httpClientUtil.get(getSettleInfoUrl,"GBK");
        logger.info("处方infoResponse:"+infoResponse);
        JSONObject infoObject = JSONObject.parseObject(infoResponse);
        if (infoObject.getString("status").equalsIgnoreCase("200")) {
            JSONObject obj = infoObject.getJSONObject("obj");
            if("0".equals(obj.getString("ret_code"))){
                data = obj;
            }else {
                throw new Exception("获取his处方信息失败:"+obj.getString("ret_mess"));
            }
        }else {
            throw new Exception("获取his处方信息失败");
        }
        data.remove("ret_code");
        data.remove("ret_mess");
        data.remove("log_no");
        YlzMedicalPrescriptionUploadDO uploadDO = new YlzMedicalPrescriptionUploadDO();
        uploadDO.setOrgCode(org_code);
        uploadDO.setIcCardNo(icCardNo);
        uploadDO.setHisSerial(his_serial);
        uploadDO.setOutpatientId(wlyyPrescriptionDO.getOutpatientId());
        uploadDO.setPrescriptionId(prescriptionId);
        uploadDO.setRegionCode(data.getString("region_code"));
        uploadDO.setName(data.getString("name"));
        uploadDO.setIdcard(data.getString("idcard"));
        uploadDO.setCertType(data.getString("cert_type"));
        uploadDO.setDataSource("53");//53移动支付
        uploadDO.setInsuranceSerial(data.getString("insurance_serial"));
        String result = requestYlz(data,"N20.17.03.01","医师开方上传");
        if(result == null){
            throw new Exception("医保请求失败");
@ -425,6 +464,8 @@ public class HealthCareService {
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            uploadDO.setTransactionNo(encryptData.getString("transaction_no"));
            ylzMedicalPrescriptionUploadDao.save(uploadDO);
            return encryptData.toJSONString();
        }
        return result;
@ -434,23 +475,27 @@ public class HealthCareService {
     * 2.4.3	医师开方上传取消(N20.17.03.06)
     */
    public String doctorPrescriptionUploadCancle(String prescriptionId,String cancelReason)throws Exception{
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
        YlzMedicalPrescriptionUploadDO uploadDO = ylzMedicalPrescriptionUploadDao.findByPrescriptionId(prescriptionId);
        if(uploadDO == null){
            throw new Exception("未找到开发上传记录");
        }
        JSONObject data = new JSONObject();
        data.put("transaction_no","");//处方上传流水号  	String	Y
        data.put("insurance_serial","insurance_serial");//医保流水号
        data.put("transaction_no",uploadDO.getTransactionNo());//处方上传流水号  	String	Y
        data.put("insurance_serial",uploadDO.getInsuranceSerial());//医保流水号
        data.put("cancel_reason",cancelReason);//作废原因
        data.put("region_code","");//参保地区划代码
        data.put("idcard",prescriptionDO.getIdcard());//证件号码
        data.put("name",prescriptionDO.getPatientName());//姓名
        data.put("cert_type","01");//证件类型
        data.put("data_source","");//数据来源	String	Y	参见编码附件
        data.put("region_code",uploadDO.getRegionCode());//参保地区划代码
        data.put("idcard",uploadDO.getIdcard());//证件号码
        data.put("name",uploadDO.getName());//姓名
        data.put("cert_type",uploadDO.getCertType());//证件类型
        data.put("data_source",uploadDO.getDataSource());//数据来源	String	Y	参见编码附件
        String result = requestYlz(data,"N20.17.03.06","医师开方上传取消");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("医师开方上传:"+result);
        logger.info("医师开方上传取消:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicalPrescriptionUploadDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.hospital.healthCare;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalBillDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalPrescriptionUploadDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -11,5 +12,5 @@ import org.springframework.data.repository.PagingAndSortingRepository;
public interface YlzMedicalPrescriptionUploadDao  extends PagingAndSortingRepository<YlzMedicalPrescriptionUploadDO, String>, JpaSpecificationExecutor<YlzMedicalPrescriptionUploadDO> {
    YlzMedicalPrescriptionUploadDO findByPrescriptionId(String prescriptionId);
}

+ 18 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -215,6 +215,24 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getOutpatientDrugInfo(registerSn,patNo,admNo,realOrder,startTime,endTime));
    }
    /**
     * 2.1.1	获取患者结算信息
     * @param icCardNo 社保卡号(必传)
     * @param his_serial his挂号号(必传)
     * @param org_code 医院编码(必传)
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/getSettleInfo")
    @ApiOperation(value = "获取患者结算信息", notes = "获取患者结算信息")
    public ObjEnvelop getSettleInfo(@ApiParam(name = "icCardNo", value = "社保卡号", required = true)
                                            @RequestParam(value = "icCardNo",required = true)String icCardNo,
                                            @ApiParam(name = "his_serial", value = "his挂号号", required = true)
                                            @RequestParam(value = "his_serial",required = true)String his_serial,
                                            @ApiParam(name = "org_code", value = "医院编码", required = true)
                                            @RequestParam(value = "org_code",required = true)String org_code)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getSettleInfo(icCardNo,his_serial,org_code));
    }
    /**
     * 获取门诊病人检查检验信息