|
@@ -123,34 +123,35 @@ public class AStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 把得到的list变成一个对象
|
|
|
+ *
|
|
|
* @param
|
|
|
*/
|
|
|
- public void getOneList(List<FJStrAdmissionNoteVo> strAdmissionNoteVos,String modeId) {
|
|
|
+ public void getOneList(List<FJStrAdmissionNoteVo> strAdmissionNoteVos, String modeId) {
|
|
|
try {
|
|
|
- Map<String,Object> map =new HashMap<>();
|
|
|
- Map<String,Object> wholeData =new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ Map<String, Object> wholeData = new HashMap<>();
|
|
|
String modelName = ModeIdEnum.getName(Integer.parseInt(modeId));
|
|
|
- Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
|
|
|
+ Map<String, String> tableKey = columnFacade.getColumn(CacheKeyEnum.getName(modelName));
|
|
|
//循环list根据咱字段的名称来跟得到的数据来做比较
|
|
|
- for (FJStrAdmissionNoteVo s: strAdmissionNoteVos) {
|
|
|
- if (s.getKeyEn()!=null) {
|
|
|
+ for (FJStrAdmissionNoteVo s : strAdmissionNoteVos) {
|
|
|
+ if (s.getKeyEn() != null) {
|
|
|
tableKey.forEach((k, v) -> {
|
|
|
if (s.getKeyEn().equals(v)) {
|
|
|
map.put(s.getKeyEn(), s.getDeValue());
|
|
|
wholeData.put(k, s.getDeValue());
|
|
|
}
|
|
|
});
|
|
|
- }else {
|
|
|
- wholeData.put(s.getKeyCN(),s.getDeValue());
|
|
|
+ } else {
|
|
|
+ wholeData.put(s.getKeyCN(), s.getDeValue());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- StrAdmissionNote strAdmissionNote =new StrAdmissionNote();
|
|
|
+ StrAdmissionNote strAdmissionNote = new StrAdmissionNote();
|
|
|
AStrAdmissionNoteVO aStrAdmissionNoteVO = (AStrAdmissionNoteVO) MapUtil.mapToObject(map, AStrAdmissionNoteVO.class);
|
|
|
- BeanUtils.copyProperties(aStrAdmissionNoteVO,strAdmissionNote);
|
|
|
+ BeanUtils.copyProperties(aStrAdmissionNoteVO, strAdmissionNote);
|
|
|
strAdmissionNote.setWholeData(JSON.toJSONString(wholeData));
|
|
|
|
|
|
- BeanUtils.copyProperties(strAdmissionNoteVos.get(0),strAdmissionNote);
|
|
|
+ BeanUtils.copyProperties(strAdmissionNoteVos.get(0), strAdmissionNote);
|
|
|
|
|
|
strAdmissionNote.setAuditDate(DateUtil.parseDateTime(aStrAdmissionNoteVO.getAuditDate()));//审核时间
|
|
|
strAdmissionNote.setRecDate(DateUtil.parseDateTime(aStrAdmissionNoteVO.getRecDate()));//记录时间
|
|
@@ -159,11 +160,10 @@ public class AStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
|
|
|
strAdmissionNote.setRecordDate(DateUtil.parseDateTime(aStrAdmissionNoteVO.getRecordDate()));//病历日期
|
|
|
|
|
|
|
|
|
- HisViewVo hisViewVo = new HisViewVo();
|
|
|
- BeanUtils.copyProperties(strAdmissionNoteVos.get(0),hisViewVo);
|
|
|
- aMedicalRecordContentFacade.executeByView(hisViewVo);
|
|
|
- aMedicalRecordFacade.executeByView(hisViewVo,modeId);
|
|
|
-
|
|
|
+ HisViewVo hisViewVo = new HisViewVo();
|
|
|
+ BeanUtils.copyProperties(strAdmissionNoteVos.get(0), hisViewVo);
|
|
|
+ aMedicalRecordContentFacade.executeByView(hisViewVo);
|
|
|
+ aMedicalRecordFacade.executeByView(hisViewVo, modeId);
|
|
|
|
|
|
|
|
|
this.dealData(strAdmissionNote);
|
|
@@ -217,30 +217,30 @@ public class AStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public RespDTO execDealData(List<StrAdmissionNoteVO> list){
|
|
|
- if(list!=null && list.size()>0){
|
|
|
+ public RespDTO execDealData(List<StrAdmissionNoteVO> list) {
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
//循环验证数据有效性
|
|
|
- for (StrAdmissionNoteVO strAdmissionNoteVO:list) {
|
|
|
- if("".equals(strAdmissionNoteVO.getRecId())) {
|
|
|
+ for (StrAdmissionNoteVO strAdmissionNoteVO : list) {
|
|
|
+ if ("".equals(strAdmissionNoteVO.getRecId())) {
|
|
|
return RespDTO.onError("请输入记录编号!");
|
|
|
- }else if(strAdmissionNoteVO.getHospitalId()==null){
|
|
|
+ } else if (strAdmissionNoteVO.getHospitalId() == null) {
|
|
|
return RespDTO.onError("请输入医院编码!");
|
|
|
- }else if("".equals(strAdmissionNoteVO.getBehospitalCode())){
|
|
|
+ } else if ("".equals(strAdmissionNoteVO.getBehospitalCode())) {
|
|
|
return RespDTO.onError("请输入病人住院编码!");
|
|
|
}
|
|
|
}
|
|
|
//初始、格式化数据
|
|
|
- List<StrAdmissionNote> strAdmissionNoteList=Lists.newArrayList();
|
|
|
- strAdmissionNoteList=BeanUtil.listCopyTo(list,StrAdmissionNote.class);
|
|
|
+ List<StrAdmissionNote> strAdmissionNoteList = Lists.newArrayList();
|
|
|
+ strAdmissionNoteList = BeanUtil.listCopyTo(list, StrAdmissionNote.class);
|
|
|
execute(strAdmissionNoteList);
|
|
|
|
|
|
return RespDTO.onSuc(strAdmissionNoteList);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return RespDTO.onError("未接收到数据!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void execute(List<StrAdmissionNote> list){
|
|
|
+ public void execute(List<StrAdmissionNote> list) {
|
|
|
try {
|
|
|
List<StrAdmissionNote> addE = Lists.newLinkedList();
|
|
|
List<StrAdmissionNote> updateE = Lists.newLinkedList();
|
|
@@ -249,7 +249,7 @@ public class AStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
|
|
|
StrAdmissionNote strAdmissionNote = this.getOne(new QueryWrapper<StrAdmissionNote>()
|
|
|
.eq("rec_id", s.getRecId())
|
|
|
.eq("hospital_id", s.getHospitalId())
|
|
|
- .eq("behospital_code",s.getBehospitalCode()), false);
|
|
|
+ .eq("behospital_code", s.getBehospitalCode()), false);
|
|
|
if (strAdmissionNote != null) {
|
|
|
s.setGmtModified(new Date());
|
|
|
updateE.add(s);
|
|
@@ -259,15 +259,15 @@ public class AStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- if(addE.size()>0){
|
|
|
+ if (addE.size() > 0) {
|
|
|
strAdmissionNoteService.saveBatch(addE);
|
|
|
}
|
|
|
- if(updateE.size()>0){
|
|
|
+ if (updateE.size() > 0) {
|
|
|
this.baseMapper.updateBatchByKey(updateE);
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- log.error(e.getMessage(),e);
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-入院记录","", JSON.toJSONString(list),"",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-入院记录", "", JSON.toJSONString(list), "", e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|