|
@ -723,8 +723,9 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
/**
|
|
|
* 根据患者医保卡获取近三个月的预约记录
|
|
|
*/
|
|
|
public List<PatientReservation> GetRegList(String strSSID,String strStart,String strEnd) throws Exception
|
|
|
public List<PatientReservation> GetRegList(String patientCode,String strStart,String strEnd) throws Exception
|
|
|
{
|
|
|
Patient patient = patientService.findByCode(patientCode);
|
|
|
//获取签名信息
|
|
|
List<PatientReservation> patientRegList = new ArrayList<>();
|
|
|
String[] values = SOAPUtil.getCredential(null, true);
|
|
@ -732,7 +733,7 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
JSONArray params = new JSONArray();
|
|
|
JSONObject param1 = new JSONObject();
|
|
|
param1.put("key", "?strSSID");
|
|
|
param1.put("value", strSSID);
|
|
|
param1.put("value", patient.getSsc());
|
|
|
params.put(param1);
|
|
|
JSONObject param2 = new JSONObject();
|
|
|
param2.put("key", "?strStart");
|
|
@ -761,7 +762,7 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();
|
|
|
Patient patient = patientService.findBySsc(strSSID);
|
|
|
|
|
|
if(patient==null){
|
|
|
throw new Exception("获取挂号人员信息失败!");
|
|
|
}
|
|
@ -818,9 +819,117 @@ public class GuahaoXMService implements IGuahaoService {
|
|
|
break;
|
|
|
default:patientReservation.setStatus(4);
|
|
|
};
|
|
|
patientReservation.setSsc(strSSID);
|
|
|
patientReservation.setSsc(patient.getSsc());
|
|
|
GuahaoDoctor guahaoDoctor = GetDoctorInfo(DoctorCode, OrgCode, DeptCode);
|
|
|
patientReservation.setDoctorPhoto(guahaoDoctor.getPhoto());//照片
|
|
|
patientReservation.setDoctorJob(guahaoDoctor.getTitle());//职称
|
|
|
patientRegList.add(patientReservation);
|
|
|
}
|
|
|
return patientRegList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据患者,预约编号,机构编号获取单条记录预约记录
|
|
|
*/
|
|
|
public PatientReservation getRegDetail(String patientCode,String orgCode,String regCode) throws Exception
|
|
|
{
|
|
|
//获取签名信息
|
|
|
Patient patient = patientService.findByCode(patientCode);
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
|
|
sb.append("<root>");
|
|
|
sb.append("<org_code>").append(orgCode).append("</org_code>");
|
|
|
sb.append("<resid>").append(regCode).append("</resid>");
|
|
|
sb.append("<ssid>").append(patient.getSsc()).append("</ssid>");
|
|
|
sb.append("</root>");
|
|
|
|
|
|
String[] values = SOAPUtil.getCredential(sb.toString(), true);
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
JSONArray params = new JSONArray();
|
|
|
JSONObject param1 = new JSONObject();
|
|
|
param1.put("key", "?strCondition");
|
|
|
param1.put("value", values[0]);
|
|
|
params.put(param1);
|
|
|
JSONObject param2 = new JSONObject();
|
|
|
param2.put("key", "?strCredential");
|
|
|
param2.put("value", values[1]);
|
|
|
params.put(param2);
|
|
|
JSONObject param3 = new JSONObject();
|
|
|
param3.put("key", "?strKey");
|
|
|
param3.put("value", values[2]);
|
|
|
params.put(param3);
|
|
|
|
|
|
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()));
|
|
|
}
|
|
|
Document document = DocumentHelper.parseText(xml);
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();
|
|
|
|
|
|
if(patient==null){
|
|
|
throw new Exception("获取挂号人员信息失败!");
|
|
|
}
|
|
|
Element e = (Element) child.get(0);
|
|
|
// 医生编码
|
|
|
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("org_id");//机构ID
|
|
|
String OrgCode = e.attributeValue("org_code");//医疗机构编码
|
|
|
String org = e.attributeValue("org_name");//医疗机构名称
|
|
|
String DeptCode = e.attributeValue("dept_code");//科室代码
|
|
|
String dept =e.attributeValue("dept_name");//科室
|
|
|
String DoctorCode = e.attributeValue("doctor_code");//医生代码
|
|
|
String doctor = e.attributeValue("doctor_name");//医生
|
|
|
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());//职称
|
|
|
return patientReservation;
|
|
|
}
|
|
|
}
|