|
|
|
@ -13,6 +13,7 @@ import com.emr.service.Emr_Fault_DetailService;
|
|
|
|
|
import com.emr.util.ExceptionPrintUtil;
|
|
|
|
|
import com.emr.util.Msg;
|
|
|
|
|
import com.emr.util.OracleConnect;
|
|
|
|
|
import com.emr.vo.CommomVo;
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -29,6 +30,8 @@ import org.springframework.web.context.request.RequestContextHolder;
|
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
@ -61,6 +64,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
|
|
|
|
|
private ArchiveForceSumbitInfoService archiveForceSumbitInfoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ArchiveOtherExtMapper archiveOtherExtMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private Archive_MasterMapper archive_masterMapper;
|
|
|
|
|
/**
|
|
|
|
|
* 在院列表
|
|
|
|
|
* */
|
|
|
|
@ -1185,17 +1190,58 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
|
|
|
|
|
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String ids = master.getId();
|
|
|
|
|
String[] idList = ids.split(",");
|
|
|
|
|
String patientId = master.getPatientId();
|
|
|
|
|
String[] patientIdList = patientId.split(",");
|
|
|
|
|
List<ArchiveFlowRole> archiveFlowRoles = flowRoleMapper.selectAll();
|
|
|
|
|
for(int i = 0;i < idList.length;i++) {
|
|
|
|
|
String id = idList[i];
|
|
|
|
|
List<Archive_Master> archive_masterVos = archive_masterMapper.selectCommonlyUsed(master);
|
|
|
|
|
if(CollectionUtils.isEmpty(archive_masterVos)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Archive_Master archive_master_vos = archive_masterVos.get(0);
|
|
|
|
|
CommomVo commomVo=new CommomVo();
|
|
|
|
|
commomVo.setPatientId(archive_master_vos.getId());
|
|
|
|
|
commomVo.setAdmissTimes(archive_master_vos.getVisitId());
|
|
|
|
|
commomVo.setAdmissId(archive_master_vos.getInpNo());
|
|
|
|
|
commomVo.setInpatientNo(archive_master_vos.getInpNo());
|
|
|
|
|
commomVo.setName(archive_master_vos.getName());
|
|
|
|
|
commomVo.setCheckedDatetime(format1.format(new Date()));
|
|
|
|
|
commomVo.setSex(archive_master_vos.getSex());
|
|
|
|
|
commomVo.setAdmissId(archive_master_vos.getId());
|
|
|
|
|
String subAssort = archive_master_vos.getSubAssort();
|
|
|
|
|
int index = subAssort.indexOf("岁");
|
|
|
|
|
String before = subAssort.substring(0,index);
|
|
|
|
|
commomVo.setAge(before);
|
|
|
|
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
Date date1=null;
|
|
|
|
|
Date date2=null;
|
|
|
|
|
String dischargeDateTime = archive_master_vos.getDischargeDateTime();
|
|
|
|
|
String admissionDateTime = archive_master_vos.getAdmissionDateTime();
|
|
|
|
|
try {
|
|
|
|
|
date1=format.parse(dischargeDateTime);
|
|
|
|
|
date2=format.parse(admissionDateTime);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
Calendar ca1 = Calendar.getInstance();
|
|
|
|
|
Calendar ca2 = Calendar.getInstance();
|
|
|
|
|
ca1.setTime(date1);
|
|
|
|
|
ca2.setTime(date2);
|
|
|
|
|
long distanceMin =( ca1.getTimeInMillis()- ca2.getTimeInMillis())/(1000*60*60*24);
|
|
|
|
|
int i2= (int)distanceMin;
|
|
|
|
|
commomVo.setAdmissDays(i2);
|
|
|
|
|
int i = Integer.parseInt(before);
|
|
|
|
|
int i1 = i * 12;
|
|
|
|
|
String s = String.valueOf(i1);
|
|
|
|
|
commomVo.setAgeMonth(s);
|
|
|
|
|
commomVo.setAdmissDate(archive_master_vos.getAdmissionDateTime());
|
|
|
|
|
commomVo.setDisDate(archive_master_vos.getDischargeDateTime());
|
|
|
|
|
commomVo.setDisDept(archive_master_vos.getDeptName1());
|
|
|
|
|
commomVo.setAttending(archive_master_vos.getDoctorInCharge());
|
|
|
|
|
archive_masterMapper.insertCommonlyUsed(commomVo);
|
|
|
|
|
for(String id : idList) {
|
|
|
|
|
if(StringUtils.isNotBlank(id)) {
|
|
|
|
|
//修改病案归档状态
|
|
|
|
|
Archive_Master archiveMaster = new Archive_Master();
|
|
|
|
|
master.setId(id);
|
|
|
|
|
//拷贝对象
|
|
|
|
|
master.setPatientId(patientIdList[i]);
|
|
|
|
|
BeanUtils.copyProperties(master, archiveMaster);
|
|
|
|
|
//定义提交时间
|
|
|
|
|
//设置审核时间
|
|
|
|
@ -1221,7 +1267,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
|
|
|
|
|
List<ArchiveFlowRole> currentRoleAndNextRole = flowInfoService.getCurrentRoleAndNextRole(currentStatus, EnumVerify.DocState.MedicalRoomCheck.getCode(),archiveFlowRoles);
|
|
|
|
|
//添加流转节点
|
|
|
|
|
ArchiveFlowInfo flowInfo = flowInfoService.insertFlowInfo(master.getId(), master.getRemark(), currentRoleAndNextRole.get(0), currentRoleAndNextRole.get(1), sumbitDate);
|
|
|
|
|
insertOracle(0,flowInfo);
|
|
|
|
|
//insertOracle(0,flowInfo);
|
|
|
|
|
//添加纸质位置
|
|
|
|
|
paperPostionService.savePaperPostion(master);
|
|
|
|
|
}
|
|
|
|
|