|
@ -151,6 +151,14 @@ public class XzzxEntranceService{
|
|
|
return url;
|
|
|
}
|
|
|
|
|
|
public String getOperateSmsUrl(){
|
|
|
|
|
|
List<WlyyHospitalSysDictDO> list = wlyyHospitalSysDictDao.findByDictName("xzzxWebOperateSmsService");
|
|
|
|
|
|
String url = list.get(0).getDictCode();
|
|
|
return url;
|
|
|
}
|
|
|
|
|
|
public String getWXTokenUrl(){
|
|
|
WlyyHospitalSysDictDO sysDictDO = wlyyHospitalSysDictDao.findById("getXzToken");
|
|
|
return sysDictDO.getDictCode();
|
|
@ -264,7 +272,6 @@ public class XzzxEntranceService{
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
logger.info("getDoctorInfo params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
@ -277,6 +284,38 @@ public class XzzxEntranceService{
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询医生信息
|
|
|
* @return
|
|
|
*/
|
|
|
public String selectDoctorInfo(String idcard)throws Exception{
|
|
|
String api = "GetDoctorInfo";
|
|
|
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.isNoneBlank(idcard)){
|
|
|
condition = "<Idcard>"+idcard+"</Idcard>";
|
|
|
}
|
|
|
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("getDoctorInfo params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
logger.info("getDoctorInfo json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
public String findWlyyDoctor(JSONArray doctors)throws Exception{
|
|
|
logger.info("doctors size:"+doctors.size());
|
|
|
if(doctors!=null&&doctors.size()>0){
|
|
@ -567,14 +606,19 @@ public class XzzxEntranceService{
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
logger.info("findPatientCard params:"+params.toString());
|
|
|
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setName("查询患者就诊卡");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info("findPatientCard json:"+json);
|
|
|
return json;
|
|
|
}
|
|
@ -606,18 +650,72 @@ public class XzzxEntranceService{
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("getCardInfo params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setName("获取卡信息");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info("getCardInfo json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 发送短信验证码
|
|
|
*
|
|
|
* @param json
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String SendSms(String json)throws Exception{
|
|
|
String api = "SendSms";
|
|
|
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(json)){
|
|
|
JSONObject object = JSONObject.parseObject(json);
|
|
|
condition = "<content>"+object+"</content>";
|
|
|
}
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("SendSms params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateSmsUrl());
|
|
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String jsonObject = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(jsonObject);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setName("短信验证码发送");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info("SendSms json:"+jsonObject);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取单条门诊就诊记录
|
|
|
* @param patient 居民id
|
|
@ -920,12 +1018,19 @@ public class XzzxEntranceService{
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("registered params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
|
wlyyHttpLogDO.setName("挂号(调his后台包)");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info("registered json:"+json);
|
|
|
return json;
|
|
|
}
|
|
@ -1272,12 +1377,19 @@ public class XzzxEntranceService{
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("savePrescriptionToHospital params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setDoctor(ApplyDoctor);
|
|
|
wlyyHttpLogDO.setName("互联网医院开处方信息更新到his");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info(" savePrescriptionToHospital json:"+json);
|
|
|
return json;
|
|
|
}
|
|
@ -1311,12 +1423,12 @@ public class XzzxEntranceService{
|
|
|
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(NullahNumber)){
|
|
|
condition += "<NullahNumber>"+NullahNumber+"</NullahNumber>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(ApplyDoctor)){
|
|
|
condition += "<ApplyDoctor>"+ApplyDoctor+"</ApplyDoctor>";
|
|
|
}
|
|
@ -1330,12 +1442,18 @@ public class XzzxEntranceService{
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("delHisPrescriptionByHisNo params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setName("互联网医院删除处方信息更新到his");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info("delHisPrescriptionByHisNo json:"+json);
|
|
|
return json;
|
|
|
}
|
|
@ -1379,14 +1497,19 @@ public class XzzxEntranceService{
|
|
|
condition+="<ChnDiagnosisName>"+"</ChnDiagnosisName>";
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("saveDiagnosis params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setName("保存入门诊断信息到his");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info(" saveDiagnosis json:"+json);
|
|
|
return json;
|
|
|
}
|
|
@ -1416,14 +1539,19 @@ public class XzzxEntranceService{
|
|
|
}
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
logger.info("refundConsultation params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
wlyyHttpLogDO.setResponse(json);
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setName("发送退号信息到his");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
logger.info("refundConsultation json:"+json);
|
|
|
return json;
|
|
|
}
|
|
@ -1548,8 +1676,8 @@ public class XzzxEntranceService{
|
|
|
wlyyHttpLogDO.setDoctor(patientAndDoctor.getString("doctorId"));
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setRequest(postBody);
|
|
|
wlyyHttpLogDO.setName("合理用药审核接口");
|
|
|
wlyyHttpLogDO.setResponse(res);
|
|
|
wlyyHttpLogDO.setName("checkPrescriptionInEntrance");
|
|
|
return res;
|
|
|
}
|
|
|
/*
|
|
@ -1564,8 +1692,9 @@ public class XzzxEntranceService{
|
|
|
wlyyHttpLogDO.setDoctor(patientAndDoctor.getString("doctorId"));
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setRequest(postBody);
|
|
|
wlyyHttpLogDO.setName("合理用药保存接口");
|
|
|
wlyyHttpLogDO.setResponse(res);
|
|
|
wlyyHttpLogDO.setName("checkPrescriptionInEntrance");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
return res;
|
|
|
}
|
|
|
/*
|
|
@ -1582,7 +1711,8 @@ public class XzzxEntranceService{
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setRequest(postBody);
|
|
|
wlyyHttpLogDO.setResponse(res);
|
|
|
wlyyHttpLogDO.setName("checkPrescriptionInEntrance");
|
|
|
wlyyHttpLogDO.setName("合理用药作废接口");
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
return res;
|
|
|
}
|
|
|
public List<Map<String,Object>> transXmlCommen(String xml){
|
|
@ -1653,6 +1783,9 @@ public class XzzxEntranceService{
|
|
|
}
|
|
|
return personInfoVOS;
|
|
|
}
|
|
|
public String replaceHtml(String demoData,String oldChar,String newChar){
|
|
|
return demoData.replace(oldChar,null==newChar?"无":newChar);
|
|
|
}
|
|
|
/**
|
|
|
* 同步门诊病历
|
|
|
* @return
|
|
@ -1672,22 +1805,22 @@ public class XzzxEntranceService{
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("EMRHTMLDEMO");
|
|
|
if (null!=wlyyHospitalSysDictDO){
|
|
|
htmlDeo = wlyyHospitalSysDictDO.getDictValue();
|
|
|
htmlDeo = htmlDeo.replace("@patientName@",jsonObject.getString("patientName"));
|
|
|
htmlDeo = htmlDeo.replace("@patientAge@",jsonObject.getString("patientAge"));
|
|
|
htmlDeo = htmlDeo.replace("@patientsex@",jsonObject.getString("patientsex"));
|
|
|
htmlDeo = htmlDeo.replace("@deptCode@",jsonObject.getString("deptCode"));
|
|
|
htmlDeo = htmlDeo.replace("@r+outpatientCode@",jsonObject.getString("outpatientCode"));
|
|
|
htmlDeo = htmlDeo.replace("@patientClan@",jsonObject.getString("patientClan"));
|
|
|
htmlDeo = htmlDeo.replace("@Special@",prescriptionEmrDO.getSpecialHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientName@",jsonObject.getString("patientName"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientAge@",jsonObject.getString("patientAge"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientsex@",jsonObject.getString("patientsex"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@deptCode@",jsonObject.getString("deptCode"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@r+outpatientCode@",jsonObject.getString("outpatientCode"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientClan@",jsonObject.getString("patientClan"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@Special@",prescriptionEmrDO.getSpecialHistory());
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:MM");
|
|
|
htmlDeo = htmlDeo.replace("@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
|
|
|
htmlDeo = htmlDeo.replace("@complaint@",prescriptionEmrDO.getComplaint());
|
|
|
htmlDeo = htmlDeo.replace("@medicalHistory@",prescriptionEmrDO.getMedicalHistory());
|
|
|
htmlDeo = htmlDeo.replace("@popularHistory@",prescriptionEmrDO.getPopularHistory());
|
|
|
htmlDeo = htmlDeo.replace("@pastHistory@",prescriptionEmrDO.getPastHistory());
|
|
|
htmlDeo = htmlDeo.replace("@allergicHistory@",prescriptionEmrDO.getAllergicHistory());
|
|
|
htmlDeo = htmlDeo.replace("@physicalExamination@",prescriptionEmrDO.getPhysicalExamination());
|
|
|
htmlDeo = htmlDeo.replace("@assistExamination@",prescriptionEmrDO.getAssistExamination());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@complaint@",prescriptionEmrDO.getComplaint());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@medicalHistory@",prescriptionEmrDO.getMedicalHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@popularHistory@",prescriptionEmrDO.getPopularHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@pastHistory@",prescriptionEmrDO.getPastHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@allergicHistory@",prescriptionEmrDO.getAllergicHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@physicalExamination@",prescriptionEmrDO.getPhysicalExamination());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@assistExamination@",prescriptionEmrDO.getAssistExamination());
|
|
|
condition+="<content>"+htmlDeo+"</content>";
|
|
|
}
|
|
|
}
|
|
@ -1726,10 +1859,177 @@ public class XzzxEntranceService{
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
params.put("msgBody",msgBody);
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
wlyyHttpLogDO.setRequest(msgBody);
|
|
|
wlyyHttpLogDO.setName("保存电子病历");
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
logger.info("returnEmrHtmlByHLW params:"+params.toString());
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
logger.info("returnEmrHtmlByHLW json:"+xml);
|
|
|
wlyyHttpLogDO.setResponse(xml);
|
|
|
|
|
|
return xml;
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
* 获取历史病历
|
|
|
*
|
|
|
* @param patientId
|
|
|
* @param eventNo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String SelectEmrInfo(String patientId,String eventNo)throws Exception{
|
|
|
String api = "SelectEmrInfo";
|
|
|
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(patientId)){
|
|
|
condition += "<patientId>"+patientId+"</patientId>";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(eventNo)&&!"null".equalsIgnoreCase(eventNo)){
|
|
|
condition += "<eventNo>"+eventNo+"</eventNo>";
|
|
|
}
|
|
|
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("SelectEmrInfo params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
logger.info("SelectEmrInfo json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
* 获取历史病历
|
|
|
*
|
|
|
* @param patientId
|
|
|
* @param eventNo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String SelectEmrDispRecord(String templateId,String patientId,String eventNo)throws Exception{
|
|
|
String api = "SelectEmrDispRecord";
|
|
|
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(templateId)){
|
|
|
condition += "<template_id>"+templateId+"</template_id>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(patientId)){
|
|
|
condition += "<patientId>"+patientId+"</patientId>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(eventNo)){
|
|
|
condition += "<eventNo>"+eventNo+"</eventNo>";
|
|
|
}
|
|
|
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("SelectEmrDispRecord params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
/* XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();*/
|
|
|
logger.info("SelectEmrDispRecord json:"+xml);
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 查询病历文书列表
|
|
|
*
|
|
|
* @param patientId
|
|
|
* @param eventNo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String GetEMRList(String patientId,String eventNo)throws Exception{
|
|
|
String api = "GetEMRList";
|
|
|
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(patientId)){
|
|
|
condition += "<patientId>"+patientId+"</patientId>";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(eventNo)){
|
|
|
condition += "<eventNo>"+eventNo+"</eventNo>";
|
|
|
}
|
|
|
condition +="<lngCatalogID>50</lngCatalogID>";
|
|
|
condition +="<lngEMRType>93</lngEMRType>";
|
|
|
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("GetEMRList params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
/* XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();*/
|
|
|
logger.info("GetEMRList json:"+xml);
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 查询病历文书列表
|
|
|
*
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String BrowseSingleEMR(String bstrEmrID)throws Exception{
|
|
|
String api = "BrowseSingleEMR";
|
|
|
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(bstrEmrID)){
|
|
|
condition += "<bstrEmrID>"+bstrEmrID+"</bstrEmrID>";
|
|
|
}
|
|
|
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("BrowseSingleEMR params:"+params.toString());
|
|
|
|
|
|
String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
|
|
|
|
|
|
/* XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
String json = xmlSerializer.read(xml).toString();*/
|
|
|
logger.info("BrowseSingleEMR json:"+xml);
|
|
|
return xml;
|
|
|
}
|
|
|
//=====================微信模板消息推送===================================
|
|
@ -1882,7 +2182,19 @@ public class XzzxEntranceService{
|
|
|
if(object.getInteger("status")==200){
|
|
|
String obj = object.getString("obj");
|
|
|
JSONArray array = JSONArray.parseArray(obj).getJSONArray(0);
|
|
|
if (array!=null&&array.size()!=0){
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
JSONObject jsonObject = array.getJSONObject(i);
|
|
|
String cardType = jsonObject.getString("CARD_TYPE");
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = wlyyHospitalSysDictDao.findByHospitalAndDictCode("350211A5010",jsonObject.getString("CARD_TYPE"));
|
|
|
if (hospitalSysDictDO!=null){
|
|
|
jsonObject.put("CARD_TYPE",hospitalSysDictDO.getDictValue());
|
|
|
jsonObject.put("CARD_TYPE_HIS",cardType);
|
|
|
}else {
|
|
|
jsonObject.put("CARD_TYPE",null);
|
|
|
jsonObject.put("CARD_TYPE_HIS",cardType);
|
|
|
}
|
|
|
}
|
|
|
/*if (array!=null&&array.size()!=0){
|
|
|
JSONObject object1 = array.getJSONObject(0);
|
|
|
if (patientMappingDO==null){
|
|
|
patientMappingDO = new PatientMappingDO();
|
|
@ -1896,7 +2208,39 @@ public class XzzxEntranceService{
|
|
|
patientMappingDO.setMappingCode(object1.getString("SICKID"));
|
|
|
}
|
|
|
patientMappingDao.save(patientMappingDO);
|
|
|
}
|
|
|
}*/
|
|
|
return array;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
/**
|
|
|
* 查询患者就诊卡
|
|
|
* @param idCard 居民code
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray selectPateintCardByIdCard(String idCard) throws Exception {
|
|
|
String response="";
|
|
|
String url = entranceUrl+"findPatientCard?idCard="+idCard;
|
|
|
response = httpClientUtil.get(url,"GBK");
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if(object.getInteger("status")==200){
|
|
|
String obj = object.getString("obj");
|
|
|
JSONArray array = JSONArray.parseArray(obj).getJSONArray(0);
|
|
|
/*if (array!=null&&array.size()!=0){
|
|
|
JSONObject object1 = array.getJSONObject(0);
|
|
|
if (patientMappingDO==null){
|
|
|
patientMappingDO = new PatientMappingDO();
|
|
|
patientMappingDO.setIdcard(patientDO.getIdcard());
|
|
|
patientMappingDO.setPatientName(patientDO.getName());
|
|
|
patientMappingDO.setPatient(patientDO.getId());
|
|
|
patientMappingDO.setCreateTime(new Date());
|
|
|
patientMappingDO.setSource("1");
|
|
|
patientMappingDO.setMappingCode(object1.getString("SICKID"));
|
|
|
}else {
|
|
|
patientMappingDO.setMappingCode(object1.getString("SICKID"));
|
|
|
}
|
|
|
patientMappingDao.save(patientMappingDO);
|
|
|
}*/
|
|
|
return array;
|
|
|
}
|
|
|
return null;
|
|
@ -2000,7 +2344,6 @@ public class XzzxEntranceService{
|
|
|
}
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
public String savePatientMapping(String patient){
|
|
|
BasePatientDO patientDO = patientDao.findById(patient);
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
|
|
@ -2030,7 +2373,6 @@ public class XzzxEntranceService{
|
|
|
}
|
|
|
return patientMappingDO.getMappingCode();
|
|
|
}
|
|
|
|
|
|
public String updatePatientMapping(String patient,String cardNo){
|
|
|
BasePatientDO patientDO = patientDao.findById(patient);
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
|
|
@ -2044,7 +2386,9 @@ public class XzzxEntranceService{
|
|
|
JSONArray array = JSONArray.parseArray(obj).getJSONArray(0);
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
JSONObject object1 = array.getJSONObject(i);
|
|
|
logger.info("判断卡号是否相同:"+object1.getString("CARD_NO")+"cardNo:"+cardNo);
|
|
|
if (object1.getString("CARD_NO").equalsIgnoreCase(cardNo)){
|
|
|
logger.info("卡号相同");
|
|
|
if (patientMappingDO==null){
|
|
|
patientMappingDO = new PatientMappingDO();
|
|
|
patientMappingDO.setIdcard(patientDO.getIdcard());
|
|
@ -2069,16 +2413,11 @@ public class XzzxEntranceService{
|
|
|
* @param patient 居民id
|
|
|
* @return
|
|
|
*/
|
|
|
public List<WlyyOutpatientVO> selectOutpatientList(String patient,String startTime,String endTime){
|
|
|
public List<WlyyOutpatientVO> selectOutpatientList(String patient,String startTime,String endTime,String cardNo) throws Exception {
|
|
|
List<WlyyOutpatientVO> wlyyOutpatientVOList = new ArrayList<>();
|
|
|
JSONArray array = new JSONArray();
|
|
|
String response="";
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
|
|
|
if (patientMappingDO!=null){
|
|
|
patient = patientMappingDO.getMappingCode();
|
|
|
}else {
|
|
|
patient = savePatientMapping(patient);
|
|
|
}
|
|
|
patient = updatePatientMapping(patient,cardNo);
|
|
|
String url = entranceUrl+"findOutpatientInfo?patient="+patient+"&startTime="+startTime+"&endTime="+endTime;
|
|
|
response = httpClientUtil.get(url,"GBK");
|
|
|
logger.info("response:"+response);
|
|
@ -2423,6 +2762,14 @@ public class XzzxEntranceService{
|
|
|
}
|
|
|
wlyyPrescriptionVO.setInspectionVOs(wlyyInspectionVOList);
|
|
|
}
|
|
|
try {
|
|
|
List<WlyyPrescriptionEmrDO> listEmr = selectHistoryEmr(patNo,"");
|
|
|
if (null!=listEmr&&listEmr.size()>0){
|
|
|
wlyyPrescriptionVO.setWlyyPrescriptionEmrDO(listEmr.get(0));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
prescriptionVOList.add(wlyyPrescriptionVO);
|
|
|
}
|
|
|
}
|
|
@ -2662,6 +3009,7 @@ public class XzzxEntranceService{
|
|
|
return jsonArray;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取药品字典
|
|
|
* @param spellCode 拼音码
|
|
@ -3043,12 +3391,12 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
|
|
|
if (null!=wlyyOutpatientDO){
|
|
|
params.put("PayCardNo",wlyyOutpatientDO.getCardNo());
|
|
|
params.put("NullahNumber",wlyyOutpatientDO.getRegisterNo());
|
|
|
params.put("ApplyDept",wlyyOutpatientDO.getDept());
|
|
|
params.put("NullahNumber",wlyyOutpatientDO.getRegisterNo());
|
|
|
}
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(wlyyPrescriptionDO.getDoctor());
|
|
|
if (null!=doctorMappingDO){
|
|
|
params.put("ApplyDoctor",doctorMappingDO.getMappingCode());
|
|
|
params.put("ApplyDoctor",doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode());
|
|
|
}
|
|
|
params.put("ExecuteDept","50100");
|
|
|
params.put("PresNo",realOrder);
|
|
@ -3071,7 +3419,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject saveEmrToEntrance(String prescriptionId) throws Exception {
|
|
|
public String saveEmrToEntrance(String prescriptionId) throws Exception {
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
|
|
|
JSONObject paramRequest = new JSONObject();
|
|
@ -3084,8 +3432,24 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
if(null!=patientMappingDO){
|
|
|
paramRequest.put("patientid",patientMappingDO.getMappingCode());
|
|
|
}
|
|
|
//获取医生编号
|
|
|
BaseDoctorDO doctorDO = doctorDao.findById(wlyyOutpatientDO.getDoctor());
|
|
|
String operatorId = null;
|
|
|
if (doctorDO!=null){
|
|
|
String url = entranceUrl+"selectDoctorInfo?idCard="+doctorDO.getIdcard();
|
|
|
String response = httpClientUtil.get(url,"GBK");
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if(object.getInteger("status")==200){
|
|
|
String obj = object.getString("obj");
|
|
|
JSONArray array = JSONArray.parseArray(obj);
|
|
|
if (array!=null&&array.size()!=0){
|
|
|
JSONObject jsonObject = array.getJSONObject(0);
|
|
|
operatorId = jsonObject.getString("staffNo");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if(null!=doctorMappingDO){
|
|
|
paramRequest.put("operatorid",doctorMappingDO.getMappingCode());
|
|
|
paramRequest.put("operatorid",operatorId);
|
|
|
paramRequest.put("operatorname",wlyyPrescriptionDO.getDoctorName());
|
|
|
}
|
|
|
paramRequest.put("type","2");
|
|
@ -3098,34 +3462,149 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
paramRequest.put("patientAge",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
|
|
|
paramRequest.put("patientsex",IdCardUtil.getSexForIdcard(basePatientDO.getIdcard()));
|
|
|
paramRequest.put("patientName",basePatientDO.getName());
|
|
|
paramRequest.put("patientClan","0");
|
|
|
}
|
|
|
paramRequest.put("patientClan","0"); }
|
|
|
if (null!=wlyyOutpatientDO){
|
|
|
paramRequest.put("deptCode",wlyyOutpatientDO.getDept());
|
|
|
paramRequest.put("outpatientCode","R"+wlyyOutpatientDO.getRegisterNo());
|
|
|
paramRequest.put("eventno","R"+wlyyOutpatientDO.getRegisterNo());
|
|
|
}
|
|
|
paramRequest.put("templateid","662");
|
|
|
paramRequest.put("templateid","1158");
|
|
|
paramRequest.put("catalogid","50");
|
|
|
paramRequest.put("emrtype","0");
|
|
|
paramRequest.put("emrtype","93");
|
|
|
paramRequest.put("emrtitle","互联网医院");
|
|
|
|
|
|
|
|
|
}
|
|
|
params.put("jsonInfo",paramRequest.toJSONString());
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
String response = "";
|
|
|
String url = entranceUrl+"returnEmrHtmlByHLW";
|
|
|
|
|
|
logger.info("params"+params.toString());
|
|
|
response = httpClientUtil.httpPost(url,params);
|
|
|
logger.info("保存电子病历"+response);
|
|
|
if (response.contains("error")||response.contains("ERROR")){
|
|
|
return "faild";
|
|
|
}else {
|
|
|
return "success";
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
* 获取历史病历
|
|
|
* @param patientId 病人id
|
|
|
* @param eventNo 病人住院号
|
|
|
* @return
|
|
|
*/
|
|
|
public List<WlyyPrescriptionEmrDO> selectHistoryEmr(String patientId,String eventNo) throws Exception {
|
|
|
String response="";
|
|
|
String url = entranceUrl+"selectEmrInfo?patientId="+patientId+"&eventNo="+eventNo;
|
|
|
response = httpClientUtil.get(url,"GBK");
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
List<WlyyPrescriptionEmrDO> wlyyPrescriptionEmrDOList = new ArrayList<>();
|
|
|
if(object.getInteger("status")==200){
|
|
|
jsonObject = object.getJSONObject("obj");
|
|
|
String obj = object.getString("obj");
|
|
|
if("[[]]".equalsIgnoreCase(obj)||"[]".equalsIgnoreCase(obj)||StringUtils.isBlank(obj)){
|
|
|
return null;
|
|
|
}else {
|
|
|
logger.info("obj:" + obj);
|
|
|
JSONArray array = JSONArray.parseArray(obj.replace("[]", "\"\"")).getJSONArray(0);
|
|
|
logger.info("arrayResponse:" + array.toJSONString());
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject jsonObject = array.getJSONObject(i);
|
|
|
logger.info("jsonObject:" + jsonObject);
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = new WlyyPrescriptionEmrDO();
|
|
|
wlyyPrescriptionEmrDO.setComplaint(null == jsonObject.get("CHIEF_COMPLAINT") ? "" : jsonObject.get("CHIEF_COMPLAINT").toString());
|
|
|
wlyyPrescriptionEmrDO.setMedicalHistory(null == jsonObject.get("PRESENT_ILLNESS") ? "" : jsonObject.get("PRESENT_ILLNESS").toString());
|
|
|
wlyyPrescriptionEmrDO.setPastHistory(null == jsonObject.get("PAST_HISTORY") ? "" : jsonObject.get("PAST_HISTORY").toString());
|
|
|
wlyyPrescriptionEmrDO.setPhysicalExamination(null == jsonObject.get("PHYSICAL_EXAMINATION") ? "" : jsonObject.get("PHYSICAL_EXAMINATION").toString());
|
|
|
wlyyPrescriptionEmrDO.setAssistExamination(null == jsonObject.get("OBSERVE_RESULT") ? "" : jsonObject.get("OBSERVE_RESULT").toString());
|
|
|
wlyyPrescriptionEmrDO.setAllergicHistory(null == jsonObject.get("ALLERGY_HISTORY") ? "" : jsonObject.get("ALLERGY_HISTORY").toString());
|
|
|
wlyyPrescriptionEmrDOList.add(wlyyPrescriptionEmrDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return wlyyPrescriptionEmrDOList;
|
|
|
}
|
|
|
/**
|
|
|
* 查询历次就诊门诊病历文书
|
|
|
* @param templateId
|
|
|
* @param patientId 病人id
|
|
|
* @param eventNo 病人住院号
|
|
|
* @return
|
|
|
*/
|
|
|
public String selectHistoryEmrRecord(String templateId,String patientId,String eventNo) throws Exception {
|
|
|
String response="";
|
|
|
String url = entranceUrl+"selectEmrDispRecord?templateId="+templateId+"&patientId="+patientId+"&eventNo="+eventNo;
|
|
|
response = httpClientUtil.get(url,"GBK");
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if(object.getInteger("status")==200){
|
|
|
String obj = object.getString("obj");
|
|
|
return obj;
|
|
|
}else {
|
|
|
return "获取失败";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public JSONArray selectHistoryEmrFromEntrance(String patientId,String eventNo) throws Exception {
|
|
|
String response="";
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
PatientMappingDO mappingDO = patientMappingDao.findByPatient(patientId);
|
|
|
String patient = null;
|
|
|
if (mappingDO!=null){
|
|
|
patient = mappingDO.getMappingCode();
|
|
|
}
|
|
|
String url = entranceUrl+"selectEmrInfo?patientId="+patient+"&eventNo="+eventNo;
|
|
|
response = httpClientUtil.get(url,"GBK");
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
List<WlyyPrescriptionEmrDO> wlyyPrescriptionEmrDOList = new ArrayList<>();
|
|
|
if(object.getInteger("status")==200){
|
|
|
String obj = object.getString("obj");
|
|
|
if("[[]]".equalsIgnoreCase(obj)||"[]".equalsIgnoreCase(obj)||StringUtils.isBlank(obj)){
|
|
|
return null;
|
|
|
}else {
|
|
|
logger.info("obj:"+obj);
|
|
|
JSONArray array = JSONArray.parseArray(obj.replace("[]","\"\"")).getJSONArray(0);
|
|
|
logger.info("arrayResponse:"+array.toJSONString());
|
|
|
for (int j=0;j<array.size();j++){
|
|
|
JSONObject object1 = array.getJSONObject(j);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("DEPT_NAME",object1.getString("DEPT_NAME"));
|
|
|
jsonObject.put("TREAT_DATE_TIME",DateUtil.getYyyymmddhhmmss(DateUtil.strToDateLong(object1.getString("VISIT_TIME"))));
|
|
|
jsonObject.put("OPID",object1.getString("EMR_ID"));
|
|
|
String firstFlag = object1.getString("FIRST_FLAG");
|
|
|
if (firstFlag.equalsIgnoreCase("复诊")){
|
|
|
jsonObject.put("TREAT_DOCTOR_NAME",object1.getString("RETURN_DOC_SIGN"));
|
|
|
}else if (firstFlag.equalsIgnoreCase("初诊")){
|
|
|
jsonObject.put("TREAT_DOCTOR_NAME",object1.getString("DOCTOR_SIGNATURE"));
|
|
|
}
|
|
|
jsonArray.add(jsonObject);
|
|
|
}
|
|
|
return jsonArray;
|
|
|
}
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询病历文书html信息
|
|
|
* @param bstrEmrID
|
|
|
* @return
|
|
|
*/
|
|
|
public String selectBrowseSingleEMR(String bstrEmrID) throws Exception {
|
|
|
String response="";
|
|
|
String url = entranceUrl+"browseSingleEMR?bstrEmrID="+bstrEmrID;
|
|
|
response = httpClientUtil.get(url,"GBK");
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if(object.getInteger("status")==200){
|
|
|
String obj = object.getString("obj");
|
|
|
return obj;
|
|
|
}else {
|
|
|
return "获取失败";
|
|
|
}
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
//=====================hospital应用调用entrance应用============end=================
|
|
|
|
|
|
|
|
@ -3525,7 +4004,11 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
if (null != patientMappingDO && null != basePatientDO) {
|
|
|
jsonObject.put("PATIENT_ID", patientMappingDO.getMappingCode());
|
|
|
jsonObject.put("GENDER", basePatientDO.getSex()==1?"男":"女");
|
|
|
if (null!=basePatientDO.getSex()){
|
|
|
jsonObject.put("GENDER", 1==basePatientDO.getSex()?"男":"女");
|
|
|
}else{
|
|
|
jsonObject.put("GENDER", "男");
|
|
|
}
|
|
|
jsonObject.put("BIRTH", sdf.format(basePatientDO.getBirthday()));
|
|
|
}
|
|
|
jsonObject.put("FEE_TYPE", "1".equalsIgnoreCase(payType) ? "医保" : "自费");
|