|
|
|
@ -107,54 +107,69 @@ public class MedicalRecallController {
|
|
|
|
|
if (!flag) {
|
|
|
|
|
return "请不要重复提交!";
|
|
|
|
|
}
|
|
|
|
|
String inpatientNo = emrFaultDetail.getContent();
|
|
|
|
|
if(StringUtils.isBlank(inpatientNo)){
|
|
|
|
|
return "0";
|
|
|
|
|
}
|
|
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
String handleName = user.getUserPosition();//姓名
|
|
|
|
|
String username = user.getUserName();//获取登录的用户名
|
|
|
|
|
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String nowTime = format1.format(new Date());
|
|
|
|
|
emrFaultDetail.setUpdater(username);
|
|
|
|
|
emrFaultDetail.setUpdateTime(nowTime);
|
|
|
|
|
if(emrFaultDetail.getRecallReason()==null ||emrFaultDetail.getRecallReason()==""){
|
|
|
|
|
//医院需要这份病案
|
|
|
|
|
emrFaultDetail.setRecallReason( new String(recallReason.getBytes("iso-8859-1"),"utf-8"));
|
|
|
|
|
}
|
|
|
|
|
Archive_Master archiveMaster=new Archive_Master();
|
|
|
|
|
archiveMaster.setId(emrFaultDetail.getArchiveDetailId());
|
|
|
|
|
archiveMaster.setCmtNurse(1);
|
|
|
|
|
archiveMaster.setCmtDoctor(1);
|
|
|
|
|
archiveMaster.setArchivestate("初审");
|
|
|
|
|
int bol=archiveMasterService.updateByClo(archiveMaster);
|
|
|
|
|
if (bol == 1) {
|
|
|
|
|
//删除该病案号和state不为空的记录
|
|
|
|
|
bol = emrFaultDetailService.delByArchiveId(emrFaultDetail);
|
|
|
|
|
//重新插入一条记录
|
|
|
|
|
//emrFaultDetail.setArchiveDetailId(null);+
|
|
|
|
|
if (bol == 1|| bol==0) {
|
|
|
|
|
emrFaultDetail.setCreater(username);
|
|
|
|
|
emrFaultDetail.setCreateTime(nowTime);
|
|
|
|
|
emrFaultDetail.setFirstTrial(null);
|
|
|
|
|
bol = emrFaultDetailService.insertSel(emrFaultDetail);
|
|
|
|
|
}
|
|
|
|
|
String lgFlag = inpatientNo.substring(0,2);
|
|
|
|
|
if(!"LG".equals(lgFlag)) {
|
|
|
|
|
//2021-01-30 初审成功日志
|
|
|
|
|
Archive_Master_Following archiveMasterFollowing = new Archive_Master_Following();
|
|
|
|
|
archiveMasterFollowing.setMasterId(emrFaultDetail.getArchiveDetailId());
|
|
|
|
|
//following表中添加病案室审核操作记录
|
|
|
|
|
archiveMasterFollowing.setFollowingType("10");
|
|
|
|
|
archiveMasterFollowing.setFollowingContent("病案召回");
|
|
|
|
|
archiveMasterFollowing.setHandleTime(nowTime);
|
|
|
|
|
archiveMasterFollowing.setHandleId(username);
|
|
|
|
|
archiveMasterFollowing.setHandleName(handleName);
|
|
|
|
|
archive_master_followingService.insertSelective(archiveMasterFollowing);
|
|
|
|
|
int bol=0;
|
|
|
|
|
//判断是否已经召回
|
|
|
|
|
if(StringUtils.isNotBlank(emrFaultDetail.getArchiveDetailId())){
|
|
|
|
|
//判断病案是否已经召回
|
|
|
|
|
Archive_Master_Following followingLastInfo=new Archive_Master_Following();
|
|
|
|
|
followingLastInfo.setFollowingType("10");
|
|
|
|
|
followingLastInfo.setMasterId(emrFaultDetail.getArchiveDetailId());
|
|
|
|
|
List<Archive_Master_Following> followingLastList=archive_master_followingService.selLastByType(followingLastInfo);
|
|
|
|
|
if(followingLastList==null || followingLastList.size()<=0){
|
|
|
|
|
//最后一次存在召回
|
|
|
|
|
String inpatientNo = emrFaultDetail.getContent();
|
|
|
|
|
if(StringUtils.isBlank(inpatientNo)){
|
|
|
|
|
return "0";
|
|
|
|
|
}
|
|
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
String handleName = user.getUserPosition();//姓名
|
|
|
|
|
String username = user.getUserName();//获取登录的用户名
|
|
|
|
|
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String nowTime = format1.format(new Date());
|
|
|
|
|
emrFaultDetail.setUpdater(username);
|
|
|
|
|
emrFaultDetail.setUpdateTime(nowTime);
|
|
|
|
|
if(emrFaultDetail.getRecallReason()==null ||emrFaultDetail.getRecallReason()==""){
|
|
|
|
|
//医院需要这份病案
|
|
|
|
|
emrFaultDetail.setRecallReason( new String(recallReason.getBytes("iso-8859-1"),"utf-8"));
|
|
|
|
|
}
|
|
|
|
|
Archive_Master archiveMaster=new Archive_Master();
|
|
|
|
|
archiveMaster.setId(emrFaultDetail.getArchiveDetailId());
|
|
|
|
|
archiveMaster.setCmtNurse(1);
|
|
|
|
|
archiveMaster.setCmtDoctor(1);
|
|
|
|
|
archiveMaster.setArchivestate("初审");
|
|
|
|
|
bol=archiveMasterService.updateByClo(archiveMaster);
|
|
|
|
|
if (bol == 1) {
|
|
|
|
|
//删除该病案号和state不为空的记录
|
|
|
|
|
bol = emrFaultDetailService.delByArchiveId(emrFaultDetail);
|
|
|
|
|
//重新插入一条记录
|
|
|
|
|
//emrFaultDetail.setArchiveDetailId(null);+
|
|
|
|
|
if (bol == 1|| bol==0) {
|
|
|
|
|
emrFaultDetail.setCreater(username);
|
|
|
|
|
emrFaultDetail.setCreateTime(nowTime);
|
|
|
|
|
emrFaultDetail.setFirstTrial(null);
|
|
|
|
|
bol = emrFaultDetailService.insertSel(emrFaultDetail);
|
|
|
|
|
}
|
|
|
|
|
String lgFlag = inpatientNo.substring(0,2);
|
|
|
|
|
if(!"LG".equals(lgFlag)) {
|
|
|
|
|
//2021-01-30 初审成功日志
|
|
|
|
|
Archive_Master_Following archiveMasterFollowing = new Archive_Master_Following();
|
|
|
|
|
archiveMasterFollowing.setMasterId(emrFaultDetail.getArchiveDetailId());
|
|
|
|
|
//following表中添加病案室审核操作记录
|
|
|
|
|
archiveMasterFollowing.setFollowingType("10");
|
|
|
|
|
archiveMasterFollowing.setFollowingContent("病案召回");
|
|
|
|
|
archiveMasterFollowing.setHandleTime(nowTime);
|
|
|
|
|
archiveMasterFollowing.setHandleId(username);
|
|
|
|
|
archiveMasterFollowing.setHandleName(handleName);
|
|
|
|
|
archive_master_followingService.insertSelective(archiveMasterFollowing);
|
|
|
|
|
}else{
|
|
|
|
|
//留观号召回推送第三方
|
|
|
|
|
archiveMasterService.requestObservationRecord(inpatientNo,"RETURNED",emrFaultDetail.getRecallReason());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
//留观号召回推送第三方
|
|
|
|
|
archiveMasterService.requestObservationRecord(inpatientNo,"RETURNED",emrFaultDetail.getRecallReason());
|
|
|
|
|
return "请不要重复召回!";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return bol + "";
|
|
|
|
|