|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.wlyy.entity.dict.SystemDict;
|
|
|
import com.yihu.wlyy.service.system.SystemDictService;
|
|
|
import com.yihu.wlyy.service.third.ehr.EhrService;
|
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoDoctor;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
import com.yihu.wlyy.util.SystemConf;
|
|
@ -345,49 +346,6 @@ public class JwSmjkService {
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
public String responseStr(String response) throws Exception{
|
|
|
String re = "";
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray("data");
|
|
|
re = jsonArray.toString();
|
|
|
// re = jsonObject.getString("data");
|
|
|
} else {
|
|
|
String msg = "处理失败,请联系管理员";
|
|
|
if(!jsonObject.isNull("msg")){
|
|
|
msg = jsonObject.getString("msg");
|
|
|
}
|
|
|
throw new Exception(msg);
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
public Boolean responseBool(String response) throws Exception{
|
|
|
boolean re = false;
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
re = jsonObject.getBoolean("data");
|
|
|
} else {
|
|
|
String msg = "处理失败,请联系管理员";
|
|
|
if(!jsonObject.isNull("msg")){
|
|
|
msg = jsonObject.getString("msg");
|
|
|
}
|
|
|
throw new Exception(msg);
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取医院列表
|
|
|
* @param type
|
|
@ -565,6 +523,47 @@ public class JwSmjkService {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取医生信息
|
|
|
* @param hospitalId
|
|
|
* @param hosDeptId
|
|
|
* @param doctorId
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public GuahaoDoctor getGuahaoDoctor(String hospitalId,String hosDeptId,String doctorId) throws Exception{
|
|
|
String response = GetDoctorInfo(hospitalId,hosDeptId,doctorId);
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
GuahaoDoctor doctor = new GuahaoDoctor();
|
|
|
JSONObject json = jsonObject.getJSONObject("data");
|
|
|
doctor.setId(json.isNull("id")?"":json.getString("id"));//医生编码
|
|
|
doctor.setName(json.isNull("name")?"":json.getString("name"));//医生姓名
|
|
|
doctor.setSex(json.isNull("sex")?"":json.getString("sex"));//医生性别
|
|
|
doctor.setTitle(json.isNull("title")?"":json.getString("title"));//医生职称
|
|
|
doctor.setEdu(json.isNull("edu")?"":json.getString("edu"));//医生学历
|
|
|
doctor.setIntroduce(json.isNull("introduce")?"":json.getString("introduce"));//医生简介
|
|
|
doctor.setPhoto(json.isNull("photo")?"":json.getString("photo"));//医生头像
|
|
|
doctor.setFee(json.isNull("fee")?"":json.getString("fee"));//医生挂号费
|
|
|
doctor.setHosDeptId(json.isNull("hosDeptId")?"":json.getString("hosDeptId"));//医生科室编码
|
|
|
doctor.setHosDeptName(json.isNull("hosDeptName")?"":json.getString("hosDeptName"));//医生科室名称
|
|
|
doctor.setHospitalId(json.isNull("hospitalId")?"":json.getString("hospitalId"));//医生医院编码
|
|
|
doctor.setHospitalName(json.isNull("hospitalName")?"":json.getString("hospitalName"));//医生医院名称
|
|
|
return doctor;
|
|
|
} else {
|
|
|
String msg = "处理失败,请联系管理员";
|
|
|
if(!jsonObject.isNull("msg")){
|
|
|
msg = jsonObject.getString("msg");
|
|
|
}
|
|
|
throw new Exception(msg);
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取预约状态(0 撤销 1 确认 2 已诊 3停诊)
|
|
|
* @param hospitalId
|