Browse Source

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
wangzhinan 4 years ago
parent
commit
303cd6ceee

+ 72 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -7110,12 +7110,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                    Map<String, Object> map = sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
                    //处方签名
                    logger.info("处方签名");
                    SOF_SignDataWithExtraInfo(wlyyPrescriptionDO);
                    //同步电子病历
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                    if (prescriptionEmrDO != null) {
                        String doctorId = doctorMappingDO.getMappingCode();
                        String doctorName = doctorMappingDO.getDoctorName();
                        logger.info("电子病历签名");
                        SOF_SignDataWithExtraInfoEmr(prescriptionEmrDO);
                        writeOutPatient(outpatientDO.getRegisterNo(), prescriptionEmrDO.getComplaint(), prescriptionEmrDO.getMedicalHistory(), prescriptionEmrDO.getPastHistory(), prescriptionEmrDO.getPhysicalExamination(), prescriptionEmrDO.getAssistExamination(), doctorId, doctorName);
                    }
                    if (map.get("code").toString().equalsIgnoreCase("1")) {
@ -8178,6 +8181,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        extInfoMap.put("diagnostic", wlyyOutpatientDO!=null?wlyyOutpatientDO.getIcd10Name():null);
        String extInfo = org.apache.commons.codec.binary.Base64.encodeBase64String(JSON.toJSONString(extInfoMap).getBytes("GBK"));
        String result = service.SOF_SignDataWithExtraInfo(idCardNo, inData, extInfo);
        logger.info("请求返参"+result);
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
        if ("1000".equalsIgnoreCase(object.getString("code"))){
            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(object.getString("data"));
@ -8188,6 +8192,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                String certData = jsonObject.getString("certData");
                WlyyPrescriptionSignDO prescriptionSignDO = new WlyyPrescriptionSignDO();
                prescriptionSignDO.setCertData(certData);
                prescriptionSignDO.setPrescriptionId(prescriptionDO.getId());
                prescriptionSignDO.setSignData(signData);
                prescriptionSignDO.setSignResult(signResult);
                prescriptionSignDO.setCreateTime(new Date());
@ -8198,4 +8203,71 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
    }
    /**
     * 电子病历签名
     * @param prescriptionDO
     * @throws Exception
     */
    public void SOF_SignDataWithExtraInfoEmr(WlyyPrescriptionEmrDO prescriptionEmrDO) throws Exception {
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionEmrDO.getId());
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
        BaseDoctorDO doctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
        BasePatientDO patientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        PKIService_ServiceLocator locator = new PKIService_ServiceLocator();
        URL portAddress = new URL("http://192.0.33.91:8080/pkis/services/v1?wsdl");
        PKIService_PortType service = locator.getPKIServiceImplPort(portAddress);
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        //电子病历签名
        com.alibaba.fastjson.JSONObject jsonData = new com.alibaba.fastjson.JSONObject();
        jsonData.put("CHIEF_COMPLAINT",prescriptionEmrDO.getComplaint());
        jsonData.put("HPI",prescriptionEmrDO.getMedicalHistory());
        jsonData.put("ELAPSEMHIS",prescriptionEmrDO.getPastHistory());
        jsonData.put("BODYCHECK",prescriptionEmrDO.getPhysicalExamination());
        jsonData.put("ASSISTANTCHECK",prescriptionEmrDO.getAssistExamination());
        // 1.1.1 服务端签名(带取证查询扩展信息)
        // inData 参数
        String inData = jsonData.toJSONString();
        inData = org.apache.commons.codec.binary.Base64.encodeBase64String(inData.getBytes("gbk"));
        // extInfo  参数
        String idCardNo = "123502004266006872;"+doctorDO.getIdcard();
        Map<String, String> extInfoMap = new HashMap<String, String>();
        extInfoMap.put("busSys", "ZhongJianXinLianHLWYY");
        extInfoMap.put("doctorNo", doctorMappingDO!=null?doctorMappingDO.getMappingCode():null);
        extInfoMap.put("doctorName", doctorMappingDO!=null?doctorMappingDO.getDoctorName():null);
        extInfoMap.put("deptName", "部门");
        extInfoMap.put("patientName", patientDO!=null?patientDO.getName():null);
        extInfoMap.put("patientSex", patientDO!=null?IdCardUtil.getSexForIdcard(patientDO.getIdcard()):null);
        extInfoMap.put("hospitalNo", wlyyOutpatientDO!=null?wlyyOutpatientDO.getOriginAdmNo():null);
        extInfoMap.put("hospitalNumber",  wlyyOutpatientDO!=null?wlyyOutpatientDO.getOriginConNo():null);
        extInfoMap.put("diagnostic", wlyyOutpatientDO!=null?wlyyOutpatientDO.getIcd10Name():null);
        String extInfo = org.apache.commons.codec.binary.Base64.encodeBase64String(JSON.toJSONString(extInfoMap).getBytes("GBK"));
        String result = service.SOF_SignDataWithExtraInfo(idCardNo, inData, extInfo);
        logger.info("请求返参"+result);
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
        if ("1000".equalsIgnoreCase(object.getString("code"))){
            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(object.getString("data"));
            for (int i=0;i<array.size();i++){
                com.alibaba.fastjson.JSONObject jsonObject = array.getJSONObject(i);
                String signData = jsonObject.getString("signData");
                String signResult = jsonObject.getString("signResult");
                String certData = jsonObject.getString("certData");
                WlyyPrescriptionSignDO prescriptionSignDO = new WlyyPrescriptionSignDO();
                prescriptionSignDO.setCertData(certData);
                prescriptionSignDO.setPrescriptionId(prescriptionDO.getId());
                prescriptionSignDO.setSignData(signData);
                prescriptionSignDO.setSignResult(signResult);
                prescriptionSignDO.setCreateTime(new Date());
                prescriptionSignDO.setUpdateTime(new Date());
                prescriptionSignDO.setRelationCode(prescriptionEmrDO.getId());
                prescriptionSignDao.save(prescriptionSignDO);
            }
            prescriptionDO.setSignFlag(1);
        }
    }
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionSignDO.java

@ -20,6 +20,7 @@ public class WlyyPrescriptionSignDO extends UuidIdentityEntityWithOperator {
    private String signData;
    private String signResult;
    private String certData;
    private String relationCode;
    public String getPrescriptionId() {
        return prescriptionId;
@ -52,4 +53,12 @@ public class WlyyPrescriptionSignDO extends UuidIdentityEntityWithOperator {
    public void setCertData(String certData) {
        this.certData = certData;
    }
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
}