|
@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.followup.Followup;
|
|
|
import com.yihu.wlyy.entity.followup.FollowupContent;
|
|
|
import com.yihu.wlyy.entity.followup.FollowupDrugs;
|
|
|
import com.yihu.wlyy.entity.followup.FollowupMapping;
|
|
|
import com.yihu.wlyy.entity.followup.*;
|
|
|
import com.yihu.wlyy.entity.oldpeople.OldPeoplePhysicalExaminationEntity;
|
|
|
import com.yihu.wlyy.entity.organization.HospitalMapping;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
@ -15,10 +12,7 @@ import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorMappingDao;
|
|
|
import com.yihu.wlyy.repository.followup.FollowUpDao;
|
|
|
import com.yihu.wlyy.repository.followup.FollowUpMappingDao;
|
|
|
import com.yihu.wlyy.repository.followup.FollowupContentDao;
|
|
|
import com.yihu.wlyy.repository.followup.FollowupDrugsDao;
|
|
|
import com.yihu.wlyy.repository.followup.*;
|
|
|
import com.yihu.wlyy.repository.oldpeople.OldPeoplePhysicalExaminationDao;
|
|
|
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
@ -686,7 +680,7 @@ public class JwPrescriptionService {
|
|
|
followupContentDao.deleteByFollowupId(followup.getId());
|
|
|
//组装数据
|
|
|
List<FollowupContent> newList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
followupContent1.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -696,7 +690,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent2.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -706,7 +700,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent3.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -716,7 +710,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent4.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -726,7 +720,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent5.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -736,7 +730,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent6.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -746,7 +740,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent7.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -756,7 +750,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent8.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -766,7 +760,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent9.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -776,7 +770,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent10.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -786,7 +780,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContentDao.save(newList);
|
|
|
|
|
|
List<FollowupDrugs> DRUG_LIST = new ArrayList<>();//用药记录
|
|
@ -883,11 +877,14 @@ public class JwPrescriptionService {
|
|
|
}
|
|
|
followupResultMap.put("OPERATOR",OPERATOR);
|
|
|
|
|
|
String FOLLOWUP_ID = followup.getFollowupNo();//家庭医生服务随访主表ID
|
|
|
if (StringUtils.isBlank(FOLLOWUP_ID)) {
|
|
|
FOLLOWUP_ID = "0";
|
|
|
String FOLLOWUP_NO = followup.getFollowupNo();//家庭医生服务随访主表ID
|
|
|
if (StringUtils.isBlank(FOLLOWUP_NO)) {
|
|
|
FOLLOWUP_NO = "0";
|
|
|
}else{
|
|
|
|
|
|
}
|
|
|
followupResultMap.put("FOLLOWUP_ID",FOLLOWUP_ID);
|
|
|
followupResultMap.put("FOLLOWUP_ID",String.valueOf(followup.getId()));
|
|
|
followupResultMap.put("FOLLOWUP_NO",FOLLOWUP_NO);
|
|
|
|
|
|
String FAMILY_FOLLOWUP_TYPE = "3";//随访类型,必传值3 【必填】
|
|
|
String ORG_CODE = followup.getOrgCode();//本地机构编码
|
|
@ -904,7 +901,7 @@ public class JwPrescriptionService {
|
|
|
} else if ("2".equals(FAMILY_FOLLOWUP_CLASS_NAMES)) {
|
|
|
FAMILY_FOLLOWUP_CLASS_NAMES = "糖尿病";
|
|
|
} else if ("1,2".equals(FAMILY_FOLLOWUP_CLASS_NAMES)) {
|
|
|
FAMILY_FOLLOWUP_CLASS_NAMES = "高血压,糖尿病";
|
|
|
FAMILY_FOLLOWUP_CLASS_NAMES = "高血压,糖尿病";
|
|
|
} else {}
|
|
|
|
|
|
followupResultMap.put("FAMILY_FOLLOWUP_TYPE",FAMILY_FOLLOWUP_TYPE);
|
|
@ -920,6 +917,7 @@ public class JwPrescriptionService {
|
|
|
|
|
|
followupResultMap.put("THIS_FOLLOWUP_VISIT_DATE",THIS_FOLLOWUP_VISIT_DATE);
|
|
|
followupResultMap.put("NEXT_FOLLOWUP_DATE",NEXT_FOLLOWUP_DATE);
|
|
|
followupResultMap.put("FOLLOWUP_VISIT_DOCTOR_NAME",followup.getJwdoctorCode());
|
|
|
followupResultMap.put("VISIT_WAY_CODE",VISIT_WAY_CODE);
|
|
|
|
|
|
String ARCHIVE_ID = "";//档案ID
|
|
@ -932,6 +930,26 @@ public class JwPrescriptionService {
|
|
|
ARCHIVE_ID = this.getSickArchiveFlag(IDENTITY_CARD_NO);
|
|
|
followupResultMap.put("ARCHIVE_ID",ARCHIVE_ID);
|
|
|
}
|
|
|
|
|
|
//控制目标操作者CODE
|
|
|
String CONTROL_CONSTITUTOR_DOCTORCODE = "";
|
|
|
|
|
|
//基卫控制目标操作者
|
|
|
if(followupResultMap.containsKey("CONTROL_CONSTITUTOR")){
|
|
|
|
|
|
String CONTROL_CONSTITUTOR = "";
|
|
|
if(followupResultMap.containsKey("CONTROL_CONSTITUTOR_DOCTORCODE")){
|
|
|
|
|
|
CONTROL_CONSTITUTOR_DOCTORCODE = followupResultMap.get("CONTROL_CONSTITUTOR_DOCTORCODE");
|
|
|
CONTROL_CONSTITUTOR = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(CONTROL_CONSTITUTOR_DOCTORCODE, followup.getOrgCode());
|
|
|
|
|
|
followupResultMap.put("CONTROL_CONSTITUTOR",CONTROL_CONSTITUTOR);//基卫控制目标操作者
|
|
|
}else{
|
|
|
logger.info("随访记录上传失败,控制目标操作者CODE为空: 操作者为" + followupResultMap.containsKey("CONTROL_CONSTITUTOR"));
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
List<FollowupDrugs> followupDrugs = followupDrugsDao.findByFollowupId(followup.getId());
|
|
|
List<FollowupDrugs> followupDrugsNormal = new ArrayList<>();//其他药品
|
|
@ -959,7 +977,11 @@ public class JwPrescriptionService {
|
|
|
followupResultMap.put("PHYSIC_NAME"+tag,followupDrugsNormal.get(i).getDrugsName());
|
|
|
followupResultMap.put("FREQUENCY"+tag,followupDrugsNormal.get(i).getFrequency());
|
|
|
followupResultMap.put("PHYSIC_UNIT"+tag,followupDrugsNormal.get(i).getUnit());
|
|
|
followupResultMap.put("PHYSIC_DOSE"+tag,df.format(followupDrugsNormal.get(i).getDose()));
|
|
|
if(followupDrugsNormal.get(i).getDose() !=null){
|
|
|
followupResultMap.put("PHYSIC_DOSE"+tag,df.format(followupDrugsNormal.get(i).getDose()));
|
|
|
}else{
|
|
|
followupResultMap.put("PHYSIC_DOSE","");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -970,7 +992,12 @@ public class JwPrescriptionService {
|
|
|
followupResultMap.put("INSULIN_NAME"+tag,followupDrugsInsulin.get(j).getDrugsName());
|
|
|
followupResultMap.put("INSULIN_FREQUENCY"+tag,followupDrugsInsulin.get(j).getFrequency());
|
|
|
followupResultMap.put("INSULIN_UNIT"+tag,followupDrugsInsulin.get(j).getUnit());
|
|
|
followupResultMap.put("INSULIN_DOSE"+tag,df.format(followupDrugsInsulin.get(j).getDose()));
|
|
|
if(followupDrugsInsulin.get(j).getDose() !=null){
|
|
|
followupResultMap.put("INSULIN_DOSE"+tag,df.format(followupDrugsInsulin.get(j).getDose()));
|
|
|
}else{
|
|
|
followupResultMap.put("INSULIN_DOSE","");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -980,6 +1007,7 @@ public class JwPrescriptionService {
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("OPERATOR", OPERATOR));
|
|
|
params.add(new BasicNameValuePair("ORG_CODE", ORG_CODE));
|
|
|
params.add(new BasicNameValuePair("data", jsonObject.toString()));
|
|
|
String response = httpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
@ -1014,7 +1042,7 @@ public class JwPrescriptionService {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err:请求失败");
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err:请求失败"+errmsg);
|
|
|
continue;
|
|
|
}
|
|
|
} else {
|