|
@ -139,6 +139,10 @@ public class ConsultTeamService extends ConsultService {
|
|
|
private PresModeAdapter presModeAdapter;
|
|
|
@Autowired
|
|
|
private ZyDictService zyDictService;
|
|
|
//健康问题 高血压
|
|
|
private static final String gxy = "HP0093";
|
|
|
//健康问题 糖尿病
|
|
|
private static final String tnb ="HP0047";
|
|
|
|
|
|
Map<Integer, String> relations = new HashMap<>();
|
|
|
|
|
@ -159,6 +163,52 @@ public class ConsultTeamService extends ConsultService {
|
|
|
relations.put(7, "未知");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 处方判断
|
|
|
* @param patient
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject isPrescriptConsult(String patient) throws Exception{
|
|
|
JSONObject json = new JSONObject();
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
if(signFamily==null){
|
|
|
json.put("msg","您还未签约,不能发起续方咨询");
|
|
|
return json;
|
|
|
}
|
|
|
//点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,alert“当前没有可以申请续方的处方记录”
|
|
|
int num = 0;
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
String rp= jwPrescriptionService.getLastRecipe(p.getSsc(),null,null,null);
|
|
|
com.alibaba.fastjson.JSONArray pres =presModeAdapter.modeToPrescription(rp);
|
|
|
Iterator iterator = pres.iterator();
|
|
|
while (iterator.hasNext()){
|
|
|
com.alibaba.fastjson.JSONObject r = ( com.alibaba.fastjson.JSONObject)iterator.next();
|
|
|
com.alibaba.fastjson.JSONArray des = r.getJSONArray("prescriptionDt");
|
|
|
for(int i=0 ;i<des.size();i++){
|
|
|
PrescriptionDiagnosis ds = des.getObject(i,PrescriptionDiagnosis.class);
|
|
|
if(gxy.equals(ds.getHealthProblem())||tnb.equals(ds.getHealthProblem())){
|
|
|
//为糖尿病高血压
|
|
|
num++;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if(num==0){
|
|
|
json.put("msg","当前没有可以申请续方的处方记录");
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
Doctor doctor = doctorDao.findByAdminTeamId(signFamily.getAdminTeamId());
|
|
|
json.put("doctor",doctor.getCode());
|
|
|
json.put("doctorName",doctor.getName());
|
|
|
json.put("adminTeamId",signFamily.getAdminTeamId());
|
|
|
json.put("hospital",doctor.getHospital());
|
|
|
json.put("hospitalName",doctor.getHospitalName());
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询患者是否还有未结束的三师咨询
|
|
|
*
|