|
@ -5,7 +5,6 @@ import com.yihu.wlyy.entity.device.Device;
|
|
import com.yihu.wlyy.entity.device.PatientBloodSugger;
|
|
import com.yihu.wlyy.entity.device.PatientBloodSugger;
|
|
import com.yihu.wlyy.entity.device.PatientDevice;
|
|
import com.yihu.wlyy.entity.device.PatientDevice;
|
|
import com.yihu.wlyy.entity.device.PatientHealthTime;
|
|
import com.yihu.wlyy.entity.device.PatientHealthTime;
|
|
import com.yihu.wlyy.entity.dict.Icd10Dict;
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
|
|
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
|
|
@ -23,7 +22,9 @@ import com.yihu.wlyy.repository.doctor.SignPatientLabelInfoDao;
|
|
import com.yihu.wlyy.repository.patient.*;
|
|
import com.yihu.wlyy.repository.patient.*;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
|
|
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
|
|
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
|
import com.yihu.wlyy.service.system.Icd10DictServcie;
|
|
import com.yihu.wlyy.service.third.iot.IotDeviceService;
|
|
import com.yihu.wlyy.service.third.iot.IotDeviceService;
|
|
import com.yihu.wlyy.service.third.jw.JwSmjkService;
|
|
import com.yihu.wlyy.service.third.jw.JwSmjkService;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
@ -59,7 +60,8 @@ public class PatientDeviceService extends BaseService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private DoctorDao doctorDao;
|
|
private DoctorDao doctorDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private Icd10DictServcie icd10DictServcie;
|
|
@Autowired
|
|
@Autowired
|
|
private PatientDeviceDao patientDeviceDao;
|
|
private PatientDeviceDao patientDeviceDao;
|
|
|
|
|
|
@ -87,7 +89,8 @@ public class PatientDeviceService extends BaseService {
|
|
private PatientHealthStandardDao patientHealthStandardDao;
|
|
private PatientHealthStandardDao patientHealthStandardDao;
|
|
@Autowired
|
|
@Autowired
|
|
private HttpClientUtil HttpClientUtil;
|
|
private HttpClientUtil HttpClientUtil;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private PrescriptionService prescriptionService;
|
|
@Value("${yihu.yihu_OpenPlatform_url}")
|
|
@Value("${yihu.yihu_OpenPlatform_url}")
|
|
private String url;
|
|
private String url;
|
|
@Value("${yihu.yihu_OpenPlatform_appId}")
|
|
@Value("${yihu.yihu_OpenPlatform_appId}")
|
|
@ -107,7 +110,10 @@ public class PatientDeviceService extends BaseService {
|
|
private IotDeviceService iotDeviceService;
|
|
private IotDeviceService iotDeviceService;
|
|
@Autowired
|
|
@Autowired
|
|
private Icd10DictDao icd10DictDao;
|
|
private Icd10DictDao icd10DictDao;
|
|
|
|
|
|
|
|
//健康问题 高血压
|
|
|
|
private static final String gxy = "HP0093";
|
|
|
|
//健康问题 糖尿病
|
|
|
|
private static final String tnb = "HP0047";
|
|
Map<Integer, String> relations = new HashMap<>();
|
|
Map<Integer, String> relations = new HashMap<>();
|
|
|
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
@ -932,6 +938,9 @@ public class PatientDeviceService extends BaseService {
|
|
int eventSize = 0;//就诊次数
|
|
int eventSize = 0;//就诊次数
|
|
int times = 0;//住院次数
|
|
int times = 0;//住院次数
|
|
|
|
|
|
|
|
int num = 10;//查找10次后就不找了。
|
|
|
|
int ni = 0;
|
|
|
|
String drugs = "";
|
|
if (!StringUtils.isEmpty(response)) {
|
|
if (!StringUtils.isEmpty(response)) {
|
|
JSONArray array = new JSONArray(response);
|
|
JSONArray array = new JSONArray(response);
|
|
if (!"[{}]".equals(response)) {
|
|
if (!"[{}]".equals(response)) {
|
|
@ -949,22 +958,45 @@ public class PatientDeviceService extends BaseService {
|
|
|
|
|
|
if(StringUtils.isNotBlank(type)){
|
|
if(StringUtils.isNotBlank(type)){
|
|
//根据icd10过滤数据
|
|
//根据icd10过滤数据
|
|
String icdCode = item.optString("ICD_CODE");
|
|
|
|
Icd10Dict icd10Dict = icd10DictDao.findByCode(icdCode);
|
|
|
|
if(icd10Dict==null){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if("1".equals(type)){
|
|
|
|
//血糖
|
|
|
|
if(!"2".equals(icd10Dict.getType())){
|
|
|
|
continue;
|
|
|
|
|
|
String icdCode = item.optString("DIAGNOSIS");
|
|
|
|
String icd10 = icd10DictServcie.getHealthProblemsByIcd10Code(icdCode);
|
|
|
|
if(StringUtils.isNotBlank(icd10)){
|
|
|
|
com.alibaba.fastjson.JSONObject icd = com.alibaba.fastjson.JSONObject.parseObject(icd10);
|
|
|
|
String key = icd.getString("key");
|
|
|
|
if ("1".equals(type)) {
|
|
|
|
//主诊断为糖尿病
|
|
|
|
if(!tnb.equals(key)){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
} else if("2".equals(type)){
|
|
|
|
//主诊断为高血压
|
|
|
|
if(!gxy.equals(key)){
|
|
|
|
continue;
|
|
|
|
}
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
//血压
|
|
|
|
if(!"1".equals(icd10Dict.getType())){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
continue;
|
|
}
|
|
}
|
|
|
|
// Icd10Dict icd10Dict = icd10DictDao.findByCode(icdCode);
|
|
|
|
// if(icd10Dict==null){
|
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// if("1".equals(type)){
|
|
|
|
// //血糖
|
|
|
|
// if(!"2".equals(icd10Dict.getType())){
|
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// }else {
|
|
|
|
// //血压
|
|
|
|
// if(!"1".equals(icd10Dict.getType())){
|
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
ni++;
|
|
|
|
if(ni<num&&StringUtils.isEmpty(drugs)){
|
|
|
|
drugs = prescriptionService.findPatientMedicationRecords(patientCode,item.optString("END_TIME").toString(),type);
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
if("2".equals(item.optString("TYPE"))){
|
|
if("2".equals(item.optString("TYPE"))){
|
|
times++;
|
|
times++;
|
|
@ -1006,6 +1038,7 @@ public class PatientDeviceService extends BaseService {
|
|
statistics.put("times",times);
|
|
statistics.put("times",times);
|
|
json.put("statistics",statistics);
|
|
json.put("statistics",statistics);
|
|
json.put("list",re);
|
|
json.put("list",re);
|
|
|
|
json.put("drugs",drugs);
|
|
|
|
|
|
return json;
|
|
return json;
|
|
}
|
|
}
|