|
@ -1121,137 +1121,4 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 疾病转标签
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean diseaseToLabel() {
|
|
|
List<PatientDisease> diseases = diseaseDao.findByDel("1");
|
|
|
Iterator<Patient> patients = patientDao.findAll().iterator();
|
|
|
Map<String, String> patientNames = new HashMap<>();
|
|
|
|
|
|
while (patients.hasNext()) {
|
|
|
Patient p = patients.next();
|
|
|
patientNames.put(p.getCode(), p.getName());
|
|
|
}
|
|
|
|
|
|
for (PatientDisease disease : diseases) {
|
|
|
SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
|
|
|
|
|
|
labelInfo.setPatient(disease.getPatient());
|
|
|
labelInfo.setPname(patientNames.get(disease.getPatient()));
|
|
|
labelInfo.setLabel(disease.getDisease());
|
|
|
labelInfo.setLabelName(disease.getDiseaseName());
|
|
|
labelInfo.setLabelType("3");
|
|
|
labelInfo.setStatus(1);
|
|
|
labelInfo.setCzrq(new Date());
|
|
|
|
|
|
labelInfoDao.save(labelInfo);
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 分组转标签
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean groupToLabel() throws Exception {
|
|
|
Iterator<Patient> patients = patientDao.findAll().iterator();
|
|
|
Map<String, Patient> patientNames = new HashMap<>();
|
|
|
Map<String, SignPatientLabelInfo> normalLabel = new HashMap<>();
|
|
|
Map<String, SignPatientLabelInfo> manbingLabel = new HashMap<>();
|
|
|
Map<String, SignPatientLabelInfo> sixFiveLabel = new HashMap<>();
|
|
|
|
|
|
while (patients.hasNext()) {
|
|
|
Patient p = patients.next();
|
|
|
patientNames.put(p.getCode(), p);
|
|
|
}
|
|
|
|
|
|
List<DoctorPatientGroupInfo> groupInfos = groupInfoDao.findByGroupAndStatus("1", 1);
|
|
|
|
|
|
for (DoctorPatientGroupInfo groupInfo : groupInfos) {
|
|
|
Patient p = patientNames.get(groupInfo.getPatient());
|
|
|
|
|
|
if (p == null) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
|
|
|
|
|
|
labelInfo.setPatient(p.getCode());
|
|
|
labelInfo.setPname(p.getName());
|
|
|
labelInfo.setLabel("1");
|
|
|
labelInfo.setLabelName("普通人群");
|
|
|
labelInfo.setLabelType("1");
|
|
|
labelInfo.setStatus(1);
|
|
|
labelInfo.setCzrq(new Date());
|
|
|
|
|
|
normalLabel.put(p.getCode(), labelInfo);
|
|
|
}
|
|
|
|
|
|
List<DoctorPatientGroupInfo> groupInfos1 = groupInfoDao.findByGroupAndStatus("2", 1);
|
|
|
|
|
|
for (DoctorPatientGroupInfo groupInfo : groupInfos1) {
|
|
|
Patient p = patientNames.get(groupInfo.getPatient());
|
|
|
|
|
|
if (p == null) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
|
|
|
|
|
|
labelInfo.setPatient(p.getCode());
|
|
|
labelInfo.setPname(p.getName());
|
|
|
labelInfo.setLabel("2");
|
|
|
labelInfo.setLabelName("慢病人群");
|
|
|
labelInfo.setLabelType("1");
|
|
|
labelInfo.setStatus(1);
|
|
|
labelInfo.setCzrq(new Date());
|
|
|
|
|
|
manbingLabel.put(p.getCode(), labelInfo);
|
|
|
}
|
|
|
|
|
|
List<DoctorPatientGroupInfo> groupInfos2 = groupInfoDao.findByGroupAndStatus("3", 1);
|
|
|
|
|
|
for (DoctorPatientGroupInfo groupInfo : groupInfos2) {
|
|
|
Patient p = patientNames.get(groupInfo.getPatient());
|
|
|
|
|
|
if (p == null) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
|
|
|
|
|
|
labelInfo.setPatient(p.getCode());
|
|
|
labelInfo.setPname(p.getName());
|
|
|
labelInfo.setLabel("3");
|
|
|
labelInfo.setLabelName("65岁以上人群");
|
|
|
labelInfo.setLabelType("1");
|
|
|
labelInfo.setStatus(1);
|
|
|
labelInfo.setCzrq(new Date());
|
|
|
|
|
|
sixFiveLabel.put(p.getCode(), labelInfo);
|
|
|
}
|
|
|
|
|
|
if (normalLabel.size() > 0) {
|
|
|
for (SignPatientLabelInfo labelInfo : normalLabel.values()) {
|
|
|
labelInfoDao.save(labelInfo);
|
|
|
}
|
|
|
}
|
|
|
if (manbingLabel.size() > 0) {
|
|
|
for (SignPatientLabelInfo labelInfo : manbingLabel.values()) {
|
|
|
labelInfoDao.save(labelInfo);
|
|
|
}
|
|
|
}
|
|
|
if (sixFiveLabel.size() > 0) {
|
|
|
for (SignPatientLabelInfo labelInfo : sixFiveLabel.values()) {
|
|
|
labelInfoDao.save(labelInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
}
|