|
@ -2,6 +2,7 @@ package com.yihu.wlyy.service.specialist;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
import com.yihu.wlyy.util.http.HttpResponse;
|
|
@ -28,8 +29,10 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
private String specialistUrl;
|
|
|
@Autowired
|
|
|
private AdminTeamService teamService;
|
|
|
@Autowired
|
|
|
private SpecialistEvaluateSevice specialistEvaluateSevice;
|
|
|
|
|
|
public JSONObject findTemplateInfo(String doctor, String patient) {
|
|
|
public JSONArray findTemplateInfo(String doctor, String patient) throws Exception {
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
Long adminTeamId = null;
|
|
|
AdminTeam team = teamService.findByLeaderCode(doctor);
|
|
@ -47,10 +50,13 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
|
return rs;
|
|
|
if ("success".equals(rs.getString("message"))) {
|
|
|
return rs.getJSONArray("detailModelList");
|
|
|
}
|
|
|
throw new Exception("请求获取模板列表失败!");
|
|
|
}
|
|
|
|
|
|
public JSONObject findTemplateDetailInfo(String templateId) {
|
|
|
public JSONArray findTemplateDetailInfo(String templateId) throws Exception {
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("templateId", templateId);
|
|
|
HttpResponse response = null;
|
|
@ -60,10 +66,13 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
|
return rs;
|
|
|
if ("success".equals(rs.getString("message"))) {
|
|
|
return rs.getJSONArray("detailModelList");
|
|
|
}
|
|
|
throw new Exception("请求获取模板明细列表失败!");
|
|
|
}
|
|
|
|
|
|
public String createTemplate(String title, Doctor doctor, Long teamId) {
|
|
|
public String createTemplate(String title, Doctor doctor, Long teamId) throws Exception {
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("title", title);
|
|
|
json.put("adminTeamCode", teamId);
|
|
@ -124,7 +133,7 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
return rs.getString("message");
|
|
|
}
|
|
|
|
|
|
public JSONObject findServiceItemsByHospital(String doctorHospital, String signHospital) {
|
|
|
public JSONArray findServiceItemsByHospital(String doctorHospital, String signHospital) throws Exception {
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("doctorHospital", doctorHospital);
|
|
|
param.put("signHospital", signHospital);
|
|
@ -135,11 +144,15 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
|
return rs;
|
|
|
if ("success".equals(rs.getString("message"))) {
|
|
|
return rs.getJSONArray("detailModelList");
|
|
|
}
|
|
|
throw new Exception("请求获取机构服务项目列表失败!");
|
|
|
}
|
|
|
|
|
|
public String createRehabilitationPlan(String json, Doctor doctor) {
|
|
|
JSONObject object = new JSONObject(json);
|
|
|
String patient = object.getString("patient");
|
|
|
object.put("createUser", doctor.getCode());
|
|
|
object.put("createUserName", doctor.getName());
|
|
|
Map<String, Object> param = new HashedMap();
|
|
@ -151,6 +164,17 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
|
JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
|
|
|
//康复计划创建完给执行者发送消息
|
|
|
for (Object obj : detailModelList){
|
|
|
JSONObject detail = new JSONObject(obj);
|
|
|
Message message = new Message();
|
|
|
message.setSender(doctor.getCode());
|
|
|
message.setType(19);
|
|
|
message.setRelationCode(detail.getString("planId"));
|
|
|
message.setReceiver(detail.getString("doctor"));
|
|
|
specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient,null);
|
|
|
}
|
|
|
return rs.getString("message");
|
|
|
}
|
|
|
|
|
@ -167,25 +191,6 @@ public class RehabilitationPlanService extends BaseService {
|
|
|
return rs.getString("message");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据医生code获取签约居民信息
|
|
|
* @param doctor
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getPatientInfoByDoctor(String doctor, String patientInfo) {
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("doctor", doctor);
|
|
|
param.put("patientInfo", patientInfo);
|
|
|
HttpResponse response = null;
|
|
|
try {
|
|
|
response = HttpUtils.doGet(specialistUrl + "svr-specialist/getPatientAndDiseaseByDoctor", param);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 更新计划的状态
|
|
|
* @param planId
|