|
@@ -8,6 +8,7 @@ import com.diagbot.entity.*;
|
|
import com.diagbot.facade.BehospitalInfoFacade;
|
|
import com.diagbot.facade.BehospitalInfoFacade;
|
|
import com.diagbot.facade.ModelHospitalFacade;
|
|
import com.diagbot.facade.ModelHospitalFacade;
|
|
import com.diagbot.facade.QcAbnormalFacade;
|
|
import com.diagbot.facade.QcAbnormalFacade;
|
|
|
|
+import com.diagbot.facade.QcTypeFacade;
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
@@ -47,6 +48,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
@Qualifier("qcAbnormalServiceImpl")
|
|
@Qualifier("qcAbnormalServiceImpl")
|
|
private QcAbnormalServiceImpl qcAbnormalService;
|
|
private QcAbnormalServiceImpl qcAbnormalService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private QcTypeFacade qcTypeFacade;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ReadProperties readProperties;
|
|
private ReadProperties readProperties;
|
|
|
|
|
|
@@ -185,6 +189,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
public void execute(List<MedicalRecord> medicalRecordList){
|
|
public void execute(List<MedicalRecord> medicalRecordList){
|
|
List<MedicalRecord> addE = Lists.newLinkedList();
|
|
List<MedicalRecord> addE = Lists.newLinkedList();
|
|
List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
|
|
+ List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
|
|
List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
|
|
List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
|
|
if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
medicalRecordList.stream().forEach(s -> {
|
|
medicalRecordList.stream().forEach(s -> {
|
|
@@ -199,6 +204,40 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
qcAbnormal.setDescription(s.getRecTitle());
|
|
qcAbnormal.setDescription(s.getRecTitle());
|
|
qcAbnormal.setGmtCreate(new Date());
|
|
qcAbnormal.setGmtCreate(new Date());
|
|
qcAbnormalList.add(qcAbnormal);
|
|
qcAbnormalList.add(qcAbnormal);
|
|
|
|
+ }else if(modeId==Long.valueOf("1")){
|
|
|
|
+
|
|
|
|
+ BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
|
+ .eq("behospital_code", s.getBehospitalCode())
|
|
|
|
+ .eq("hospital_id", s.getHospitalId()));
|
|
|
|
+ if(behospitalInfo!=null){
|
|
|
|
+ //如果病人住院信息存在,更新对应的qc_type_id
|
|
|
|
+ Long qcTypeId=Long.valueOf("0");
|
|
|
|
+ QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
|
+ .eq("name",s.getRecTitle())
|
|
|
|
+ .eq("hospital_id", s.getHospitalId()));
|
|
|
|
+ if(qcType!=null){
|
|
|
|
+ behospitalInfo.setQcTypeId(qcType.getId());
|
|
|
|
+ }else{
|
|
|
|
+ //新增类型到qc_type表中
|
|
|
|
+ QcType qctype=new QcType();
|
|
|
|
+ qctype.setHospitalId(s.getHospitalId());
|
|
|
|
+ qctype.setName(s.getRecTitle());
|
|
|
|
+ qctype.setGmtCreate(new Date());
|
|
|
|
+
|
|
|
|
+ Long id=qcTypeFacade.saveT(qctype);
|
|
|
|
+ behospitalInfo.setQcTypeId(id);
|
|
|
|
+
|
|
|
|
+ //新增类型到监测表中
|
|
|
|
+ QcAbnormal qcAbnormal=new QcAbnormal();
|
|
|
|
+ qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
|
+ qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
|
+ qcAbnormal.setType(2);
|
|
|
|
+ qcAbnormal.setDescription(s.getRecTitle());
|
|
|
|
+ qcAbnormal.setGmtCreate(new Date());
|
|
|
|
+ qcAbnormalService.getBaseMapper().insert(qcAbnormal);
|
|
|
|
+ }
|
|
|
|
+ behospitalInfoList.add(behospitalInfo);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
s.setModeId(modeId);
|
|
s.setModeId(modeId);
|
|
//新增或修改
|
|
//新增或修改
|
|
@@ -224,6 +263,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
if(qcAbnormalList.size()>0){
|
|
if(qcAbnormalList.size()>0){
|
|
qcAbnormalService.saveBatch(qcAbnormalList);
|
|
qcAbnormalService.saveBatch(qcAbnormalList);
|
|
}
|
|
}
|
|
|
|
+ if(behospitalInfoList.size()>0){
|
|
|
|
+ behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|