|
@@ -12,21 +12,27 @@ import com.diagbot.facade.BasHospitalInfoFacade;
|
|
|
import com.diagbot.facade.BehospitalInfoFacade;
|
|
|
import com.diagbot.facade.ModelHospitalFacade;
|
|
|
import com.diagbot.facade.QcTypeFacade;
|
|
|
+import com.diagbot.service.MedicalRecordService;
|
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.EncrypDES;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.ReadProperties;
|
|
|
import com.diagbot.util.TZDBConn;
|
|
|
import com.diagbot.vo.AnalyzeRunVO;
|
|
|
import com.diagbot.vo.MedrecVo;
|
|
|
import com.diagbot.vo.QueryVo;
|
|
|
import com.diagbot.vo.data.AColumnContentVO;
|
|
|
+import com.diagbot.vo.data.AMedicalRecordContentVO;
|
|
|
import com.diagbot.vo.data.AMedicalRecordVO;
|
|
|
import com.diagbot.vo.data.AMrContentVO;
|
|
|
+import com.diagbot.vo.data.HisDataDealVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Date;
|
|
@@ -66,6 +72,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
@Autowired
|
|
|
private BasHospitalInfoFacade basHospitalInfoFacade;
|
|
|
|
|
|
+ @Value("${encrypt.enable}")
|
|
|
+ Boolean encryptFlag;
|
|
|
+
|
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
|
|
|
|
/**
|
|
@@ -113,6 +122,46 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public boolean hisDataDeal(HisDataDealVO hisDataDealVO){
|
|
|
+ QueryWrapper<MedicalRecord> medicalRecordQe = new QueryWrapper<>();
|
|
|
+ medicalRecordQe.eq("hospital_id", hisDataDealVO.getHospitalId());
|
|
|
+ medicalRecordQe.eq("mode_id", hisDataDealVO.getModeId());
|
|
|
+ List<MedicalRecord> medicalRecordList = medicalRecordService.list(medicalRecordQe);
|
|
|
+ medicalRecordList.forEach(medicalRecord -> {
|
|
|
+ QueryWrapper<MedicalRecordContent> medicalRecordContentQe = new QueryWrapper<>();
|
|
|
+ medicalRecordContentQe.eq("hospital_id", hisDataDealVO.getHospitalId());
|
|
|
+ medicalRecordContentQe.eq("rec_id", medicalRecord.getRecId());
|
|
|
+ List<MedicalRecordContent> medicalRecordContentList = aMedicalRecordContentFacade.list(medicalRecordContentQe);
|
|
|
+
|
|
|
+ if (ListUtil.isEmpty(medicalRecordContentList)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (encryptFlag) {
|
|
|
+ try {
|
|
|
+ EncrypDES encrypDES = new EncrypDES();
|
|
|
+ for (MedicalRecordContent mrj : medicalRecordContentList) {
|
|
|
+ mrj.setXmlText(encrypDES.decryptor(mrj.getXmlText()));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<AMedicalRecordContentVO> contents = BeanUtil.listCopyTo(medicalRecordContentList, AMedicalRecordContentVO.class);
|
|
|
+ AMedicalRecordVO aMedicalRecordVO = new AMedicalRecordVO();
|
|
|
+ BeanUtil.copyProperties(medicalRecord, aMedicalRecordVO);
|
|
|
+ aMedicalRecordVO.setContents(contents);
|
|
|
+
|
|
|
+ List<AMedicalRecordVO> records = Lists.newArrayList();
|
|
|
+ records.add(aMedicalRecordVO);
|
|
|
+ AMrContentVO aMrContentVO = new AMrContentVO();
|
|
|
+ aMrContentVO.setRecords(records);
|
|
|
+ splicingParam(aMrContentVO);
|
|
|
+ });
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 入参结构拼接-仅支持接口对接的方式
|
|
|
* @param aMrContentVO
|