|
@ -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);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|