|
@ -1258,7 +1258,7 @@ public class XzzxEntranceService{
|
|
|
condition1 += "<DayCount>"+prescriptionInfoDO.getDays()+"</DayCount>";
|
|
|
condition1 += "<Usage>"+prescriptionInfoDO.getSupplyCode()+"</Usage>";
|
|
|
condition1 += "<TotalDoseage>"+prescriptionInfoDO.getQuantity()+"</TotalDoseage>";
|
|
|
condition1 += "<TotalUnit>"+prescriptionInfoDO.getPackQuantity()+prescriptionInfoDO.getUnitName()+"/"+prescriptionInfoDO.getPackUnit()+"</TotalUnit>";
|
|
|
condition1 += "<TotalUnit>"+prescriptionInfoDO.getPackUnit()+"</TotalUnit>";
|
|
|
condition1 += "<PrescribeMemo>"+"</PrescribeMemo>";
|
|
|
condition1 += "<FryMode>"+"</FryMode>";
|
|
|
condition1 += "<HerbalTakeMethodClass>"+"</HerbalTakeMethodClass>";
|
|
@ -1281,6 +1281,153 @@ public class XzzxEntranceService{
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 互联网医院开处方信息更新到his
|
|
|
* @param IoFlag 门诊住院标志
|
|
|
* @param PayCardNo 就诊卡号
|
|
|
* @param NullahNumber 挂号流水号
|
|
|
* @param ApplyDept 执行科室
|
|
|
* @param ApplyDoctor 开单医生
|
|
|
* @param ExecuteDept 执行科室(药房)
|
|
|
* @param presNo 必填,医嘱号
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String delHisPrescriptionByHisNo(String IoFlag,String PayCardNo,String NullahNumber,
|
|
|
String ApplyDept,String ApplyDoctor,String ExecuteDept,String PresNo)throws Exception{
|
|
|
String api = "delHisPrescriptionByHisNo";
|
|
|
String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
|
|
|
"<root> " +
|
|
|
" <serverName>"+api+"</serverName> " +
|
|
|
" <format>xml</format>" +
|
|
|
" <callOperator></callOperator> " +
|
|
|
" <certificate>"+key+"</certificate> " +
|
|
|
"</root>";
|
|
|
String condition ="";
|
|
|
if (!StringUtils.isEmpty(IoFlag)){
|
|
|
condition += "<IoFlag>"+IoFlag+"</IoFlag>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(PayCardNo)){
|
|
|
condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(NullahNumber)){
|
|
|
condition += "<NullahNumber>"+NullahNumber+"</NullahNumber>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(ApplyDept)){
|
|
|
condition += "<ApplyDept>"+ApplyDept+"</ApplyDept>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(ApplyDoctor)){
|
|
|
condition += "<ApplyDoctor>"+ApplyDoctor+"</ApplyDoctor>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(ExecuteDept)){
|
|
|
condition += "<ExecuteDept>"+ExecuteDept+"</ExecuteDept>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(PresNo)){
|
|
|
condition += "<PresNo>"+PresNo+"</PresNo>";
|
|
|
}
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
logger.info("delHisPrescriptionByHisNo params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
logger.info("delHisPrescriptionByHisNo json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 保存入门诊断信息到his
|
|
|
* @param ApplyNo
|
|
|
* @param DiagnosisName
|
|
|
* @param DiagnosisCode
|
|
|
* @param ChnSymPtomsCode
|
|
|
* @param ChnSymPtomsName
|
|
|
* @param ChnDiagnosisCode
|
|
|
* @param ChnDiagnosisName
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String saveDiagnosis(String ApplyNo,String DiagnosisName,String DiagnosisCode,
|
|
|
String ChnSymPtomsCode,String ChnSymPtomsName,String ChnDiagnosisCode,String ChnDiagnosisName)throws Exception{
|
|
|
String api = "saveDiagnosis";
|
|
|
String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
|
|
|
"<root> " +
|
|
|
" <serverName>"+api+"</serverName> " +
|
|
|
" <format>xml</format>" +
|
|
|
" <callOperator></callOperator> " +
|
|
|
" <certificate>"+key+"</certificate> " +
|
|
|
"</root>";
|
|
|
String condition ="";
|
|
|
if (!StringUtils.isEmpty(ApplyNo)){
|
|
|
condition += "<ApplyNo>"+ApplyNo+"</ApplyNo>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(DiagnosisName)){
|
|
|
condition += "<DiagnosisName>"+DiagnosisName+"</DiagnosisName>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(DiagnosisCode)){
|
|
|
condition += "<DiagnosisCode>"+DiagnosisCode+"</DiagnosisCode>";
|
|
|
}
|
|
|
|
|
|
condition+="<ChnSymPtomsCode>"+"</ChnSymPtomsCode>";
|
|
|
condition+="<ChnSymPtomsName>"+"</ChnSymPtomsName>";
|
|
|
condition+="<ChnDiagnosisCode>"+"</ChnDiagnosisCode>";
|
|
|
condition+="<ChnDiagnosisName>"+"</ChnDiagnosisName>";
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
logger.info("saveDiagnosis params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
logger.info(" saveDiagnosis json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发送退号信息到his
|
|
|
* @param ApplyNo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String refundConsultation(String ApplyNo,String PayCardNo)throws Exception{
|
|
|
String api = "refundConsultation";
|
|
|
String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
|
|
|
"<root> " +
|
|
|
" <serverName>"+api+"</serverName> " +
|
|
|
" <format>xml</format>" +
|
|
|
" <callOperator></callOperator> " +
|
|
|
" <certificate>"+key+"</certificate> " +
|
|
|
"</root>";
|
|
|
String condition ="";
|
|
|
if (!StringUtils.isEmpty(ApplyNo)){
|
|
|
condition += "<ApplyNo>"+ApplyNo+"</ApplyNo>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(PayCardNo)){
|
|
|
condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>";
|
|
|
}
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
logger.info("refundConsultation params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
logger.info("refundConsultation json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 组装检查检验项目参数
|
|
@ -2716,7 +2863,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 保存处方到entrance
|
|
|
* @param ioFlag 门诊住院标志
|
|
|
* @param payCardNo 就诊卡号
|
|
|
* @param nullahNumber 挂号流水号
|
|
@ -2754,6 +2901,58 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存诊断到entrance
|
|
|
* @param applyNo 必填,流水号
|
|
|
* @param diagnosisName 必填,诊断名称
|
|
|
* @param diagnosisCode 诊断代码
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject saveDiagnosisToEntrance(String applyNo,String diagnosisName,String diagnosisCode) throws Exception {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
String response = "";
|
|
|
String url = entranceUrl+"saveDiagnosis";
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("ApplyNo",applyNo);
|
|
|
params.put("DiagnosisName",diagnosisName);
|
|
|
params.put("DiagnosisCode",diagnosisCode);
|
|
|
logger.info("params"+params.toString());
|
|
|
response = httpClientUtil.httpPost(url,params);
|
|
|
logger.info("诊断同步"+response);
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if(object.getInteger("status")==200){
|
|
|
jsonObject = object.getJSONObject("obj");
|
|
|
}
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送退号信息到entrance
|
|
|
* @param applyNo 必填,流水号
|
|
|
* @param payCardNo 必填,卡号
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject refundConsultationToEntrance(String applyNo,String payCardNo) throws Exception {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
String response = "";
|
|
|
String url = entranceUrl+"refundConsultation";
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("ApplyNo",applyNo);
|
|
|
params.put("PayCardNo",payCardNo);
|
|
|
logger.info("params"+params.toString());
|
|
|
response = httpClientUtil.httpPost(url,params);
|
|
|
logger.info("诊断同步"+response);
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if(object.getInteger("status")==200){
|
|
|
jsonObject = object.getJSONObject("obj");
|
|
|
}
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
//=====================hospital应用调用entrance应用============end=================
|
|
|
|
|
|
|
|
@ -3034,12 +3233,10 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
public String saveCheckInputInfo(String prescriptionId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
|
|
|
JSONObject jsonObject = initEntranceParam(payType,doctor,patient,diagnosisDOS);
|
|
|
String tjPrescriptionId = "";
|
|
|
WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = new WlyyPrescriptionCheckDO();
|
|
|
//如果重新审核药品 一定要把返回的orderNo的值拿到赋值到prescriptionId里
|
|
|
if (StringUtils.isNotEmpty(prescriptionId)) {
|
|
|
tjPrescriptionId = prescriptionId;
|
|
|
jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
|
|
|
wlyyPrescriptionCheckDO = prescriptionCheckDao.findOne(prescriptionId);
|
|
|
}
|
|
|
if (null!=infos&&infos.size()>0) {
|
|
|
String response = "";
|
|
@ -3063,7 +3260,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
System.out.println("obj:"+obj);
|
|
|
if (StringUtils.isNotBlank(obj)) {
|
|
|
returnJson = obj;
|
|
|
wlyyPrescriptionCheckDO.setStatus(9);
|
|
|
logger.info("返回到互联网医院的解析后的结果:"+returnJson);
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
@ -3071,10 +3267,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
wlyyHttpLogDO.setResponse(returnJson);
|
|
|
wlyyHttpLogDO.setName("saveCheckPrescription");
|
|
|
} else {
|
|
|
returnJson = "保存成功";
|
|
|
wlyyPrescriptionCheckDO.setStatus(10);
|
|
|
returnJson = "保存失败";
|
|
|
logger.info(returnJson);
|
|
|
wlyyHttpLogDO.setCode("success");
|
|
|
wlyyHttpLogDO.setCode("failed");
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
|
|
@ -3100,11 +3295,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
public String deleteCheckInputInfo(String prescriptionId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception{
|
|
|
JSONObject jsonObject = initEntranceParam(payType,doctor,patient,diagnosisDOS);
|
|
|
String tjPrescriptionId = "";
|
|
|
WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = new WlyyPrescriptionCheckDO();
|
|
|
//如果重新审核药品 一定要把返回的orderNo的值拿到赋值到prescriptionId里
|
|
|
if (StringUtils.isNotEmpty(prescriptionId)){
|
|
|
tjPrescriptionId = prescriptionId;
|
|
|
wlyyPrescriptionCheckDO = prescriptionCheckDao.findOne(tjPrescriptionId);
|
|
|
jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
|
|
|
}
|
|
|
String response = "";
|
|
@ -3123,7 +3316,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
String obj = object.getString("obj");
|
|
|
System.out.println("obj:"+obj);
|
|
|
if (StringUtils.isNotBlank(obj)) { ;
|
|
|
wlyyPrescriptionCheckDO.setStatus(11);
|
|
|
returnJson = obj;
|
|
|
logger.info("返回到互联网医院的解析后的结果:"+returnJson);
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
@ -3134,7 +3326,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
} else {
|
|
|
returnJson = "删除成功";
|
|
|
logger.info(returnJson);
|
|
|
wlyyPrescriptionCheckDO.setStatus(12);
|
|
|
wlyyHttpLogDO.setCode("删除成功");
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
@ -3144,7 +3335,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
}
|
|
|
} else {
|
|
|
returnJson = "entranceUrl接口调用失败";
|
|
|
wlyyPrescriptionCheckDO.setStatus(11);
|
|
|
wlyyHttpLogDO.setCode("error");
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
@ -3153,8 +3343,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
wlyyHttpLogDO.setName("deleteCheckPrescription");
|
|
|
}
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
prescriptionCheckDao.save(wlyyPrescriptionCheckDO);
|
|
|
wlyyPrescriptionCheckDO.setReason(returnJson);
|
|
|
return returnJson;
|
|
|
|
|
|
}
|