|
@ -197,6 +197,21 @@ public class PatientDiseaseService extends BaseService {
|
|
|
|
|
|
groupInfoDao.save(ncdGroup);
|
|
|
}
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(jjSign.getDoctorHealth(), patient, "2", "2") < 1) {
|
|
|
DoctorPatientGroupInfo ncdJgGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ncdJgGroup.setDoctor(jjSign.getDoctorHealth());
|
|
|
ncdJgGroup.setPatient(patient);
|
|
|
ncdJgGroup.setSignType("2");
|
|
|
ncdJgGroup.setCzrq(new Date());
|
|
|
ncdJgGroup.setStatus(1);
|
|
|
ncdJgGroup.setPname(jjSign.getName());
|
|
|
ncdJgGroup.setQyrq(jjSign.getApplyDate());
|
|
|
ncdJgGroup.setDqrq(jjSign.getEnd());
|
|
|
ncdJgGroup.setGroup("2");
|
|
|
|
|
|
groupInfoDao.save(ncdJgGroup);
|
|
|
}
|
|
|
}
|
|
|
if (ssSign != null) {
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(ssSign.getDoctor(), patient, "2", "1") < 1) {
|
|
@ -214,9 +229,26 @@ public class PatientDiseaseService extends BaseService {
|
|
|
|
|
|
groupInfoDao.save(ncdGroup);
|
|
|
}
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(ssSign.getDoctorHealth(), patient, "2", "1") < 1) {
|
|
|
DoctorPatientGroupInfo ncdJgGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ncdJgGroup.setDoctor(ssSign.getDoctorHealth());
|
|
|
ncdJgGroup.setPatient(patient);
|
|
|
ncdJgGroup.setSignType("1");
|
|
|
ncdJgGroup.setCzrq(new Date());
|
|
|
ncdJgGroup.setStatus(1);
|
|
|
ncdJgGroup.setPname(ssSign.getName());
|
|
|
ncdJgGroup.setQyrq(ssSign.getApplyDate());
|
|
|
ncdJgGroup.setDqrq(ssSign.getEnd());
|
|
|
ncdJgGroup.setGroup("2");
|
|
|
|
|
|
groupInfoDao.save(ncdJgGroup);
|
|
|
}
|
|
|
}
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctor() : ssSign.getDoctor(), patient, "1", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctor() : ssSign.getDoctor(), patient, "3", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctorHealth() : ssSign.getDoctorHealth(), patient, "1", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctorHealth() : ssSign.getDoctorHealth(), patient, "3", 0);
|
|
|
} else {
|
|
|
boolean isSixFive = false;
|
|
|
String birth = p.getIdcard().substring(6, 14);
|
|
@ -251,6 +283,21 @@ public class PatientDiseaseService extends BaseService {
|
|
|
|
|
|
groupInfoDao.save(ncdGroup);
|
|
|
}
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(jjSign.getDoctorHealth(), patient, "3", "2") < 1) {
|
|
|
DoctorPatientGroupInfo ncdJgGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ncdJgGroup.setDoctor(jjSign.getDoctorHealth());
|
|
|
ncdJgGroup.setPatient(patient);
|
|
|
ncdJgGroup.setSignType("2");
|
|
|
ncdJgGroup.setCzrq(new Date());
|
|
|
ncdJgGroup.setStatus(1);
|
|
|
ncdJgGroup.setPname(jjSign.getName());
|
|
|
ncdJgGroup.setQyrq(jjSign.getApplyDate());
|
|
|
ncdJgGroup.setDqrq(jjSign.getEnd());
|
|
|
ncdJgGroup.setGroup("3");
|
|
|
|
|
|
groupInfoDao.save(ncdJgGroup);
|
|
|
}
|
|
|
}
|
|
|
if (ssSign != null) {
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(ssSign.getDoctor(), patient, "3", "1") < 1) {
|
|
@ -268,9 +315,26 @@ public class PatientDiseaseService extends BaseService {
|
|
|
|
|
|
groupInfoDao.save(ncdGroup);
|
|
|
}
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(ssSign.getDoctorHealth(), patient, "3", "1") < 1) {
|
|
|
DoctorPatientGroupInfo ncdJgGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ncdJgGroup.setDoctor(ssSign.getDoctorHealth());
|
|
|
ncdJgGroup.setPatient(patient);
|
|
|
ncdJgGroup.setSignType("1");
|
|
|
ncdJgGroup.setCzrq(new Date());
|
|
|
ncdJgGroup.setStatus(1);
|
|
|
ncdJgGroup.setPname(ssSign.getName());
|
|
|
ncdJgGroup.setQyrq(ssSign.getApplyDate());
|
|
|
ncdJgGroup.setDqrq(ssSign.getEnd());
|
|
|
ncdJgGroup.setGroup("3");
|
|
|
|
|
|
groupInfoDao.save(ncdJgGroup);
|
|
|
}
|
|
|
}
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctor() : ssSign.getDoctor(), patient, "1", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctor() : ssSign.getDoctor(), patient, "2", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctorHealth() : ssSign.getDoctorHealth(), patient, "1", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctorHealth() : ssSign.getDoctorHealth(), patient, "2", 0);
|
|
|
} else {
|
|
|
// 普通分组
|
|
|
if (jjSign != null) {
|
|
@ -289,6 +353,21 @@ public class PatientDiseaseService extends BaseService {
|
|
|
|
|
|
groupInfoDao.save(ncdGroup);
|
|
|
}
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(jjSign.getDoctorHealth(), patient, "1", "2") < 1) {
|
|
|
DoctorPatientGroupInfo ncdJgGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ncdJgGroup.setDoctor(jjSign.getDoctorHealth());
|
|
|
ncdJgGroup.setPatient(patient);
|
|
|
ncdJgGroup.setSignType("2");
|
|
|
ncdJgGroup.setCzrq(new Date());
|
|
|
ncdJgGroup.setStatus(1);
|
|
|
ncdJgGroup.setPname(jjSign.getName());
|
|
|
ncdJgGroup.setQyrq(jjSign.getApplyDate());
|
|
|
ncdJgGroup.setDqrq(jjSign.getEnd());
|
|
|
ncdJgGroup.setGroup("1");
|
|
|
|
|
|
groupInfoDao.save(ncdJgGroup);
|
|
|
}
|
|
|
}
|
|
|
if (ssSign != null) {
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(ssSign.getDoctor(), patient, "1", "1") < 1) {
|
|
@ -306,9 +385,26 @@ public class PatientDiseaseService extends BaseService {
|
|
|
|
|
|
groupInfoDao.save(ncdGroup);
|
|
|
}
|
|
|
if (groupInfoDao.countDoctorPatientGroupType(ssSign.getDoctorHealth(), patient, "1", "1") < 1) {
|
|
|
DoctorPatientGroupInfo ncdJgGroup = new DoctorPatientGroupInfo();
|
|
|
|
|
|
ncdJgGroup.setDoctor(ssSign.getDoctorHealth());
|
|
|
ncdJgGroup.setPatient(patient);
|
|
|
ncdJgGroup.setSignType("1");
|
|
|
ncdJgGroup.setCzrq(new Date());
|
|
|
ncdJgGroup.setStatus(1);
|
|
|
ncdJgGroup.setPname(ssSign.getName());
|
|
|
ncdJgGroup.setQyrq(ssSign.getApplyDate());
|
|
|
ncdJgGroup.setDqrq(ssSign.getEnd());
|
|
|
ncdJgGroup.setGroup("1");
|
|
|
|
|
|
groupInfoDao.save(ncdJgGroup);
|
|
|
}
|
|
|
}
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctor() : ssSign.getDoctor(), patient, "2", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctor() : ssSign.getDoctor(), patient, "3", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctorHealth() : ssSign.getDoctorHealth(), patient, "2", 0);
|
|
|
groupInfoDao.updateDoctorPatientGroup(jjSign != null ? jjSign.getDoctorHealth() : ssSign.getDoctorHealth(), patient, "3", 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -319,24 +415,29 @@ public class PatientDiseaseService extends BaseService {
|
|
|
* 更新患者疾病到redis
|
|
|
*/
|
|
|
public void updateToRedis() {
|
|
|
String sql = "select * from wlyy_patient_disease where del = '1'";
|
|
|
String sql = "select * from wlyy_patient_disease";
|
|
|
List<Map<String, Object>> patientDiseases = jdbcTemplate.queryForList(sql);
|
|
|
Map<String, JSONArray> diseases = new HashMap<>();
|
|
|
|
|
|
if (patientDiseases != null) {
|
|
|
for (Map<String, Object> map : patientDiseases) {
|
|
|
JSONObject disease = new JSONObject();
|
|
|
disease.put("disease", map.get("disease"));
|
|
|
disease.put("diseaseName", map.get("disease_name"));
|
|
|
disease.put("del", map.get("del"));
|
|
|
disease.put("signType", map.get("sign_type"));
|
|
|
|
|
|
if (diseases.containsKey(map.get("patient").toString())) {
|
|
|
diseases.get(map.get("patient").toString()).put(disease);
|
|
|
} else {
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
jsonArray.put(disease);
|
|
|
diseases.put(map.get("patient").toString(), jsonArray);
|
|
|
if(!diseases.containsKey(map.get("patient").toString())){
|
|
|
diseases.put(map.get("patient").toString(), new JSONArray());
|
|
|
}
|
|
|
if(map.get("del").toString().equals("1")) {
|
|
|
JSONObject disease = new JSONObject();
|
|
|
disease.put("disease", map.get("disease"));
|
|
|
disease.put("diseaseName", map.get("disease_name"));
|
|
|
disease.put("del", map.get("del"));
|
|
|
disease.put("signType", map.get("sign_type"));
|
|
|
|
|
|
if (diseases.containsKey(map.get("patient").toString())) {
|
|
|
diseases.get(map.get("patient").toString()).put(disease);
|
|
|
} else {
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
jsonArray.put(disease);
|
|
|
diseases.put(map.get("patient").toString(), jsonArray);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|