|
@ -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;
|
|
@ -644,7 +638,21 @@ public class JwPrescriptionService {
|
|
|
|
|
|
//控制目标
|
|
|
followupContent7.put("CONTROL_DATE", json.getString("CONTROL_DATE"));//控制日期 V04
|
|
|
followupContent7.put("CONTROL_CONSTITUTOR", json.getString("CONTROL_CONSTITUTOR"));//制定者 V05
|
|
|
|
|
|
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
|
|
@ -686,7 +694,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 +704,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent2.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -706,7 +714,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent3.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -716,7 +724,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent4.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -726,7 +734,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent5.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -736,7 +744,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent6.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -746,7 +754,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent7.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -756,7 +764,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent8.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -766,7 +774,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent9.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -776,7 +784,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContent10.forEach((k, v) -> {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(followupId);
|
|
@ -786,7 +794,7 @@ public class JwPrescriptionService {
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
});
|
|
|
|
|
|
|
|
|
followupContentDao.save(newList);
|
|
|
|
|
|
List<FollowupDrugs> DRUG_LIST = new ArrayList<>();//用药记录
|
|
@ -883,11 +891,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 +915,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 +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
|
|
@ -932,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<>();//其他药品
|
|
@ -953,15 +991,26 @@ 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()){
|
|
@ -970,7 +1019,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 +1034,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 +1069,7 @@ public class JwPrescriptionService {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err:请求失败");
|
|
|
logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err:请求失败"+errmsg);
|
|
|
continue;
|
|
|
}
|
|
|
} else {
|