|
@ -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;
|
|
@ -34,11 +28,14 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.orm.jpa.JpaTransactionManager;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.TransactionDefinition;
|
|
|
import org.springframework.transaction.TransactionStatus;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
@ -427,411 +424,447 @@ public class JwPrescriptionService {
|
|
|
public void getFollowUpByTime(String startdate, String enddate) throws Exception {
|
|
|
|
|
|
logger.info("查询居民随访记录,开始时间" + startdate + ",结束时间:" + enddate);
|
|
|
List<HospitalMapping> list = hospitalMappingDao.findJwOrg();
|
|
|
for (HospitalMapping hospitalMapping: list) {
|
|
|
|
|
|
String url = jwUrl + "/third/sign/getEhrChroDaysFollowUpInfoRecord";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("TIME_START", startdate));//开始时间
|
|
|
params.add(new BasicNameValuePair("TIME_END", enddate));//结束时间
|
|
|
String response = httpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
//居民随访记录
|
|
|
List<Followup> followups = new ArrayList<>();
|
|
|
|
|
|
if (StringUtils.isNotBlank(response)) {
|
|
|
JSONObject reobj = JSON.parseObject(response);
|
|
|
Integer status = reobj.getInteger("status");
|
|
|
String errmsg = reobj.getString("msg");
|
|
|
if (200 == status) {
|
|
|
JSONObject jwData = reobj.getJSONObject("data");
|
|
|
Integer jwCode = jwData.getInteger("CODE");
|
|
|
if (1 == jwCode) {
|
|
|
JSONArray dataArray = jwData.getJSONArray("DATA");
|
|
|
for (int i = 0; i < dataArray.size(); i++) {
|
|
|
Followup followup = new Followup();
|
|
|
String url = jwUrl + "/third/sign/getEhrChroDaysFollowUpInfoRecord";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("TIME_START", startdate));//开始时间
|
|
|
params.add(new BasicNameValuePair("TIME_END", enddate));//结束时间
|
|
|
params.add(new BasicNameValuePair("ORG_CODE", hospitalMapping.getCode()));//机构编码
|
|
|
// params.add(new BasicNameValuePair("IDENTITY_CARD_NO", "350221197506113526"));//身份证
|
|
|
String response = httpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
JSONObject json = dataArray.getJSONObject(i);
|
|
|
//居民随访记录
|
|
|
List<Followup> followups = new ArrayList<>();
|
|
|
|
|
|
SignFamily sign = null;
|
|
|
if (StringUtils.isNotBlank(response)) {
|
|
|
JSONObject reobj = JSON.parseObject(response);
|
|
|
Integer status = reobj.getInteger("status");
|
|
|
String errmsg = reobj.getString("msg");
|
|
|
if (200 == status) {
|
|
|
JSONObject jwData = reobj.getJSONObject("data");
|
|
|
Integer jwCode = jwData.getInteger("CODE");
|
|
|
if (1 == jwCode) {
|
|
|
JSONArray dataArray = jwData.getJSONArray("DATA");
|
|
|
for (int i = 0; i < dataArray.size(); i++) {
|
|
|
Followup followup = new Followup();
|
|
|
|
|
|
JSONObject json = dataArray.getJSONObject(i);
|
|
|
|
|
|
SignFamily sign = null;
|
|
|
|
|
|
//随访主表信息
|
|
|
String isNewCreate = json.getString("IS_NEW_CREATE");//是否新增
|
|
|
String followupNo = json.getString("FOLLOWUP_NO");//随访编号【基卫】:家庭医生服务随访主表ID
|
|
|
String dataFrom = json.getString("FOLLOWUP_SOURCE");//随访来源 1.平台端 2.移动端 3.第三方健康之路(移动端)"
|
|
|
|
|
|
// if ("0".equals(isNewCreate) || "3".equals(dataFrom)) {//修改
|
|
|
// followup = followUpDao.findByFollowupNo(followupNo);
|
|
|
// if(followup == null){
|
|
|
// followup = new Followup();
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
//随访主表信息
|
|
|
String isNewCreate = json.getString("IS_NEW_CREATE");//是否新增
|
|
|
String followupNo = json.getString("FOLLOWUP_NO");//随访编号【基卫】:家庭医生服务随访主表ID
|
|
|
String dataFrom = json.getString("FOLLOWUP_SOURCE");//随访来源 1.平台端 2.移动端 3.第三方健康之路(移动端)"
|
|
|
|
|
|
if ("0".equals(isNewCreate) || "3".equals(dataFrom)) {//修改
|
|
|
followup = followUpDao.findByFollowupNo(followupNo);
|
|
|
if (followup == null) {
|
|
|
followup.setFollowupNo(followupNo);
|
|
|
if(followup == null){
|
|
|
followup = new Followup();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ("1".equals(dataFrom) || "2".equals(dataFrom)) {
|
|
|
followup.setDataFrom("1");
|
|
|
} else if ("3".equals(dataFrom)) {
|
|
|
followup.setDataFrom("2");
|
|
|
}
|
|
|
followup.setDataFrom(dataFrom);
|
|
|
|
|
|
String followupDate = json.getString("THIS_FOLLOWUP_VISIT_DATE");//随访时间:此次随访时间
|
|
|
followup.setFollowupDate(DateUtil.strToDate(followupDate));
|
|
|
String followupPlanDate = "";//随访计划时间
|
|
|
String followupNextDate = json.getString("NEXT_FOLLOWUP_DATE");//计划下次随访时间:下次随访时间
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(followupNextDate));
|
|
|
|
|
|
/******************* 医生机构映射 ****************/
|
|
|
|
|
|
String orgCode = json.getString("ORG_CODE");//机构编码
|
|
|
followup.setOrgCode(orgCode);
|
|
|
String jwdoctorCode = json.getString("FOLLOWUP_VISIT_DOCTOR_NAME");//基卫医生CODE:随访医生 基卫系统的随访医生ID
|
|
|
followup.setJwdoctorCode(jwdoctorCode);
|
|
|
//医院映射
|
|
|
HospitalMapping hm = hospitalMappingDao.getCodeByMapping(orgCode, "1");
|
|
|
if (hm == null) {
|
|
|
logger.info("no mapping hospital:" + orgCode);
|
|
|
continue;
|
|
|
}
|
|
|
//医生映射
|
|
|
Doctor doctor = doctorDao.findMappingDoctor(jwdoctorCode, orgCode);
|
|
|
if (doctor == null) {
|
|
|
logger.info("no mapping hospital:" + orgCode + ",familyDoctor:" + jwdoctorCode);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
String doctorCode = doctor.getCode();//医生CODE
|
|
|
String doctorName = doctor.getName();//医生姓名 "FOLLOWUP_VISIT_DOCTOR_NAME_N":"随访医生 基卫系统的随访医生中文名"
|
|
|
String orgName = hm.getName();//机构名称
|
|
|
followup.setDoctorCode(doctorCode);
|
|
|
followup.setDoctorName(doctorName);
|
|
|
followup.setOrgName(orgName);
|
|
|
|
|
|
String idcard = json.getString("IDENTITY_CARD_NO");//患者身份证
|
|
|
Patient patient = patientDao.findByIdcard(idcard);
|
|
|
String patientCode = patient.getCode();//患者CODE
|
|
|
String patientName = patient.getName();//患者姓名
|
|
|
followup.setIdcard(idcard);
|
|
|
followup.setPatientCode(patientCode);
|
|
|
followup.setPatientName(patientName);
|
|
|
|
|
|
String followupStatus = "1";//状态 0取消 1已完成 2未开始 3进行中 *基卫没有状态字段,传递过来的默认都是已完成的*
|
|
|
String followupContentPhone = "";//电话随访内容 -------
|
|
|
String followupManagerStatus = "";//随访管理状态【字典FOLLOWUP_MANAGER_STATUS】-------
|
|
|
String followupClass = json.getString("FAMILY_FOLLOWUP_CLASS_NAMES");//随访类别【1.高血压 2.糖尿病】
|
|
|
|
|
|
if (followupClass.contains("高血压") && followupClass.contains("糖尿病")) {
|
|
|
followupClass = "1,2";
|
|
|
}else if(followupClass.contains("高血压")){
|
|
|
followupClass= "1";
|
|
|
}else if(followupClass.contains("糖尿病")){
|
|
|
followupClass= "2";
|
|
|
}else{}
|
|
|
|
|
|
String visitWayCode = json.getString("VISIT_WAY_CODE");//随访来源 1.门诊,2.家庭,3.电话,4.健康小屋
|
|
|
String creater = doctor.getCode();//创建者
|
|
|
followup.setStatus(followupStatus);
|
|
|
followup.setFollowupClass(followupClass);
|
|
|
followup.setFollowupType(visitWayCode);
|
|
|
followup.setCreater(creater);
|
|
|
|
|
|
//判断是否存在
|
|
|
sign = signFamilyDao.findByIdcard(idcard);
|
|
|
//判断是否存在签约修改身份证情况
|
|
|
if (sign == null) {
|
|
|
logger.info("no sign familyy patient idcard:" + idcard);
|
|
|
continue;
|
|
|
}
|
|
|
Integer signType = Integer.parseInt(sign.getSignSource());//签约类型 1三师 2家庭
|
|
|
Long adminTeamCode = new Long(sign.getAdminTeamId());//行政团队
|
|
|
String signCode = sign.getCode();//签约表Code
|
|
|
followup.setAdminTeamCode(adminTeamCode);
|
|
|
followup.setSignCode(signCode);
|
|
|
|
|
|
//随访记录详
|
|
|
HashMap<String, String> followupContent1 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent2 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent3 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent4 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent5 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent6 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent7 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent8 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent9 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent10 = new HashMap<>();
|
|
|
|
|
|
//症状
|
|
|
followupContent1.put("NO_SYMPTOM", json.getString("NO_SYMPTOM"));//无症状【0.无 1.有】
|
|
|
followupContent1.put("HEADACHE", json.getString("HEADACHE"));//头痛头晕【0.无 1.有】
|
|
|
followupContent1.put("NAUSEA", json.getString("NAUSEA"));//恶心呕吐【0.无 1.有】
|
|
|
followupContent1.put("VERTIGO_TINNITUS", json.getString("VERTIGO_TINNITUS"));//眼花耳鸣【0.无 1.有】
|
|
|
followupContent1.put("DIFFICULTY_BREATHING", json.getString("DIFFICULTY_BREATHING"));//呼吸困难【0.无 1.有】
|
|
|
followupContent1.put("PALPITATIONS", json.getString("PALPITATIONS"));//心悸胸闷【0.无 1.有】
|
|
|
followupContent1.put("EPISTAXIS_BLEEDING", json.getString("EPISTAXIS_BLEEDING"));//鼻衄出血不止【0.无 1.有】
|
|
|
followupContent1.put("LIMBS_NUMB", json.getString("LIMBS_NUMB"));//四肢发麻【0.无 1.有】
|
|
|
followupContent1.put("EXTREMITY_EDEMA", json.getString("EXTREMITY_EDEMA"));//下肢水肿【0.无 1.有】
|
|
|
followupContent1.put("SYMPTOM_OTHER", json.getString("SYMPTOM_OTHER"));//"其他症状"
|
|
|
followupContent1.put("POLYDIPSIA", json.getString("POLYDIPSIA"));//多饮【0.无 1.有】
|
|
|
followupContent1.put("MORE_FOOD", json.getString("MORE_FOOD"));//多食【0.无 1.有】
|
|
|
followupContent1.put("MORE_URINE", json.getString("MORE_URINE"));//多尿【0.无 1.有】
|
|
|
followupContent1.put("BLURRED_VISION", json.getString("BLURRED_VISION"));//视力模糊【0.无 1.有】
|
|
|
followupContent1.put("INFECTION", json.getString("INFECTION"));//感染【0.无 1.有】
|
|
|
followupContent1.put("NUMB_HANDS", json.getString("NUMB_HANDS"));//手脚麻木【0.无 1.有】
|
|
|
followupContent1.put("WEIGHT_LOSS", json.getString("WEIGHT_LOSS"));//体重明显下降【0.无 1.有】
|
|
|
followupContent1.put("HYPOG_REACT_CODE", json.getString("HYPOG_REACT_CODE"));//低血糖反应【0.无;1.偶尔;2.频繁;】
|
|
|
|
|
|
//体征信息
|
|
|
followupContent2.put("HEIGHT", json.getString("HEIGHT"));//身高
|
|
|
followupContent2.put("HEIGHT_EXP", json.getString("HEIGHT_EXP"));//期望身高
|
|
|
followupContent2.put("WEIGHT", json.getString("WEIGHT"));//体重
|
|
|
followupContent2.put("WEIGHT_EXP", json.getString("WEIGHT_EXP"));//期望体重
|
|
|
followupContent2.put("BP_D", json.getString("BP_D"));//舒张压
|
|
|
followupContent2.put("BP_U", json.getString("BP_U"));//收缩压
|
|
|
followupContent2.put("BS_FPG", json.getString("BS_FPG"));//空腹血糖
|
|
|
followupContent2.put("NO_BS_FPG", json.getString("NO_BS_FPG"));//餐后血糖
|
|
|
followupContent2.put("RANDOM_BLOOD_SUGAR", json.getString("RANDOM_BLOOD_SUGAR"));//随机血糖
|
|
|
followupContent2.put("BMI", json.getString("BMI"));//体质指数
|
|
|
followupContent2.put("BMI_EXP", json.getString("BMI_EXP"));//期望体质
|
|
|
followupContent2.put("OTHER_POSITIVE_SIGNS", json.getString("OTHER_POSITIVE_SIGNS"));//体征其他
|
|
|
followupContent2.put("POFDA_MARK", json.getString("POFDA_MARK"));//足背动脉搏动【TOUCH_DICT】
|
|
|
followupContent2.put("HEART_RATE", json.getString("HEART_RATE"));//心率
|
|
|
|
|
|
//检查室检查
|
|
|
followupContent3.put("GHB", json.getString("GHB"));//糖化血红蛋白
|
|
|
followupContent3.put("RENAL_FUNCTION_CREATININE", json.getString("RENAL_FUNCTION_CREATININE"));//血清肌酐
|
|
|
followupContent3.put("RENAL_FUNCTION_BUN", json.getString("RENAL_FUNCTION_BUN"));//血尿素氮
|
|
|
followupContent3.put("MICROALBUMINURIA", json.getString("MICROALBUMINURIA"));//尿微量白蛋白
|
|
|
followupContent3.put("EXAM_DATE", json.getString("EXAM_DATE"));//检查日期
|
|
|
followupContent3.put("BLOOD_FAT_TRIGLYCERIDE", json.getString("BLOOD_FAT_TRIGLYCERIDE"));//甘油三酯 V01
|
|
|
followupContent3.put("BLOOD_FAT_TC", json.getString("BLOOD_FAT_TC"));//总胆固醇 V02
|
|
|
followupContent3.put("BLOOD_FAT_LDLC", json.getString("BLOOD_FAT_LDLC"));//血清低密度脂蛋白胆固醇 V03
|
|
|
|
|
|
//生活方式
|
|
|
followupContent4.put("DAILY_SMOKING", json.getString("DAILY_SMOKING"));//日吸烟量
|
|
|
followupContent4.put("SOMKING_EXP", json.getString("SOMKING_EXP"));//日吸烟期望
|
|
|
followupContent4.put("DAILY_DRINKING", json.getString("DAILY_DRINKING"));//日饮酒量
|
|
|
followupContent4.put("DRINK_EXP", json.getString("DRINK_EXP"));//日饮酒期望
|
|
|
followupContent4.put("EXERCISE_FREQ_CODE", json.getString("EXERCISE_FREQ_CODE"));//运动频率【HYGIENE_SPORT_FREQ_DICT】
|
|
|
followupContent4.put("EXERCISE_FREQ_CODE_EXP", json.getString("EXERCISE_FREQ_CODE_EXP"));//运动频率期望【HYGIENE_SPORT_FREQ_DICT】
|
|
|
followupContent4.put("EXERCISE_DURATION_MINS", json.getString("EXERCISE_DURATION_MINS"));//运动时长(min) 分钟/次
|
|
|
followupContent4.put("EXERCISE_DURATION_MINS_EXP", json.getString("EXERCISE_DURATION_MINS_EXP"));//运动时长期望(min) 分钟/次期望
|
|
|
followupContent4.put("SALT_TAKEN_LEVEL_CODE", json.getString("SALT_TAKEN_LEVEL_CODE"));//摄盐情况【LIGHT_WEIGHT_DICT】
|
|
|
followupContent4.put("SALT_TAKEN_LEVEL_EXP", json.getString("SALT_TAKEN_LEVEL_EXP"));//摄盐情况期望【LIGHT_WEIGHT_DICT】
|
|
|
followupContent4.put("PSY_ADJUST_RESULT_CODE", json.getString("PSY_ADJUST_RESULT_CODE"));//心里调整【GOOD_FAIR_POOR_DICT】
|
|
|
followupContent4.put("COMPLIANCE_RESULT_CODE", json.getString("COMPLIANCE_RESULT_CODE"));//遵医行为【GOOD_FAIR_POOR_DICT】
|
|
|
followupContent4.put("DAILY_STAPLE", json.getString("DAILY_STAPLE"));//主食(克/天)
|
|
|
|
|
|
//随访评价
|
|
|
followupContent5.put("HYP_FOLLOWUP_TYPE_CODE", json.getString("HYP_FOLLOWUP_TYPE_CODE"));//高血压随访分类【FOLLOW_TYPE_DICT】
|
|
|
followupContent5.put("HYP_COMPLICATION_DETAIL", json.getString("HYP_COMPLICATION_DETAIL"));//高血压随访分类--详情
|
|
|
followupContent5.put("DIA_FOLLOWUP_TYPE_CODE", json.getString("DIA_FOLLOWUP_TYPE_CODE"));//糖尿病随访分类【FOLLOW_TYPE_DICT】
|
|
|
followupContent5.put("DIA_COMPLICATION_DETAIL", json.getString("DIA_COMPLICATION_DETAIL"));//糖尿病随访分类--详情
|
|
|
|
|
|
//用药情况
|
|
|
followupContent6.put("DRUG_COMPLIANCE_CODE", json.getString("DRUG_COMPLIANCE_CODE"));//服药依从性【DRUG_STATE_DICT】
|
|
|
|
|
|
followup.setFollowupNo(followupNo);
|
|
|
|
|
|
if ("1".equals(dataFrom) || "2".equals(dataFrom)) {
|
|
|
followup.setDataFrom("1");
|
|
|
} else if ("3".equals(dataFrom)) {
|
|
|
followup.setDataFrom("2");
|
|
|
}
|
|
|
followup.setDataFrom(dataFrom);
|
|
|
|
|
|
String followupDate = json.getString("THIS_FOLLOWUP_VISIT_DATE");//随访时间:此次随访时间
|
|
|
followup.setFollowupDate(DateUtil.strToDate(followupDate));
|
|
|
String followupPlanDate = "";//随访计划时间
|
|
|
String followupNextDate = json.getString("NEXT_FOLLOWUP_DATE");//计划下次随访时间:下次随访时间
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(followupNextDate));
|
|
|
followup.setFollowupPlanDate(DateUtil.strToDate(followupDate));
|
|
|
|
|
|
/******************* 医生机构映射 ****************/
|
|
|
|
|
|
String jworgCode = json.getString("ORG_CODE");//基卫机构编码
|
|
|
followup.setJworgCode(jworgCode);//基卫机构编码
|
|
|
String jwdoctorCode = json.getString("FOLLOWUP_VISIT_DOCTOR_NAME");//基卫医生CODE:随访医生 基卫系统的随访医生ID
|
|
|
followup.setJwdoctorCode(jwdoctorCode);
|
|
|
//医院映射
|
|
|
HospitalMapping hm = hospitalMappingDao.getCodeByMapping(jworgCode, "1");
|
|
|
if (hm == null) {
|
|
|
logger.info("no mapping hospital:" + jworgCode);
|
|
|
continue;
|
|
|
}
|
|
|
//医生映射
|
|
|
Doctor doctor = doctorDao.findMappingDoctor(jwdoctorCode, jworgCode);
|
|
|
if (doctor == null) {
|
|
|
logger.info("no mapping hospital:" + jworgCode + ",familyDoctor:" + jwdoctorCode);
|
|
|
continue;
|
|
|
}
|
|
|
followup.setOrgCode(hm.getCode());//i健康机构编码
|
|
|
String doctorCode = doctor.getCode();//医生CODE
|
|
|
String doctorName = doctor.getName();//医生姓名 "FOLLOWUP_VISIT_DOCTOR_NAME_N":"随访医生 基卫系统的随访医生中文名"
|
|
|
String orgName = hm.getName();//机构名称
|
|
|
followup.setDoctorCode(doctorCode);
|
|
|
followup.setDoctorName(doctorName);
|
|
|
followup.setOrgName(orgName);
|
|
|
|
|
|
String idcard = json.getString("IDENTITY_CARD_NO");//患者身份证
|
|
|
Patient patient = patientDao.findByIdcard(idcard);
|
|
|
String patientCode = patient.getCode();//患者CODE
|
|
|
String patientName = patient.getName();//患者姓名
|
|
|
followup.setIdcard(idcard);
|
|
|
followup.setPatientCode(patientCode);
|
|
|
followup.setPatientName(patientName);
|
|
|
|
|
|
String followupStatus = "1";//状态 0取消 1已完成 2未开始 3进行中 *基卫没有状态字段,传递过来的默认都是已完成的*
|
|
|
String followupContentPhone = "";//电话随访内容 -------
|
|
|
String followupManagerStatus = "";//随访管理状态【字典FOLLOWUP_MANAGER_STATUS】-------
|
|
|
String followupClass = json.getString("FAMILY_FOLLOWUP_CLASS_NAMES");//随访类别【1.高血压 2.糖尿病】
|
|
|
|
|
|
if (followupClass.contains("高血压") && followupClass.contains("糖尿病")) {
|
|
|
followupClass = "1,2";
|
|
|
}else if(followupClass.contains("高血压")){
|
|
|
followupClass= "1";
|
|
|
}else if(followupClass.contains("糖尿病")){
|
|
|
followupClass= "2";
|
|
|
}else{}
|
|
|
|
|
|
String visitWayCode = json.getString("VISIT_WAY_CODE");//随访来源 1.门诊,2.家庭,3.电话,4.健康小屋
|
|
|
String creater = doctor.getCode();//创建者
|
|
|
followup.setStatus(followupStatus);
|
|
|
followup.setFollowupClass(followupClass);
|
|
|
followup.setFollowupType(visitWayCode);
|
|
|
followup.setCreater(creater);
|
|
|
|
|
|
//判断是否存在
|
|
|
sign = signFamilyDao.findByIdcard(idcard);
|
|
|
//判断是否存在签约修改身份证情况
|
|
|
if (sign == null) {
|
|
|
logger.info("no sign familyy patient idcard:" + idcard);
|
|
|
continue;
|
|
|
}
|
|
|
Integer signType = Integer.parseInt(sign.getSignSource());//签约类型 1三师 2家庭
|
|
|
Long adminTeamCode = new Long(sign.getAdminTeamId());//行政团队
|
|
|
String signCode = sign.getCode();//签约表Code
|
|
|
followup.setAdminTeamCode(adminTeamCode);
|
|
|
followup.setSignCode(signCode);
|
|
|
|
|
|
//随访记录详
|
|
|
HashMap<String, String> followupContent1 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent2 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent3 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent4 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent5 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent6 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent7 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent8 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent9 = new HashMap<>();
|
|
|
HashMap<String, String> followupContent10 = new HashMap<>();
|
|
|
|
|
|
//症状
|
|
|
followupContent1.put("NO_SYMPTOM", json.getString("NO_SYMPTOM"));//无症状【0.无 1.有】
|
|
|
followupContent1.put("HEADACHE", json.getString("HEADACHE"));//头痛头晕【0.无 1.有】
|
|
|
followupContent1.put("NAUSEA", json.getString("NAUSEA"));//恶心呕吐【0.无 1.有】
|
|
|
followupContent1.put("VERTIGO_TINNITUS", json.getString("VERTIGO_TINNITUS"));//眼花耳鸣【0.无 1.有】
|
|
|
followupContent1.put("DIFFICULTY_BREATHING", json.getString("DIFFICULTY_BREATHING"));//呼吸困难【0.无 1.有】
|
|
|
followupContent1.put("PALPITATIONS", json.getString("PALPITATIONS"));//心悸胸闷【0.无 1.有】
|
|
|
followupContent1.put("EPISTAXIS_BLEEDING", json.getString("EPISTAXIS_BLEEDING"));//鼻衄出血不止【0.无 1.有】
|
|
|
followupContent1.put("LIMBS_NUMB", json.getString("LIMBS_NUMB"));//四肢发麻【0.无 1.有】
|
|
|
followupContent1.put("EXTREMITY_EDEMA", json.getString("EXTREMITY_EDEMA"));//下肢水肿【0.无 1.有】
|
|
|
followupContent1.put("SYMPTOM_OTHER", json.getString("SYMPTOM_OTHER"));//"其他症状"
|
|
|
followupContent1.put("POLYDIPSIA", json.getString("POLYDIPSIA"));//多饮【0.无 1.有】
|
|
|
followupContent1.put("MORE_FOOD", json.getString("MORE_FOOD"));//多食【0.无 1.有】
|
|
|
followupContent1.put("MORE_URINE", json.getString("MORE_URINE"));//多尿【0.无 1.有】
|
|
|
followupContent1.put("BLURRED_VISION", json.getString("BLURRED_VISION"));//视力模糊【0.无 1.有】
|
|
|
followupContent1.put("INFECTION", json.getString("INFECTION"));//感染【0.无 1.有】
|
|
|
followupContent1.put("NUMB_HANDS", json.getString("NUMB_HANDS"));//手脚麻木【0.无 1.有】
|
|
|
followupContent1.put("WEIGHT_LOSS", json.getString("WEIGHT_LOSS"));//体重明显下降【0.无 1.有】
|
|
|
followupContent1.put("HYPOG_REACT_CODE", json.getString("HYPOG_REACT_CODE"));//低血糖反应【0.无;1.偶尔;2.频繁;】
|
|
|
|
|
|
//体征信息
|
|
|
followupContent2.put("HEIGHT", json.getString("HEIGHT"));//身高
|
|
|
followupContent2.put("HEIGHT_EXP", json.getString("HEIGHT_EXP"));//期望身高
|
|
|
followupContent2.put("WEIGHT", json.getString("WEIGHT"));//体重
|
|
|
followupContent2.put("WEIGHT_EXP", json.getString("WEIGHT_EXP"));//期望体重
|
|
|
followupContent2.put("BP_D", json.getString("BP_D"));//舒张压
|
|
|
followupContent2.put("BP_U", json.getString("BP_U"));//收缩压
|
|
|
followupContent2.put("BS_FPG", json.getString("BS_FPG"));//空腹血糖
|
|
|
followupContent2.put("NO_BS_FPG", json.getString("NO_BS_FPG"));//餐后血糖
|
|
|
followupContent2.put("RANDOM_BLOOD_SUGAR", json.getString("RANDOM_BLOOD_SUGAR"));//随机血糖
|
|
|
followupContent2.put("BMI", json.getString("BMI"));//体质指数
|
|
|
followupContent2.put("BMI_EXP", json.getString("BMI_EXP"));//期望体质
|
|
|
followupContent2.put("OTHER_POSITIVE_SIGNS", json.getString("OTHER_POSITIVE_SIGNS"));//体征其他
|
|
|
followupContent2.put("POFDA_MARK", json.getString("POFDA_MARK"));//足背动脉搏动【TOUCH_DICT】
|
|
|
followupContent2.put("HEART_RATE", json.getString("HEART_RATE"));//心率
|
|
|
|
|
|
//检查室检查
|
|
|
followupContent3.put("GHB", json.getString("GHB"));//糖化血红蛋白
|
|
|
followupContent3.put("RENAL_FUNCTION_CREATININE", json.getString("RENAL_FUNCTION_CREATININE"));//血清肌酐
|
|
|
followupContent3.put("RENAL_FUNCTION_BUN", json.getString("RENAL_FUNCTION_BUN"));//血尿素氮
|
|
|
followupContent3.put("MICROALBUMINURIA", json.getString("MICROALBUMINURIA"));//尿微量白蛋白
|
|
|
followupContent3.put("EXAM_DATE", json.getString("EXAM_DATE"));//检查日期
|
|
|
followupContent3.put("BLOOD_FAT_TRIGLYCERIDE", json.getString("BLOOD_FAT_TRIGLYCERIDE"));//甘油三酯 V01
|
|
|
followupContent3.put("BLOOD_FAT_TC", json.getString("BLOOD_FAT_TC"));//总胆固醇 V02
|
|
|
followupContent3.put("BLOOD_FAT_LDLC", json.getString("BLOOD_FAT_LDLC"));//血清低密度脂蛋白胆固醇 V03
|
|
|
|
|
|
//生活方式
|
|
|
followupContent4.put("DAILY_SMOKING", json.getString("DAILY_SMOKING"));//日吸烟量
|
|
|
followupContent4.put("SOMKING_EXP", json.getString("SOMKING_EXP"));//日吸烟期望
|
|
|
followupContent4.put("DAILY_DRINKING", json.getString("DAILY_DRINKING"));//日饮酒量
|
|
|
followupContent4.put("DRINK_EXP", json.getString("DRINK_EXP"));//日饮酒期望
|
|
|
followupContent4.put("EXERCISE_FREQ_CODE", json.getString("EXERCISE_FREQ_CODE"));//运动频率【HYGIENE_SPORT_FREQ_DICT】
|
|
|
followupContent4.put("EXERCISE_FREQ_CODE_EXP", json.getString("EXERCISE_FREQ_CODE_EXP"));//运动频率期望【HYGIENE_SPORT_FREQ_DICT】
|
|
|
followupContent4.put("EXERCISE_DURATION_MINS", json.getString("EXERCISE_DURATION_MINS"));//运动时长(min) 分钟/次
|
|
|
followupContent4.put("EXERCISE_DURATION_MINS_EXP", json.getString("EXERCISE_DURATION_MINS_EXP"));//运动时长期望(min) 分钟/次期望
|
|
|
followupContent4.put("SALT_TAKEN_LEVEL_CODE", json.getString("SALT_TAKEN_LEVEL_CODE"));//摄盐情况【LIGHT_WEIGHT_DICT】
|
|
|
followupContent4.put("SALT_TAKEN_LEVEL_EXP", json.getString("SALT_TAKEN_LEVEL_EXP"));//摄盐情况期望【LIGHT_WEIGHT_DICT】
|
|
|
followupContent4.put("PSY_ADJUST_RESULT_CODE", json.getString("PSY_ADJUST_RESULT_CODE"));//心里调整【GOOD_FAIR_POOR_DICT】
|
|
|
followupContent4.put("COMPLIANCE_RESULT_CODE", json.getString("COMPLIANCE_RESULT_CODE"));//遵医行为【GOOD_FAIR_POOR_DICT】
|
|
|
followupContent4.put("DAILY_STAPLE", json.getString("DAILY_STAPLE"));//主食(克/天)
|
|
|
|
|
|
//随访评价
|
|
|
followupContent5.put("HYP_FOLLOWUP_TYPE_CODE", json.getString("HYP_FOLLOWUP_TYPE_CODE"));//高血压随访分类【FOLLOW_TYPE_DICT】
|
|
|
followupContent5.put("HYP_COMPLICATION_DETAIL", json.getString("HYP_COMPLICATION_DETAIL"));//高血压随访分类--详情
|
|
|
followupContent5.put("DIA_FOLLOWUP_TYPE_CODE", json.getString("DIA_FOLLOWUP_TYPE_CODE"));//糖尿病随访分类【FOLLOW_TYPE_DICT】
|
|
|
followupContent5.put("DIA_COMPLICATION_DETAIL", json.getString("DIA_COMPLICATION_DETAIL"));//糖尿病随访分类--详情
|
|
|
|
|
|
//用药情况
|
|
|
followupContent6.put("DRUG_COMPLIANCE_CODE", json.getString("DRUG_COMPLIANCE_CODE"));//服药依从性【DRUG_STATE_DICT】
|
|
|
|
|
|
//控制目标
|
|
|
followupContent7.put("CONTROL_DATE", json.getString("CONTROL_DATE"));//控制日期 V04
|
|
|
|
|
|
String CONTROL_CONSTITUTOR = json.getString("CONTROL_CONSTITUTOR");
|
|
|
if(StringUtils.isNoneBlank(CONTROL_CONSTITUTOR) ){
|
|
|
if(jwdoctorCode.equals(CONTROL_CONSTITUTOR)){
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR", doctor.getName());//制定者姓名 V05
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR_DOCTORCODE", doctor.getCode());//制定者本地CODE V05
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR_JWDOCTORCODE", jwdoctorCode);//制定者本地CODE V05
|
|
|
}else{
|
|
|
Doctor control_doctor = doctorDao.findMappingDoctor(CONTROL_CONSTITUTOR, jworgCode);
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR", control_doctor.getName());//制定者姓名 V05
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR_DOCTORCODE", control_doctor.getCode());//制定者本地CODE V05
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR_JWDOCTORCODE", CONTROL_CONSTITUTOR);//制定者本地CODE V05
|
|
|
}
|
|
|
}
|
|
|
|
|
|
followupContent7.put("CONTROL_BP_U", json.getString("CONTROL_BP_U"));//血压收缩压 V06
|
|
|
followupContent7.put("CONTROL_BP_D", json.getString("CONTROL_BP_D"));//血压舒张压 V07
|
|
|
followupContent7.put("CONTROL_BS_FPG", json.getString("CONTROL_BS_FPG"));//空腹血糖 V08
|
|
|
followupContent7.put("CONTROL_NO_BS_FPG", json.getString("CONTROL_NO_BS_FPG"));//餐后血糖 V09
|
|
|
followupContent7.put("CONTROL_GHB", json.getString("CONTROL_GHB"));//糖化血红蛋白 V10
|
|
|
followupContent7.put("CONTROL_TRIGLYCERIDE", json.getString("CONTROL_TRIGLYCERIDE"));//甘油三酯 V11
|
|
|
followupContent7.put("CONTROL_TOTAL_CHOLESTEROL", json.getString("CONTROL_TOTAL_CHOLESTEROL"));//总胆固醇 V12
|
|
|
followupContent7.put("CONTROL_LDL", json.getString("CONTROL_LDL"));//低密度脂蛋白 V13
|
|
|
followupContent7.put("CONTROL_WEIGHT", json.getString("CONTROL_WEIGHT"));//体重 V14
|
|
|
followupContent7.put("CONTROL_EXERCISE_FREQ_CODE", json.getString("CONTROL_EXERCISE_FREQ_CODE"));//运动频率 V15
|
|
|
followupContent7.put("CONTROL_EXERCISE_DURATION_MINS", json.getString("CONTROL_EXERCISE_DURATION_MINS"));//运动时长 V16
|
|
|
|
|
|
//健康教育
|
|
|
followupContent8.put("ARCHIVE_TIME", json.getString("ARCHIVE_TIME"));//健康教育日期 V17
|
|
|
followupContent8.put("ARCHIVE_OPERATOR_NAME", json.getString("ARCHIVE_OPERATOR_NAME"));//健康教育记录者 基卫系统医生【传中文名称】 V18
|
|
|
followupContent8.put("HEALTH_EDUCATE", json.getString("HEALTH_EDUCATE"));//健康教育【CHRO_HEALTH_EDUCATE_DICT】 V19
|
|
|
followupContent8.put("EDUCATE_CONTENT", json.getString("EDUCATE_CONTENT"));//健康教育内容 V20
|
|
|
|
|
|
//转诊
|
|
|
followupContent9.put("DRUG_ADVERSE_MARK", json.getString("DRUG_ADVERSE_MARK"));//药物不良反应【0.无;1.有;】
|
|
|
followupContent9.put("ADR_REMARK", json.getString("ADR_REMARK"));//药物不良反应【内容】
|
|
|
followupContent9.put("TRANSFER_RESON", json.getString("TRANSFER_RESON"));//转诊原因
|
|
|
followupContent9.put("TRANSFER_ORG_DEPT", json.getString("TRANSFER_ORG_DEPT"));//转诊机构科室
|
|
|
followupContent9.put("REFUSE_REFERRAL", json.getString("REFUSE_REFERRAL"));//患者拒绝转诊【0 否 1 是】
|
|
|
followupContent9.put("REFUSE_REFERRAL_WHY", json.getString("REFUSE_REFERRAL_WHY"));//患者拒绝转诊内容
|
|
|
|
|
|
//多余字段
|
|
|
followupContent10.put("ARCHIVE_ID", json.getString("ARCHIVE_ID"));//档案ID
|
|
|
followupContent10.put("CHECK_FEE_TYPE", json.getString("CHECK_FEE_TYPE"));//检测费用类型
|
|
|
followupContent10.put("FAMILY_FOLLOWUP_ID", json.getString("FAMILY_FOLLOWUP_ID"));//随访细表外键随访ID
|
|
|
|
|
|
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
|
|
|
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); // 事物隔离级别,开启新事务
|
|
|
TransactionStatus transactionStatus = transactionManager.getTransaction(def); // 获得事务状态
|
|
|
try {
|
|
|
followup = followUpDao.save(followup);
|
|
|
Long followupId = followup.getId();
|
|
|
//删除原有记录
|
|
|
followupContentDao.deleteByFollowupId(followup.getId());
|
|
|
//组装数据
|
|
|
List<FollowupContent> newList = new ArrayList<>();
|
|
|
|
|
|
followupContent1.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("1");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent2.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("2");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent3.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("3");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent4.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("4");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent5.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("5");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent6.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("6");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent7.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("7");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent8.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("8");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent9.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("9");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent10.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("10");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContentDao.save(newList);
|
|
|
|
|
|
//控制目标
|
|
|
followupContent7.put("CONTROL_DATE", json.getString("CONTROL_DATE"));//控制日期 V04
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR", json.getString("CONTROL_CONSTITUTOR"));//制定者 V05
|
|
|
followupContent7.put("CONTROL_BP_U", json.getString("CONTROL_BP_U"));//血压收缩压 V06
|
|
|
followupContent7.put("CONTROL_BP_D", json.getString("CONTROL_BP_D"));//血压舒张压 V07
|
|
|
followupContent7.put("CONTROL_BS_FPG", json.getString("CONTROL_BS_FPG"));//空腹血糖 V08
|
|
|
followupContent7.put("CONTROL_NO_BS_FPG", json.getString("CONTROL_NO_BS_FPG"));//餐后血糖 V09
|
|
|
followupContent7.put("CONTROL_GHB", json.getString("CONTROL_GHB"));//糖化血红蛋白 V10
|
|
|
followupContent7.put("CONTROL_TRIGLYCERIDE", json.getString("CONTROL_TRIGLYCERIDE"));//甘油三酯 V11
|
|
|
followupContent7.put("CONTROL_TOTAL_CHOLESTEROL", json.getString("CONTROL_TOTAL_CHOLESTEROL"));//总胆固醇 V12
|
|
|
followupContent7.put("CONTROL_LDL", json.getString("CONTROL_LDL"));//低密度脂蛋白 V13
|
|
|
followupContent7.put("CONTROL_WEIGHT", json.getString("CONTROL_WEIGHT"));//体重 V14
|
|
|
followupContent7.put("CONTROL_EXERCISE_FREQ_CODE", json.getString("CONTROL_EXERCISE_FREQ_CODE"));//运动频率 V15
|
|
|
followupContent7.put("CONTROL_EXERCISE_DURATION_MINS", json.getString("CONTROL_EXERCISE_DURATION_MINS"));//运动时长 V16
|
|
|
List<FollowupDrugs> DRUG_LIST = new ArrayList<>();//用药记录
|
|
|
|
|
|
//健康教育
|
|
|
followupContent8.put("ARCHIVE_TIME", json.getString("ARCHIVE_TIME"));//健康教育日期 V17
|
|
|
followupContent8.put("ARCHIVE_OPERATOR_NAME", json.getString("ARCHIVE_OPERATOR_NAME"));//健康教育记录者 基卫系统医生【传中文名称】 V18
|
|
|
followupContent8.put("HEALTH_EDUCATE", json.getString("HEALTH_EDUCATE"));//健康教育【CHRO_HEALTH_EDUCATE_DICT】 V19
|
|
|
followupContent8.put("EDUCATE_CONTENT", json.getString("EDUCATE_CONTENT"));//健康教育内容 V20
|
|
|
|
|
|
//转诊
|
|
|
followupContent9.put("DRUG_ADVERSE_MARK", json.getString("DRUG_ADVERSE_MARK"));//药物不良反应【0.无;1.有;】
|
|
|
followupContent9.put("ADR_REMARK", json.getString("ADR_REMARK"));//药物不良反应【内容】
|
|
|
followupContent9.put("TRANSFER_RESON", json.getString("TRANSFER_RESON"));//转诊原因
|
|
|
followupContent9.put("TRANSFER_ORG_DEPT", json.getString("TRANSFER_ORG_DEPT"));//转诊机构科室
|
|
|
followupContent9.put("REFUSE_REFERRAL", json.getString("REFUSE_REFERRAL"));//患者拒绝转诊【0 否 1 是】
|
|
|
followupContent9.put("REFUSE_REFERRAL_WHY", json.getString("REFUSE_REFERRAL_WHY"));//患者拒绝转诊内容
|
|
|
|
|
|
//多余字段
|
|
|
followupContent10.put("ARCHIVE_ID", json.getString("ARCHIVE_ID"));//档案ID
|
|
|
followupContent10.put("CHECK_FEE_TYPE", json.getString("CHECK_FEE_TYPE"));//检测费用类型
|
|
|
followupContent10.put("FAMILY_FOLLOWUP_ID", json.getString("FAMILY_FOLLOWUP_ID"));//随访细表外键随访ID
|
|
|
|
|
|
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
|
|
|
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); // 事物隔离级别,开启新事务
|
|
|
TransactionStatus transactionStatus = transactionManager.getTransaction(def); // 获得事务状态
|
|
|
try {
|
|
|
followup = followUpDao.save(followup);
|
|
|
Long followupId = followup.getId();
|
|
|
//删除原有记录
|
|
|
followupContentDao.deleteByFollowupId(followup.getId());
|
|
|
//组装数据
|
|
|
List<FollowupContent> newList = new ArrayList<>();
|
|
|
|
|
|
followupContent1.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("1");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent2.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("2");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent3.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("3");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent4.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("4");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent5.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("5");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent6.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("6");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent7.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("7");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent8.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("8");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent9.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("9");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContent10.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
|
item.setFollowupProject("10");
|
|
|
item.setFollowupKey(k);
|
|
|
item.setFollowupValue(v);
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
followupContentDao.save(newList);
|
|
|
|
|
|
List<FollowupDrugs> DRUG_LIST = new ArrayList<>();//用药记录
|
|
|
|
|
|
for (int j = 1; j < 7; j++) {
|
|
|
if (json.containsKey("PHYSIC_NAME" + j)) {
|
|
|
FollowupDrugs drug = new FollowupDrugs();
|
|
|
drug.setFollowupId(followupId);
|
|
|
drug.setDrugsGroup("normal");
|
|
|
drug.setDrugsCode("");
|
|
|
drug.setDrugsName(json.getString("PHYSIC_NAME" + j));//药物名称
|
|
|
drug.setDose(Double.valueOf(json.getString("PHYSIC_DOSE" + j)));//剂量
|
|
|
drug.setUnit(json.getString("PHYSIC_UNIT" + j));//单位【MEASURE_UNIT_DICT】
|
|
|
drug.setFrequency(json.getString("FREQUENCY" + j));//频次【RECIPE_FREQUENCY_DICT】
|
|
|
drug.setCreateTime(new Date());
|
|
|
DRUG_LIST.add(drug);
|
|
|
for (int j = 1; j < 7; j++) {
|
|
|
if (json.containsKey("PHYSIC_NAME" + j)) {
|
|
|
FollowupDrugs drug = new FollowupDrugs();
|
|
|
drug.setFollowupId(followupId);
|
|
|
drug.setDrugsGroup("normal");
|
|
|
drug.setDrugsCode("");
|
|
|
drug.setDrugsName(json.getString("PHYSIC_NAME" + j));//药物名称
|
|
|
if(StringUtils.isNoneBlank(json.getString("PHYSIC_DOSE" + j))){
|
|
|
drug.setDose(Double.valueOf(json.getString("PHYSIC_DOSE" + j)));//剂量
|
|
|
}
|
|
|
|
|
|
drug.setUnit(json.getString("PHYSIC_UNIT" + j));//单位【MEASURE_UNIT_DICT】
|
|
|
drug.setFrequency(json.getString("FREQUENCY" + j));//频次【RECIPE_FREQUENCY_DICT】
|
|
|
drug.setCreateTime(new Date());
|
|
|
DRUG_LIST.add(drug);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (int k = 1; k < 4; k++) {
|
|
|
if (json.containsKey("PHYSIC_NAME" + k)) {
|
|
|
FollowupDrugs drug = new FollowupDrugs();
|
|
|
drug.setFollowupId(followupId);
|
|
|
drug.setDrugsGroup("insulin");
|
|
|
drug.setDrugsCode("");
|
|
|
drug.setDrugsName(json.getString("INSULIN_NAME" + k));//胰岛素药物名称
|
|
|
drug.setDose(Double.valueOf(json.getString("INSULIN_DOSE" + k)));//胰岛素剂量
|
|
|
drug.setUnit(json.getString("INSULIN_UNIT" + k));//v单位【MEASURE_UNIT_DICT】
|
|
|
drug.setFrequency(json.getString("INSULIN_FREQUENCY" + k));//胰岛素频次【RECIPE_FREQUENCY_DICT】
|
|
|
drug.setCreateTime(new Date());
|
|
|
DRUG_LIST.add(drug);
|
|
|
|
|
|
for (int k = 1; k < 4; k++) {
|
|
|
if (json.containsKey("PHYSIC_NAME" + k)) {
|
|
|
FollowupDrugs drug = new FollowupDrugs();
|
|
|
drug.setFollowupId(followupId);
|
|
|
drug.setDrugsGroup("insulin");
|
|
|
drug.setDrugsCode("");
|
|
|
drug.setDrugsName(json.getString("INSULIN_NAME" + k));//胰岛素药物名称
|
|
|
if(StringUtils.isNoneBlank(json.getString("INSULIN_DOSE" + k))){
|
|
|
drug.setDose(Double.valueOf(json.getString("INSULIN_DOSE" + k)));//胰岛素剂量
|
|
|
}
|
|
|
drug.setUnit(json.getString("INSULIN_UNIT" + k));//v单位【MEASURE_UNIT_DICT】
|
|
|
drug.setFrequency(json.getString("INSULIN_FREQUENCY" + k));//胰岛素频次【RECIPE_FREQUENCY_DICT】
|
|
|
drug.setCreateTime(new Date());
|
|
|
DRUG_LIST.add(drug);
|
|
|
}
|
|
|
}
|
|
|
//删除原有用药记录
|
|
|
followupDrugsDao.deleteByFollowupId(followupId);
|
|
|
followupDrugsDao.save(DRUG_LIST);
|
|
|
|
|
|
transactionManager.commit(transactionStatus);
|
|
|
} catch (Exception ex) {
|
|
|
logger.info("同步随访信息报错,errmessage:" + ex.toString());
|
|
|
transactionManager.rollback(transactionStatus);
|
|
|
continue;
|
|
|
}
|
|
|
//删除原有用药记录
|
|
|
followupDrugsDao.deleteByFollowupId(followupId);
|
|
|
followupDrugsDao.save(DRUG_LIST);
|
|
|
|
|
|
transactionManager.commit(transactionStatus);
|
|
|
} catch (Exception ex) {
|
|
|
logger.info("同步随访信息报错,errmessage:" + ex.toString());
|
|
|
transactionManager.rollback(transactionStatus);
|
|
|
continue;
|
|
|
}
|
|
|
} else {
|
|
|
String jwMessage = jwData.getString("MESSAGE");
|
|
|
logger.info("同步随访信息报错接口失败:" + jwMessage+",hosipitalcode" + hospitalMapping.getCode());
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
String jwMessage = jwData.getString("MESSAGE");
|
|
|
throw new Exception("同步随访信息报错接口失败:" + jwMessage);
|
|
|
logger.info("同步随访信息报错接口失败:" + errmsg+",hosipitalcode" + hospitalMapping.getCode());
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
throw new Exception("同步随访信息报错请求失败," + errmsg);
|
|
|
logger.info("同步随访信息报错接口失败:无数据返回, hosipitalcode" + hospitalMapping.getCode());
|
|
|
continue;
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("同步随访信息报错请求失败,无数据返回!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 上传居民随访记录到基卫
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void uploadFollowUpRecordToJW() throws Exception {
|
|
|
//查找出需要上传的随访映射记录
|
|
|
List<Followup> followupMappings = followUpDao.findByFollowMappingNeedUpload(1);
|
|
@ -854,17 +887,26 @@ public class JwPrescriptionService {
|
|
|
String OPERATOR = followup.getJwdoctorCode();//操作员&录入医生
|
|
|
if (StringUtils.isBlank(OPERATOR)) {
|
|
|
OPERATOR = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(followup.getDoctorCode(), followup.getOrgCode());
|
|
|
followup.setJwdoctorCode(OPERATOR);
|
|
|
}
|
|
|
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();//机构编码
|
|
|
String ORG_CODE = followup.getOrgCode();//本地机构编码
|
|
|
String JW_ORG_CODE = followup.getJworgCode();//基卫机构编码
|
|
|
if(StringUtils.isBlank(JW_ORG_CODE)){
|
|
|
JW_ORG_CODE = hospitalMappingDao.getMappingCode(ORG_CODE,"1");
|
|
|
followup.setJworgCode(JW_ORG_CODE);
|
|
|
}
|
|
|
String FOLLOWUP_SOURCE = "3";//健康之路移动端
|
|
|
String IDENTITY_CARD_NO = followup.getIdcard();
|
|
|
String FAMILY_FOLLOWUP_CLASS_NAMES = followup.getFollowupClass();
|
|
@ -873,11 +915,11 @@ 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);
|
|
|
followupResultMap.put("ORG_CODE",ORG_CODE);
|
|
|
followupResultMap.put("ORG_CODE",JW_ORG_CODE);
|
|
|
followupResultMap.put("FOLLOWUP_SOURCE",FOLLOWUP_SOURCE);
|
|
|
followupResultMap.put("IDENTITY_CARD_NO",IDENTITY_CARD_NO);
|
|
|
followupResultMap.put("FAMILY_FOLLOWUP_CLASS_NAMES",FAMILY_FOLLOWUP_CLASS_NAMES);
|
|
@ -889,6 +931,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
|
|
@ -901,6 +944,32 @@ 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_JWDOCTORCODE")){
|
|
|
followupResultMap.put("CONTROL_CONSTITUTOR",followupResultMap.get("CONTROL_CONSTITUTOR_JWDOCTORCODE"));//基卫控制目标操作者
|
|
|
}else{
|
|
|
//基卫控制目标操作者,判断是否有控制者名称或者控制者CODE
|
|
|
if(followupResultMap.containsKey("CONTROL_CONSTITUTOR") || followupResultMap.containsKey("CONTROL_CONSTITUTOR_DOCTORCODE")){
|
|
|
|
|
|
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<>();//其他药品
|
|
@ -922,33 +991,50 @@ public class JwPrescriptionService {
|
|
|
DecimalFormat df = new DecimalFormat("######0.00");
|
|
|
|
|
|
//普通药品
|
|
|
if(!followupDrugsNormal.isEmpty()){
|
|
|
for (int i = 0; i < followupDrugsNormal.size(); i++) {
|
|
|
// if(!followupDrugsNormal.isEmpty()){
|
|
|
for (int i = 0; i <= 6; i++) {
|
|
|
int tag = i+1;
|
|
|
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.isEmpty() && followupDrugsNormal.size() >0 && followupDrugsNormal.size() <= tag){
|
|
|
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());
|
|
|
if(followupDrugsNormal.get(i).getDose() !=null){
|
|
|
followupResultMap.put("PHYSIC_DOSE"+tag,df.format(followupDrugsNormal.get(i).getDose()));
|
|
|
}else{
|
|
|
followupResultMap.put("PHYSIC_DOSE"+tag,"");
|
|
|
}
|
|
|
}else{
|
|
|
followupResultMap.put("PHYSIC_NAME"+tag,"");
|
|
|
followupResultMap.put("FREQUENCY"+tag,"");
|
|
|
followupResultMap.put("PHYSIC_UNIT"+tag,"");
|
|
|
followupResultMap.put("PHYSIC_DOSE"+tag,"");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// }
|
|
|
|
|
|
//胰岛素类药品
|
|
|
if(!followupDrugsInsulin.isEmpty()){
|
|
|
for (int j= 0; j < followupDrugsInsulin.size(); j++) {
|
|
|
int tag = j+1;
|
|
|
followupResultMap.put("PHYSIC_NAME"+tag,followupDrugsInsulin.get(j).getDrugsName());
|
|
|
followupResultMap.put("FREQUENCY"+tag,followupDrugsInsulin.get(j).getFrequency());
|
|
|
followupResultMap.put("PHYSIC_UNIT"+tag,followupDrugsInsulin.get(j).getUnit());
|
|
|
followupResultMap.put("PHYSIC_DOSE"+tag,df.format(followupDrugsInsulin.get(j).getDose()));
|
|
|
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());
|
|
|
if(followupDrugsInsulin.get(j).getDose() !=null){
|
|
|
followupResultMap.put("INSULIN_DOSE"+tag,df.format(followupDrugsInsulin.get(j).getDose()));
|
|
|
}else{
|
|
|
followupResultMap.put("INSULIN_DOSE","");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
jsonObject = JSONObject.parseObject(JSON.toJSONString(followupResultMap));
|
|
|
|
|
|
String url = jwUrl + "/third/archives/uploadEhrSickChroDaysFollowUpRecord";
|
|
|
String url = jwUrl + "/third/sign/uploadEhrSickChroDaysFollowUpRecord";
|
|
|
|
|
|
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");
|
|
|
|
|
@ -963,8 +1049,6 @@ public class JwPrescriptionService {
|
|
|
JSONArray dataArray = jwData.getJSONArray("DATA");
|
|
|
for (int i = 0; i < dataArray.size(); i++) {
|
|
|
|
|
|
OldPeoplePhysicalExaminationEntity oldPeoplePhysicalExaminationEntity = new OldPeoplePhysicalExaminationEntity();
|
|
|
|
|
|
JSONObject json = dataArray.getJSONObject(i);
|
|
|
|
|
|
String jw_followup_no = json.getString("FOLLOWUP_NO");
|
|
@ -972,24 +1056,28 @@ public class JwPrescriptionService {
|
|
|
followup.setFollowupNo(jw_followup_no);
|
|
|
|
|
|
followUpDao.save(followup);//获取的基卫随访主表ID,更新回数据库
|
|
|
|
|
|
String strid = String.valueOf(followup.getId());
|
|
|
|
|
|
followUpMappingDao.updateNeedUploadByFollowupId(0,Integer.parseInt(strid));
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
String jwMessage = jwData.getString("MESSAGE");
|
|
|
logger.info("随访记录上传失败,普通药品或者胰岛素类药瓶超过了上线,随访主表ID:" + followup.getId().toString()+",err:"+jwMessage);
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err:"+jwMessage);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
logger.info("随访记录上传失败,普通药品或者胰岛素类药瓶超过了上线,随访主表ID:" + followup.getId().toString()+",err:请求失败");
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err:请求失败"+errmsg);
|
|
|
continue;
|
|
|
}
|
|
|
} else {
|
|
|
logger.info("随访记录上传失败,普通药品或者胰岛素类药瓶超过了上线,随访主表ID:" + followup.getId().toString()+",无返回值");
|
|
|
logger.info("随访记录上传失败:" + followup.getId().toString()+",无返回值");
|
|
|
continue;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.info("随访记录上传失败,普通药品或者胰岛素类药瓶超过了上线,随访主表ID:" + followup.getId().toString()+",err"+e.getMessage());
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err"+e.getMessage());
|
|
|
continue;
|
|
|
}
|
|
|
}
|