|
@ -719,83 +719,81 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
*/
|
|
|
public Integer GetOrderStatus(String hospitalId,String orderId,String clinicCard) throws Exception
|
|
|
{
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
|
|
sb.append("<root>");
|
|
|
sb.append("<org_code>").append(hospitalId).append("</org_code>");
|
|
|
sb.append("<resid>").append(orderId).append("</resid>");
|
|
|
sb.append("<ssid>").append(clinicCard).append("</ssid>");
|
|
|
sb.append("</root>");
|
|
|
|
|
|
String[] values = SOAPUtil.getCredential(sb.toString(), true);
|
|
|
Integer re = null;
|
|
|
try {
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
|
|
sb.append("<root>");
|
|
|
sb.append("<org_code>").append(hospitalId).append("</org_code>");
|
|
|
sb.append("<resid>").append(orderId).append("</resid>");
|
|
|
sb.append("<ssid>").append(clinicCard).append("</ssid>");
|
|
|
sb.append("</root>");
|
|
|
|
|
|
JSONArray params = new JSONArray();
|
|
|
String[] values = SOAPUtil.getCredential(sb.toString(), true);
|
|
|
|
|
|
JSONObject param1 = new JSONObject();
|
|
|
param1.put("key", "?strCondition");
|
|
|
param1.put("value", values[0]);
|
|
|
params.put(param1);
|
|
|
JSONArray params = new JSONArray();
|
|
|
|
|
|
JSONObject param2 = new JSONObject();
|
|
|
param2.put("key", "?strCredential");
|
|
|
param2.put("value", values[1]);
|
|
|
params.put(param2);
|
|
|
JSONObject param1 = new JSONObject();
|
|
|
param1.put("key", "?strCondition");
|
|
|
param1.put("value", values[0]);
|
|
|
params.put(param1);
|
|
|
|
|
|
JSONObject param3 = new JSONObject();
|
|
|
param3.put("key", "?strKey");
|
|
|
param3.put("value", values[2]);
|
|
|
params.put(param3);
|
|
|
JSONObject param2 = new JSONObject();
|
|
|
param2.put("key", "?strCredential");
|
|
|
param2.put("value", values[1]);
|
|
|
params.put(param2);
|
|
|
|
|
|
String xml = SOAPUtil.post(ORDER_INFO, params);
|
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
// 请求失败
|
|
|
throw new Exception("获取预约状态失败!");
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
// 调用失败
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
}
|
|
|
else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
// 调用失败
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
}
|
|
|
JSONObject param3 = new JSONObject();
|
|
|
param3.put("key", "?strKey");
|
|
|
param3.put("value", values[2]);
|
|
|
params.put(param3);
|
|
|
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();
|
|
|
if(child!=null)
|
|
|
{
|
|
|
Integer re = null;
|
|
|
Element obj = (Element) child.get(0);
|
|
|
String status = obj.attributeValue("status");
|
|
|
String xml = SOAPUtil.post(ORDER_INFO, params);
|
|
|
if (StringUtils.isEmpty(xml)) {
|
|
|
// 请求失败
|
|
|
throw new Exception("获取预约状态失败!");
|
|
|
} else if (StringUtils.startsWith(xml, "System-Error")) {
|
|
|
// 调用失败
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
} else if (StringUtils.startsWith(xml, "Error")) {
|
|
|
// 调用失败
|
|
|
throw new Exception(xml.substring(xml.indexOf(":") + 1, xml.length()));
|
|
|
}
|
|
|
|
|
|
switch (status)
|
|
|
{
|
|
|
case "撤销":
|
|
|
{
|
|
|
re=0;
|
|
|
break;
|
|
|
}
|
|
|
case "确认":
|
|
|
{
|
|
|
re=1;
|
|
|
break;
|
|
|
}
|
|
|
case "已诊":
|
|
|
{
|
|
|
re = 2;
|
|
|
break;
|
|
|
}
|
|
|
case "停诊":
|
|
|
{
|
|
|
re = 3;
|
|
|
break;
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();
|
|
|
if (child != null) {
|
|
|
Element obj = (Element) child.get(0);
|
|
|
String status = obj.attributeValue("status");
|
|
|
|
|
|
switch (status) {
|
|
|
case "撤销": {
|
|
|
re = 0;
|
|
|
break;
|
|
|
}
|
|
|
case "确认": {
|
|
|
re = 1;
|
|
|
break;
|
|
|
}
|
|
|
case "已诊": {
|
|
|
re = 2;
|
|
|
break;
|
|
|
}
|
|
|
case "停诊": {
|
|
|
re = 3;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("获取预约状态失败!");
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception("获取预约状态失败!");
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ex.printStackTrace();
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -804,6 +802,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
public List<PatientReservation> GetRegList(String patientCode,String strStart,String strEnd) throws Exception
|
|
|
{
|
|
|
Patient patient = patientService.findByCode(patientCode);
|
|
|
if(patient==null){
|
|
|
throw new Exception("不存在该用户!");
|
|
|
}
|
|
|
|
|
|
//获取签名信息
|
|
|
List<PatientReservation> patientRegList = new ArrayList<>();
|
|
|
String[] values = SOAPUtil.getCredential(null, true);
|
|
@ -845,67 +847,69 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();
|
|
|
|
|
|
if(patient==null){
|
|
|
throw new Exception("获取挂号人员信息失败!");
|
|
|
}
|
|
|
for (Object o : child) {
|
|
|
Element e = (Element) o;
|
|
|
// 医生编码
|
|
|
String regdate = e.attributeValue("regdate");//预约日期
|
|
|
String time = e.attributeValue("time");//a or p 上下午
|
|
|
|
|
|
String regBegin = e.attributeValue("start_time");//预约时间段的开始时间
|
|
|
String regEnd = e.attributeValue("end_time");//预约时间段的结束时间
|
|
|
String orgID = e.attributeValue("orgID");//机构ID
|
|
|
String OrgCode = e.attributeValue("OrgCode");//医疗机构编码
|
|
|
String org = e.attributeValue("org");//医疗机构名称
|
|
|
String DeptCode = e.attributeValue("DeptCode");//科室代码
|
|
|
String dept =e.attributeValue("dept");//科室
|
|
|
String DoctorCode = e.attributeValue("DoctorCode");//医生代码
|
|
|
String doctor = e.attributeValue("doctor");//医生
|
|
|
String Introduction = e.attributeValue("Introduction");//医生简介
|
|
|
String status = e.attributeValue("status");//状态:删除、新建、确认、已诊
|
|
|
String enter_time = e.attributeValue("enter_time");//预约登记时间
|
|
|
String notes = e.attributeValue("notes");//备注
|
|
|
String code = e.getText();//预约号
|
|
|
PatientReservation patientReservation = new PatientReservation();
|
|
|
patientReservation.setCode(code);
|
|
|
patientReservation.setSectionType(time);
|
|
|
|
|
|
patientReservation.setCzrq(dateFormat.parse(enter_time));
|
|
|
patientReservation.setDeptCode(DeptCode);
|
|
|
patientReservation.setDeptName(dept);
|
|
|
patientReservation.setDoctorCode(DoctorCode);
|
|
|
patientReservation.setDoctorName(doctor);
|
|
|
patientReservation.setStartTime(regBegin);
|
|
|
patientReservation.setEndTime(regEnd);
|
|
|
patientReservation.setOrgCode(OrgCode);
|
|
|
patientReservation.setOrgName(org);
|
|
|
patientReservation.setType("1");
|
|
|
patientReservation.setPatient(patient.getCode());
|
|
|
patientReservation.setName(patient.getName());
|
|
|
patientReservation.setIdcard(patient.getIdcard());
|
|
|
patientReservation.setPhone(patient.getMobile());
|
|
|
switch (status){
|
|
|
case "删除":
|
|
|
patientReservation.setStatus(0);
|
|
|
break;
|
|
|
case "新建":
|
|
|
patientReservation.setStatus(1);
|
|
|
break;
|
|
|
case "确认":
|
|
|
patientReservation.setStatus(2);
|
|
|
break;
|
|
|
case "已诊":
|
|
|
patientReservation.setStatus(3);
|
|
|
break;
|
|
|
default:patientReservation.setStatus(4);
|
|
|
};
|
|
|
patientReservation.setSsc(patient.getSsc());
|
|
|
GuahaoDoctor guahaoDoctor = GetDoctorInfo(DoctorCode, OrgCode, DeptCode);
|
|
|
patientReservation.setDoctorPhoto(guahaoDoctor.getPhoto());//照片
|
|
|
patientReservation.setDoctorJob(guahaoDoctor.getTitle());//职称
|
|
|
patientRegList.add(patientReservation);
|
|
|
if(child.size()>0) {
|
|
|
for (Object o : child) {
|
|
|
Element e = (Element) o;
|
|
|
// 医生编码
|
|
|
String regdate = e.attributeValue("regdate");//预约日期
|
|
|
String time = e.attributeValue("time");//a or p 上下午
|
|
|
|
|
|
String regBegin = e.attributeValue("start_time");//预约时间段的开始时间
|
|
|
String regEnd = e.attributeValue("end_time");//预约时间段的结束时间
|
|
|
String orgID = e.attributeValue("orgID");//机构ID
|
|
|
String OrgCode = e.attributeValue("OrgCode");//医疗机构编码
|
|
|
String org = e.attributeValue("org");//医疗机构名称
|
|
|
String DeptCode = e.attributeValue("DeptCode");//科室代码
|
|
|
String dept = e.attributeValue("dept");//科室
|
|
|
String DoctorCode = e.attributeValue("DoctorCode");//医生代码
|
|
|
String doctor = e.attributeValue("doctor");//医生
|
|
|
String Introduction = e.attributeValue("Introduction");//医生简介
|
|
|
String status = e.attributeValue("status");//状态:删除、新建、确认、已诊
|
|
|
String enter_time = e.attributeValue("enter_time");//预约登记时间
|
|
|
String notes = e.attributeValue("notes");//备注
|
|
|
String code = e.getText();//预约号
|
|
|
PatientReservation patientReservation = new PatientReservation();
|
|
|
patientReservation.setCode(code);
|
|
|
patientReservation.setSectionType(time);
|
|
|
|
|
|
patientReservation.setCzrq(dateFormat.parse(enter_time));
|
|
|
patientReservation.setDeptCode(DeptCode);
|
|
|
patientReservation.setDeptName(dept);
|
|
|
patientReservation.setDoctorCode(DoctorCode);
|
|
|
patientReservation.setDoctorName(doctor);
|
|
|
patientReservation.setStartTime(regBegin);
|
|
|
patientReservation.setEndTime(regEnd);
|
|
|
patientReservation.setOrgCode(OrgCode);
|
|
|
patientReservation.setOrgName(org);
|
|
|
patientReservation.setType("1");
|
|
|
patientReservation.setPatient(patientCode);
|
|
|
patientReservation.setName(patient.getName());
|
|
|
patientReservation.setIdcard(patient.getIdcard());
|
|
|
patientReservation.setPhone(patient.getMobile());
|
|
|
switch (status) {
|
|
|
case "删除":
|
|
|
patientReservation.setStatus(0);
|
|
|
break;
|
|
|
case "新建":
|
|
|
patientReservation.setStatus(1);
|
|
|
break;
|
|
|
case "确认":
|
|
|
patientReservation.setStatus(2);
|
|
|
break;
|
|
|
case "已诊":
|
|
|
patientReservation.setStatus(3);
|
|
|
break;
|
|
|
default:
|
|
|
patientReservation.setStatus(4);
|
|
|
}
|
|
|
;
|
|
|
patientReservation.setSsc(patient.getSsc());
|
|
|
GuahaoDoctor guahaoDoctor = GetDoctorInfo(DoctorCode, OrgCode, DeptCode);
|
|
|
patientReservation.setDoctorPhoto(guahaoDoctor.getPhoto());//照片
|
|
|
patientReservation.setDoctorJob(guahaoDoctor.getTitle());//职称
|
|
|
patientRegList.add(patientReservation);
|
|
|
}
|
|
|
}
|
|
|
return patientRegList;
|
|
|
}
|
|
@ -960,6 +964,9 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
if(patient==null){
|
|
|
throw new Exception("获取挂号人员信息失败!");
|
|
|
}
|
|
|
|
|
|
if(child.size()>0)
|
|
|
{
|
|
|
Element e = (Element) child.get(0);
|
|
|
// 医生编码
|
|
|
String regdate = e.attributeValue("regdate");//预约日期
|
|
@ -1017,6 +1024,10 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
patientReservation.setDoctorPhoto(guahaoDoctor.getPhoto());//照片
|
|
|
patientReservation.setDoctorJob(guahaoDoctor.getTitle());//职称
|
|
|
return patientReservation;
|
|
|
}
|
|
|
else{
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|