增加按需采集功能

master
zengwh 5 years ago
parent 0e55e78218
commit a4dda9413d

@ -3,14 +3,18 @@ package com.emr.controller;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.ipml.ArchiveOtherExtService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.Msg;
import com.emr.vo.ArchiveFlowInfoVo;
import com.emr.vo.ArchiveOtherExtVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Controller
@ -18,13 +22,21 @@ import java.util.List;
public class ArchiveOtherExtController {
@Autowired
private ArchiveOtherExtService archiveOtherExtService;
/**
*
* @param offset
* @param limit
* @param archiveOtherExtVo
* @param request
* @return
*/
@RequestMapping("getArchiveExtInfo")
@ResponseBody
public OffsetLimitPage getArchiveExtInfo(Integer offset, Integer limit){
public OffsetLimitPage getArchiveExtInfo(Integer offset, Integer limit, ArchiveOtherExtVo archiveOtherExtVo, HttpServletRequest request){
PageHelper.offsetPage(offset,limit);
try {
List<ArchiveFlowInfoVo> list = null;
//List<ArchiveFlowInfoVo> list = archiveOtherExtService.getArchiveExtInfo(archiveOtherExtVo);
List<ArchiveOtherExtVo> list = archiveOtherExtService.getArchiveExtInfo(request,archiveOtherExtVo);
return new OffsetLimitPage((Page) list);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
@ -32,4 +44,28 @@ public class ArchiveOtherExtController {
return null;
}
}
/**
*
* @param ids
* @return
* @throws Exception
*/
@RequestMapping("submitUpdate")
@ResponseBody
public Msg submitUpdate(String ids,String notNursingIds,String jzh,String masterId,Integer sysFlag) throws Exception{
if(StringUtils.isBlank(ids)){
return Msg.fail("至少选中一个!");
}
if(null != sysFlag && sysFlag == 1){
if(StringUtils.isBlank(jzh)){
return Msg.fail("记账号不能为空!");
}
if(StringUtils.isBlank(masterId)){
return Msg.fail("masterId不能为空!");
}
}
archiveOtherExtService.updateSubmit(ids,notNursingIds,jzh,masterId,sysFlag);
return Msg.success();
}
}

@ -0,0 +1,25 @@
package com.emr.dao;
import com.emr.entity.ArchiveOtherExt;
import com.emr.vo.ArchiveOtherExtVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ArchiveOtherExtMapper {
int deleteByPrimaryKey(Long id);
int insert(ArchiveOtherExt record);
int insertSelective(ArchiveOtherExt record);
ArchiveOtherExt selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(ArchiveOtherExt record);
int updateByPrimaryKey(ArchiveOtherExt record);
List<ArchiveOtherExtVo> getArchiveExtInfo(ArchiveOtherExtVo record);
int updateSubmit(@Param("ids")String ids);
}

@ -0,0 +1,26 @@
package com.emr.dao;
import com.emr.entity.ArchiveOtherExtSubmittime;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ArchiveOtherExtSubmittimeMapper {
int deleteByPrimaryKey(Integer id);
int insert(ArchiveOtherExtSubmittime record);
int insertSelective(ArchiveOtherExtSubmittime record);
ArchiveOtherExtSubmittime selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ArchiveOtherExtSubmittime record);
int updateByPrimaryKey(ArchiveOtherExtSubmittime record);
List<ArchiveOtherExtSubmittime> selectAllByExtId(@Param("ids")String ids);
int createInfo(@Param("ids") String ids);
int updateInfo(@Param("ids") String ids);
}

@ -0,0 +1,116 @@
package com.emr.entity;
import java.io.Serializable;
public class ArchiveOtherExtSubmittime implements Serializable {
private Integer id;
private String otherExtId;
private String createTime;
private Integer int1;
private Integer int2;
private Integer int3;
private String str1;
private String str2;
private String str3;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOtherExtId() {
return otherExtId;
}
public void setOtherExtId(String otherExtId) {
this.otherExtId = otherExtId == null ? null : otherExtId.trim();
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime == null ? null : createTime.trim();
}
public Integer getInt1() {
return int1;
}
public void setInt1(Integer int1) {
this.int1 = int1;
}
public Integer getInt2() {
return int2;
}
public void setInt2(Integer int2) {
this.int2 = int2;
}
public Integer getInt3() {
return int3;
}
public void setInt3(Integer int3) {
this.int3 = int3;
}
public String getStr1() {
return str1;
}
public void setStr1(String str1) {
this.str1 = str1 == null ? null : str1.trim();
}
public String getStr2() {
return str2;
}
public void setStr2(String str2) {
this.str2 = str2 == null ? null : str2.trim();
}
public String getStr3() {
return str3;
}
public void setStr3(String str3) {
this.str3 = str3 == null ? null : str3.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", otherExtId=").append(otherExtId);
sb.append(", createTime=").append(createTime);
sb.append(", int1=").append(int1);
sb.append(", int2=").append(int2);
sb.append(", int3=").append(int3);
sb.append(", str1=").append(str1);
sb.append(", str2=").append(str2);
sb.append(", str3=").append(str3);
sb.append("]");
return sb.toString();
}
}

@ -1,16 +1,197 @@
package com.emr.service.ipml;
import com.emr.vo.ArchiveFlowInfoVo;
import com.emr.dao.ArchiveOtherExtMapper;
import com.emr.dao.ArchiveOtherExtSubmittimeMapper;
import com.emr.entity.ArchiveOtherExtSubmittime;
import com.emr.vo.ArchiveOtherExtVo;
import com.emr.vo.KeyValue;
import net.sf.json.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.List;
@Service
@Transactional
public class ArchiveOtherExtService {
public List<ArchiveFlowInfoVo> getArchiveExtInfo() {
//return archiveOtherExtMapper.getArchiveExtInfo(archiveOtherExtVo);
return null;
@Autowired
private ArchiveOtherExtMapper archiveOtherExtMapper;
@Autowired
private ArchiveOtherExtSubmittimeMapper archiveOtherExtSubmittimeMapper;
@Autowired
private ArchiveOtherService archiveOtherService;
/**
* @param request
* @param archiveOtherExtVo
* @return
* @throws Exception
*/
public List<ArchiveOtherExtVo> getArchiveExtInfo(HttpServletRequest request,ArchiveOtherExtVo archiveOtherExtVo) throws Exception{
List<ArchiveOtherExtVo> list = archiveOtherExtMapper.getArchiveExtInfo(archiveOtherExtVo);
if(!CollectionUtils.isEmpty(list)){
//读取系统标识json文件
String fileNamePath = "static/json/dictionary.json";
List<KeyValue> statusAndSysFlagValues = readJsonData(request, fileNamePath);
for(ArchiveOtherExtVo vo : list){
//presulit为Done转换为完成
String presult = vo.getPresult();
if(StringUtils.isNoneBlank(presult) && "done".equalsIgnoreCase(presult)){
vo.setPresult("完成");
}
//转换采集状态
if(!CollectionUtils.isEmpty(statusAndSysFlagValues)){
Integer statusflag = vo.getStatusflag();
if(null != statusflag){
for(KeyValue keyValue : statusAndSysFlagValues){
if("otherExtStatusFlag".equals(keyValue.getType())){
if(keyValue.getCode().equals(statusflag.toString())) {
vo.setStatusFlagStr(keyValue.getName());
break;
}
}
}
}
}
//转换系统标识
if(!CollectionUtils.isEmpty(statusAndSysFlagValues)){
Integer sysflag = vo.getSysflag();
if(null != sysflag){
for(KeyValue keyValue : statusAndSysFlagValues){
if("otherExtSysFlag".equals(keyValue.getType())) {
if (keyValue.getCode().equals(sysflag.toString())) {
vo.setSysFlagStr(keyValue.getName());
break;
}
}
}
}
}
}
}
return list;
}
/**
* json
* @param request
* @param fileNamePath
* @return
* @throws IOException
*/
private List<KeyValue> readJsonData(HttpServletRequest request, String fileNamePath) throws IOException {
String contextPath=request.getSession().getServletContext().getRealPath("/");
String fileName = contextPath + fileNamePath;
File jsonFile = new File(fileName);
FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8");
int ch = 0;
StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
String jsonStr = sb.toString();
List<KeyValue> list = (List<KeyValue>) net.sf.json.JSONArray.toList(JSONArray.fromObject(jsonStr), KeyValue.class);
return list;
}
/**
*
* @param ids
* @param notNursingIds
* @param jzh
* @param masterId
* @param sysFlag
*/
public void updateSubmit(String ids,String notNursingIds, String jzh, String masterId, Integer sysFlag) throws Exception{
String idsStr = SplitString2String(ids);
//存在护理记录则调用护理按需采集功能
if(null != sysFlag && sysFlag == 1) {
//调用护理按需采集功能
archiveOtherService.updateArchiveOther(jzh, masterId);
//ext表更新非护理记录
if(StringUtils.isNotBlank(notNursingIds)){
String tempIds = SplitString2String(notNursingIds);
archiveOtherExtMapper.updateSubmit(tempIds);
}
}else{
//全部更新ext表
archiveOtherExtMapper.updateSubmit(idsStr);
}
//操作提交信息表
OperOtherExtSubmitInfo(ids, idsStr);
}
//带逗号的字符串加单引号
private String SplitString2String(String notNursingIds) {
String[] notNursingIdsArr = notNursingIds.split(",");
//批量更新ext表的statusFlag字段值为0
StringBuilder notNursingIdsBuilder = new StringBuilder();
for(String id : notNursingIdsArr){
if(StringUtils.isNotBlank(id)) {
if (StringUtils.isNotBlank(notNursingIdsBuilder)) {
notNursingIdsBuilder.append(",");
}
notNursingIdsBuilder.append("'").append(id).append("'");
}
}
return notNursingIdsBuilder.toString();
}
/**
*
* @param ids
* @param idsStr
*/
private void OperOtherExtSubmitInfo(String ids, String idsStr) {
//查询ext_id在ext_info表中是否存在
List<ArchiveOtherExtSubmittime> infoList = archiveOtherExtSubmittimeMapper.selectAllByExtId(idsStr);
//定义需要新增的id集合
StringBuilder createStr = new StringBuilder();
//定义需要更新的id集合
StringBuilder updateStr = new StringBuilder();
String[] idArr = ids.split(",");
for(String id : idArr){
if(StringUtils.isNotBlank(id)) {
//定义是否存在
boolean flag = false;
//判断存在
if(!CollectionUtils.isEmpty(infoList)){
for(ArchiveOtherExtSubmittime obj : infoList){
String otherExtId = obj.getOtherExtId();
if(id.equals(otherExtId)){
flag = true;
break;
}
}
}
//存在添加进updateStr,不存在添加进createStr
if(flag){
if (StringUtils.isNotBlank(updateStr)) {
updateStr.append(",");
}
updateStr.append("'").append(id).append("'");
}else{
if (StringUtils.isNotBlank(createStr)) {
createStr.append(",");
}
createStr.append(id);
}
}
}
//存在则批量更新
if(StringUtils.isNotBlank(updateStr)){
archiveOtherExtSubmittimeMapper.updateInfo(updateStr.toString());
}
//不存在则批量新增
if(StringUtils.isNotBlank(createStr)){
archiveOtherExtSubmittimeMapper.createInfo(createStr.toString());
}
}
}

@ -0,0 +1,33 @@
package com.emr.vo;
import com.emr.entity.ArchiveOtherExt;
import lombok.Data;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2020/10/9 10:25
* @UpdateUser:
* @UpdateDate: 2020/10/9 10:25
* @UpdateRemark:
* @Version: 1.0
*/
@Data
public class ArchiveOtherExtVo extends ArchiveOtherExt {
private String idTemp;
private String sysupdatetimeStr;
private String stimeStr;
private String etimeStr;
private String sysFlagStr;
private String statusFlagStr;
private String createTime;
}

@ -0,0 +1,24 @@
package com.emr.vo;
import lombok.Data;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2020/10/9 11:09
* @UpdateUser:
* @UpdateDate: 2020/10/9 11:09
* @UpdateRemark:
* @Version: 1.0
*/
@Data
public class KeyValue {
private String code;
private String name;
private String type;
}

@ -0,0 +1,510 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.emr.dao.ArchiveOtherExtMapper" >
<resultMap id="BaseResultMap" type="com.emr.vo.ArchiveOtherExtVo" >
<id column="ID" property="id" jdbcType="BIGINT" />
<result column="SycTime" property="syctime" jdbcType="TIMESTAMP" />
<result column="SycObj" property="sycobj" jdbcType="NVARCHAR" />
<result column="otherID" property="otherid" jdbcType="BIGINT" />
<result column="sysFlag" property="sysflag" jdbcType="INTEGER" />
<result column="sysUpdateTime" property="sysupdatetime" jdbcType="TIMESTAMP" />
<result column="jzh" property="jzh" jdbcType="NVARCHAR" />
<result column="zyh" property="zyh" jdbcType="NVARCHAR" />
<result column="stime" property="stime" jdbcType="TIMESTAMP" />
<result column="eTime" property="etime" jdbcType="TIMESTAMP" />
<result column="statusFlag" property="statusflag" jdbcType="INTEGER" />
<result column="pResult" property="presult" jdbcType="NVARCHAR" />
<result column="MID" property="mid" jdbcType="NVARCHAR" />
<result column="DID" property="did" jdbcType="NVARCHAR" />
<result column="C1" property="c1" jdbcType="NVARCHAR" />
<result column="C2" property="c2" jdbcType="NVARCHAR" />
<result column="C3" property="c3" jdbcType="NVARCHAR" />
<result column="C4" property="c4" jdbcType="NVARCHAR" />
<result column="C5" property="c5" jdbcType="NVARCHAR" />
<result column="C6" property="c6" jdbcType="NVARCHAR" />
<result column="C7" property="c7" jdbcType="NVARCHAR" />
<result column="C8" property="c8" jdbcType="NVARCHAR" />
<result column="C9" property="c9" jdbcType="NVARCHAR" />
<result column="C10" property="c10" jdbcType="NVARCHAR" />
<result column="N1" property="n1" jdbcType="DECIMAL" />
<result column="N2" property="n2" jdbcType="DECIMAL" />
<result column="N3" property="n3" jdbcType="DECIMAL" />
<result column="T1" property="t1" jdbcType="TIMESTAMP" />
<result column="T2" property="t2" jdbcType="TIMESTAMP" />
<result column="T3" property="t3" jdbcType="TIMESTAMP" />
<result column="T4" property="t4" jdbcType="TIMESTAMP" />
<result column="T5" property="t5" jdbcType="TIMESTAMP" />
<result column="T6" property="t6" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
ID, SycTime, SycObj, otherID, sysFlag, sysUpdateTime, jzh, zyh, stime, eTime, statusFlag,
pResult, MID, DID, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, N1, N2, N3, T1, T2, T3,
T4, T5, T6
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from archive_other_ext
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from archive_other_ext
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.emr.entity.ArchiveOtherExt" >
insert into archive_other_ext (ID, SycTime, SycObj,
otherID, sysFlag, sysUpdateTime,
jzh, zyh, stime,
eTime, statusFlag, pResult,
MID, DID, C1, C2,
C3, C4, C5, C6,
C7, C8, C9, C10,
N1, N2, N3, T1,
T2, T3, T4, T5,
T6)
values (#{id,jdbcType=BIGINT}, #{syctime,jdbcType=TIMESTAMP}, #{sycobj,jdbcType=NVARCHAR},
#{otherid,jdbcType=BIGINT}, #{sysflag,jdbcType=INTEGER}, #{sysupdatetime,jdbcType=TIMESTAMP},
#{jzh,jdbcType=NVARCHAR}, #{zyh,jdbcType=NVARCHAR}, #{stime,jdbcType=TIMESTAMP},
#{etime,jdbcType=TIMESTAMP}, #{statusflag,jdbcType=INTEGER}, #{presult,jdbcType=NVARCHAR},
#{mid,jdbcType=NVARCHAR}, #{did,jdbcType=NVARCHAR}, #{c1,jdbcType=NVARCHAR}, #{c2,jdbcType=NVARCHAR},
#{c3,jdbcType=NVARCHAR}, #{c4,jdbcType=NVARCHAR}, #{c5,jdbcType=NVARCHAR}, #{c6,jdbcType=NVARCHAR},
#{c7,jdbcType=NVARCHAR}, #{c8,jdbcType=NVARCHAR}, #{c9,jdbcType=NVARCHAR}, #{c10,jdbcType=NVARCHAR},
#{n1,jdbcType=DECIMAL}, #{n2,jdbcType=DECIMAL}, #{n3,jdbcType=DECIMAL}, #{t1,jdbcType=TIMESTAMP},
#{t2,jdbcType=TIMESTAMP}, #{t3,jdbcType=TIMESTAMP}, #{t4,jdbcType=TIMESTAMP}, #{t5,jdbcType=TIMESTAMP},
#{t6,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.emr.entity.ArchiveOtherExt" >
insert into archive_other_ext
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="syctime != null" >
SycTime,
</if>
<if test="sycobj != null" >
SycObj,
</if>
<if test="otherid != null" >
otherID,
</if>
<if test="sysflag != null" >
sysFlag,
</if>
<if test="sysupdatetime != null" >
sysUpdateTime,
</if>
<if test="jzh != null" >
jzh,
</if>
<if test="zyh != null" >
zyh,
</if>
<if test="stime != null" >
stime,
</if>
<if test="etime != null" >
eTime,
</if>
<if test="statusflag != null" >
statusFlag,
</if>
<if test="presult != null" >
pResult,
</if>
<if test="mid != null" >
MID,
</if>
<if test="did != null" >
DID,
</if>
<if test="c1 != null" >
C1,
</if>
<if test="c2 != null" >
C2,
</if>
<if test="c3 != null" >
C3,
</if>
<if test="c4 != null" >
C4,
</if>
<if test="c5 != null" >
C5,
</if>
<if test="c6 != null" >
C6,
</if>
<if test="c7 != null" >
C7,
</if>
<if test="c8 != null" >
C8,
</if>
<if test="c9 != null" >
C9,
</if>
<if test="c10 != null" >
C10,
</if>
<if test="n1 != null" >
N1,
</if>
<if test="n2 != null" >
N2,
</if>
<if test="n3 != null" >
N3,
</if>
<if test="t1 != null" >
T1,
</if>
<if test="t2 != null" >
T2,
</if>
<if test="t3 != null" >
T3,
</if>
<if test="t4 != null" >
T4,
</if>
<if test="t5 != null" >
T5,
</if>
<if test="t6 != null" >
T6,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="syctime != null" >
#{syctime,jdbcType=TIMESTAMP},
</if>
<if test="sycobj != null" >
#{sycobj,jdbcType=NVARCHAR},
</if>
<if test="otherid != null" >
#{otherid,jdbcType=BIGINT},
</if>
<if test="sysflag != null" >
#{sysflag,jdbcType=INTEGER},
</if>
<if test="sysupdatetime != null" >
#{sysupdatetime,jdbcType=TIMESTAMP},
</if>
<if test="jzh != null" >
#{jzh,jdbcType=NVARCHAR},
</if>
<if test="zyh != null" >
#{zyh,jdbcType=NVARCHAR},
</if>
<if test="stime != null" >
#{stime,jdbcType=TIMESTAMP},
</if>
<if test="etime != null" >
#{etime,jdbcType=TIMESTAMP},
</if>
<if test="statusflag != null" >
#{statusflag,jdbcType=INTEGER},
</if>
<if test="presult != null" >
#{presult,jdbcType=NVARCHAR},
</if>
<if test="mid != null" >
#{mid,jdbcType=NVARCHAR},
</if>
<if test="did != null" >
#{did,jdbcType=NVARCHAR},
</if>
<if test="c1 != null" >
#{c1,jdbcType=NVARCHAR},
</if>
<if test="c2 != null" >
#{c2,jdbcType=NVARCHAR},
</if>
<if test="c3 != null" >
#{c3,jdbcType=NVARCHAR},
</if>
<if test="c4 != null" >
#{c4,jdbcType=NVARCHAR},
</if>
<if test="c5 != null" >
#{c5,jdbcType=NVARCHAR},
</if>
<if test="c6 != null" >
#{c6,jdbcType=NVARCHAR},
</if>
<if test="c7 != null" >
#{c7,jdbcType=NVARCHAR},
</if>
<if test="c8 != null" >
#{c8,jdbcType=NVARCHAR},
</if>
<if test="c9 != null" >
#{c9,jdbcType=NVARCHAR},
</if>
<if test="c10 != null" >
#{c10,jdbcType=NVARCHAR},
</if>
<if test="n1 != null" >
#{n1,jdbcType=DECIMAL},
</if>
<if test="n2 != null" >
#{n2,jdbcType=DECIMAL},
</if>
<if test="n3 != null" >
#{n3,jdbcType=DECIMAL},
</if>
<if test="t1 != null" >
#{t1,jdbcType=TIMESTAMP},
</if>
<if test="t2 != null" >
#{t2,jdbcType=TIMESTAMP},
</if>
<if test="t3 != null" >
#{t3,jdbcType=TIMESTAMP},
</if>
<if test="t4 != null" >
#{t4,jdbcType=TIMESTAMP},
</if>
<if test="t5 != null" >
#{t5,jdbcType=TIMESTAMP},
</if>
<if test="t6 != null" >
#{t6,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.ArchiveOtherExt" >
update archive_other_ext
<set >
<if test="syctime != null" >
SycTime = #{syctime,jdbcType=TIMESTAMP},
</if>
<if test="sycobj != null" >
SycObj = #{sycobj,jdbcType=NVARCHAR},
</if>
<if test="otherid != null" >
otherID = #{otherid,jdbcType=BIGINT},
</if>
<if test="sysflag != null" >
sysFlag = #{sysflag,jdbcType=INTEGER},
</if>
<if test="sysupdatetime != null" >
sysUpdateTime = #{sysupdatetime,jdbcType=TIMESTAMP},
</if>
<if test="jzh != null" >
jzh = #{jzh,jdbcType=NVARCHAR},
</if>
<if test="zyh != null" >
zyh = #{zyh,jdbcType=NVARCHAR},
</if>
<if test="stime != null" >
stime = #{stime,jdbcType=TIMESTAMP},
</if>
<if test="etime != null" >
eTime = #{etime,jdbcType=TIMESTAMP},
</if>
<if test="statusflag != null" >
statusFlag = #{statusflag,jdbcType=INTEGER},
</if>
<if test="presult != null" >
pResult = #{presult,jdbcType=NVARCHAR},
</if>
<if test="mid != null" >
MID = #{mid,jdbcType=NVARCHAR},
</if>
<if test="did != null" >
DID = #{did,jdbcType=NVARCHAR},
</if>
<if test="c1 != null" >
C1 = #{c1,jdbcType=NVARCHAR},
</if>
<if test="c2 != null" >
C2 = #{c2,jdbcType=NVARCHAR},
</if>
<if test="c3 != null" >
C3 = #{c3,jdbcType=NVARCHAR},
</if>
<if test="c4 != null" >
C4 = #{c4,jdbcType=NVARCHAR},
</if>
<if test="c5 != null" >
C5 = #{c5,jdbcType=NVARCHAR},
</if>
<if test="c6 != null" >
C6 = #{c6,jdbcType=NVARCHAR},
</if>
<if test="c7 != null" >
C7 = #{c7,jdbcType=NVARCHAR},
</if>
<if test="c8 != null" >
C8 = #{c8,jdbcType=NVARCHAR},
</if>
<if test="c9 != null" >
C9 = #{c9,jdbcType=NVARCHAR},
</if>
<if test="c10 != null" >
C10 = #{c10,jdbcType=NVARCHAR},
</if>
<if test="n1 != null" >
N1 = #{n1,jdbcType=DECIMAL},
</if>
<if test="n2 != null" >
N2 = #{n2,jdbcType=DECIMAL},
</if>
<if test="n3 != null" >
N3 = #{n3,jdbcType=DECIMAL},
</if>
<if test="t1 != null" >
T1 = #{t1,jdbcType=TIMESTAMP},
</if>
<if test="t2 != null" >
T2 = #{t2,jdbcType=TIMESTAMP},
</if>
<if test="t3 != null" >
T3 = #{t3,jdbcType=TIMESTAMP},
</if>
<if test="t4 != null" >
T4 = #{t4,jdbcType=TIMESTAMP},
</if>
<if test="t5 != null" >
T5 = #{t5,jdbcType=TIMESTAMP},
</if>
<if test="t6 != null" >
T6 = #{t6,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.emr.entity.ArchiveOtherExt" >
update archive_other_ext
set SycTime = #{syctime,jdbcType=TIMESTAMP},
SycObj = #{sycobj,jdbcType=NVARCHAR},
otherID = #{otherid,jdbcType=BIGINT},
sysFlag = #{sysflag,jdbcType=INTEGER},
sysUpdateTime = #{sysupdatetime,jdbcType=TIMESTAMP},
jzh = #{jzh,jdbcType=NVARCHAR},
zyh = #{zyh,jdbcType=NVARCHAR},
stime = #{stime,jdbcType=TIMESTAMP},
eTime = #{etime,jdbcType=TIMESTAMP},
statusFlag = #{statusflag,jdbcType=INTEGER},
pResult = #{presult,jdbcType=NVARCHAR},
MID = #{mid,jdbcType=NVARCHAR},
DID = #{did,jdbcType=NVARCHAR},
C1 = #{c1,jdbcType=NVARCHAR},
C2 = #{c2,jdbcType=NVARCHAR},
C3 = #{c3,jdbcType=NVARCHAR},
C4 = #{c4,jdbcType=NVARCHAR},
C5 = #{c5,jdbcType=NVARCHAR},
C6 = #{c6,jdbcType=NVARCHAR},
C7 = #{c7,jdbcType=NVARCHAR},
C8 = #{c8,jdbcType=NVARCHAR},
C9 = #{c9,jdbcType=NVARCHAR},
C10 = #{c10,jdbcType=NVARCHAR},
N1 = #{n1,jdbcType=DECIMAL},
N2 = #{n2,jdbcType=DECIMAL},
N3 = #{n3,jdbcType=DECIMAL},
T1 = #{t1,jdbcType=TIMESTAMP},
T2 = #{t2,jdbcType=TIMESTAMP},
T3 = #{t3,jdbcType=TIMESTAMP},
T4 = #{t4,jdbcType=TIMESTAMP},
T5 = #{t5,jdbcType=TIMESTAMP},
T6 = #{t6,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=BIGINT}
</update>
<!--统一查询语句-->
<sql id="selectWhereSql">
<if test="jzh != null and jzh != ''">
and jzh = #{jzh,jdbcType=NVARCHAR}
</if>
<if test="c1 != null and c1 != ''">
and C1 like '%${c1}%'
</if>
<if test="sysflag != null">
and sysFlag = #{sysflag,jdbcType=INTEGER}
</if>
<if test="statusflag != null">
and statusFlag = #{statusflag,jdbcType=INTEGER}
</if>
</sql>
<select id="getArchiveExtInfo" resultMap="BaseResultMap">
select * from (
select
archive_other_ext.ID idTemp,
SycTime,
sysFlag,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
C1,
archive_other_ext_submitTime.create_time
from archive_other_ext
left join
archive_other_ext_submitTime
on archive_other_ext_submitTime.other_ext_id = archive_other_ext.ID
<where>
C1 != '一般病程记录' and sysFlag != 5
<include refid="selectWhereSql"></include>
</where>
union all
select
archive_other_ext.ID idTemp,
SycTime,
sysFlag,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
C1,
archive_other_ext_submitTime.create_time
from archive_other_ext
left join
archive_other_ext_submitTime
on archive_other_ext_submitTime.other_ext_id = archive_other_ext.ID
<where>
and sysFlag = 5 and (C1 = '术前访视' or C1 = '术后访视' or C1 = '麻醉记录' or C1 = '麻醉小结')
<include refid="selectWhereSql"></include>
</where>
union all
select
top 1
archive_other_ext.ID idTemp,
SycTime,
sysFlag,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
C1,
archive_other_ext_submitTime.create_time
from archive_other_ext
left join
archive_other_ext_submitTime
on archive_other_ext_submitTime.other_ext_id = archive_other_ext.ID
<where>
C1 = '一般病程记录'
<include refid="selectWhereSql"></include>
</where>
order by sysUpdateTime desc
) temp
order by sysupdatetimeStr
</select>
<!--批量更新statusFlag = 0-->
<update id="updateSubmit">
update archive_other_ext
set statusFlag = 0
<where>
<if test="ids != null and ids != ''">
ID in (${ids})
</if>
</where>
</update>
</mapper>

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.emr.dao.ArchiveOtherExtSubmittimeMapper" >
<resultMap id="BaseResultMap" type="com.emr.entity.ArchiveOtherExtSubmittime" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="other_ext_id" property="otherExtId" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="VARCHAR" />
<result column="int1" property="int1" jdbcType="INTEGER" />
<result column="int2" property="int2" jdbcType="INTEGER" />
<result column="int3" property="int3" jdbcType="INTEGER" />
<result column="str1" property="str1" jdbcType="NVARCHAR" />
<result column="str2" property="str2" jdbcType="NVARCHAR" />
<result column="str3" property="str3" jdbcType="NVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, other_ext_id, create_time, int1, int2, int3, str1, str2, str3
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from archive_other_ext_submitTime
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from archive_other_ext_submitTime
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.emr.entity.ArchiveOtherExtSubmittime" >
insert into archive_other_ext_submitTime (id, other_ext_id, create_time,
int1, int2, int3, str1,
str2, str3)
values (#{id,jdbcType=INTEGER}, #{otherExtId,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR},
#{int1,jdbcType=INTEGER}, #{int2,jdbcType=INTEGER}, #{int3,jdbcType=INTEGER}, #{str1,jdbcType=NVARCHAR},
#{str2,jdbcType=NVARCHAR}, #{str3,jdbcType=NVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.emr.entity.ArchiveOtherExtSubmittime" >
insert into archive_other_ext_submitTime
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="otherExtId != null" >
other_ext_id,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="int1 != null" >
int1,
</if>
<if test="int2 != null" >
int2,
</if>
<if test="int3 != null" >
int3,
</if>
<if test="str1 != null" >
str1,
</if>
<if test="str2 != null" >
str2,
</if>
<if test="str3 != null" >
str3,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="otherExtId != null" >
#{otherExtId,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=VARCHAR},
</if>
<if test="int1 != null" >
#{int1,jdbcType=INTEGER},
</if>
<if test="int2 != null" >
#{int2,jdbcType=INTEGER},
</if>
<if test="int3 != null" >
#{int3,jdbcType=INTEGER},
</if>
<if test="str1 != null" >
#{str1,jdbcType=NVARCHAR},
</if>
<if test="str2 != null" >
#{str2,jdbcType=NVARCHAR},
</if>
<if test="str3 != null" >
#{str3,jdbcType=NVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.ArchiveOtherExtSubmittime" >
update archive_other_ext_submitTime
<set >
<if test="otherExtId != null" >
other_ext_id = #{otherExtId,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="int1 != null" >
int1 = #{int1,jdbcType=INTEGER},
</if>
<if test="int2 != null" >
int2 = #{int2,jdbcType=INTEGER},
</if>
<if test="int3 != null" >
int3 = #{int3,jdbcType=INTEGER},
</if>
<if test="str1 != null" >
str1 = #{str1,jdbcType=NVARCHAR},
</if>
<if test="str2 != null" >
str2 = #{str2,jdbcType=NVARCHAR},
</if>
<if test="str3 != null" >
str3 = #{str3,jdbcType=NVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.emr.entity.ArchiveOtherExtSubmittime" >
update archive_other_ext_submitTime
set other_ext_id = #{otherExtId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=VARCHAR},
int1 = #{int1,jdbcType=INTEGER},
int2 = #{int2,jdbcType=INTEGER},
int3 = #{int3,jdbcType=INTEGER},
str1 = #{str1,jdbcType=NVARCHAR},
str2 = #{str2,jdbcType=NVARCHAR},
str3 = #{str3,jdbcType=NVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<!--批量查询-->
<select id="selectAllByExtId" resultMap="BaseResultMap">
select other_ext_id from archive_other_ext_submitTime
<where>
<if test="ids != null and ids != ''">
and other_ext_id in (${ids})
</if>
</where>
</select>
<!--批量添加-->
<insert id="createInfo">
insert into
archive_other_ext_submitTime(other_ext_id,create_time)
values
<foreach collection="ids.split(',')" item="id" separator=",">
(
${id}, CONVERT(varchar(19),GETDATE(),120)
)
</foreach>
</insert>
<!--批量更新-->
<update id="updateInfo">
update archive_other_ext_submitTime set create_time = CONVERT(varchar(19),GETDATE(),120)
where other_ext_id in (${ids})
</update>
</mapper>

@ -703,22 +703,19 @@
<input type="text" class="input-sm form-control" id="c1" maxlength="25"
placeholder="请输入标题">
</div>
<div class="form-group divCss8" style="margin:0">
<div class="form-group divCss8">
<label for="inpNo">状态:</label>
<select class="form-control" id="statusflag">
<option value="">正采</option>
<option value="">完成</option>
<select class="form-control input-sm" id="statusflag">
<option value=''>请选择状态</option>
</select>
</div>
<div class="form-group divCss8" style="margin:0">
<div class="form-group divCss8">
<label for="inpNo">来源:</label>
<select class="form-control" id="sysflag">
<option value="">his</option>
<option value="">lis</option>
<option value="">手麻</option>
<select class="form-control input-sm" id="sysflag">
<option value=''>请选择来源</option>
</select>
</div>
<div class="form-group divCss8">
<%-- <div class="form-group divCss8">
<label>结束时间:</label>
<div class="input-group input-daterange">
<input type="text" class="input-sm form-control" name="start" id="startDateTo"
@ -727,12 +724,16 @@
<input type="text" class="input-sm form-control" name="end" id="endDateTo" maxlength="10"
autocomplete="off"/>
</div>
</div>
</div>--%>
<div class="form-group divCss8" style="margin:0;margin-left: 10px;">
<button type="button" class="btn btn-primary btn-sm" id="searchBtn5">查询</button>
<button type="button" class="btn btn-primary btn-sm" onclick="initTable5()">查询</button>
<button type="button" class="btn btn-primary btn-sm" id="searchBtn6">批量更新</button>
</div>
</div>
</div>
<div class="col-sm-12" style="text-align: center;color: red">
同步更新提交后,最近提交时间为红色。同步采集完成后最近提交时间为绿色。
</div>
<!--数据表格-->
<div class="col-sm-12" style="margin-top: 5px">
<table id="table5" class="table text-nowrap table-striped"></table>
@ -743,7 +744,7 @@
</div>
</div>
</body>
<script src="${path}/static/js/beHospList/beHospList.js?time=2020-09-11"></script>
<script src="${path}/static/js/hospitalCommom/hospitalCommom.js?time=2020-09-11"></script>
<script src="${path}/static/js/hospitalLoadPdf/loadPdf.js?time=2020-08-21"></script>
<script src="${path}/static/js/beHospList/beHospList.js?time=2020-10-09"></script>
<script src="${path}/static/js/hospitalCommom/hospitalCommom.js?time=2020-10-09"></script>
<script src="${path}/static/js/hospitalLoadPdf/loadPdf.js?time=2020-10-09"></script>
</html>

@ -354,7 +354,7 @@
</div>
<footer class="main-footer">
<div class="pull-right">
<b>Version</b> 20200918
<b>Version</b> 20201009
</div>
<strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights
reserved.

@ -1001,9 +1001,12 @@ $("#workDetail").click(function(){
$("#workDetailModal").modal({
show: true//弹出对话框
});
initTable5()
initTable5();
//置空初始化
table5Data = '';
})
//任务详情
var table5Data = '';
function initTable5() {
$("#table5").bootstrapTable("destroy");
$("#table5").bootstrapTable({ // 对应table标签的id
@ -1032,7 +1035,7 @@ function initTable5() {
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
showHeader: true,//是否显示列头。
trimOnSearch: true,//设置为 true 将自动去掉搜索字符的前后空格。
sortable: true,
sortable: false,
queryParams: function (params) {
var currPageSize = this.pageSize;
if (currPageSize == 2) {
@ -1049,16 +1052,13 @@ function initTable5() {
limit = currPageSize;
this.pageSize = currPageSize;
}
var temp = {
limit: limit, //页面大小
offset: offset, //页码
sort:params.sort,
order: params.order, //排位命令descasc
patientId: $("#patientId").val(),
jzh: $("#patientId").val(),
c1: $("#c1").val(),
statusflag:$("#statusflag").val(),
statusflag:$("#statusflag").val()
sysflag:$("#sysflag").val(),
};
return temp;
},
@ -1069,11 +1069,11 @@ function initTable5() {
checkbox: true,
width: 25,
align: 'center',
hidden: true,
hidden: true
},
{
title: "操作",
align: 'left',
align: 'center',
valign: 'middle',
width: 120, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
@ -1082,7 +1082,14 @@ function initTable5() {
},
events: {
'click .editInfo': function (e, value, row, index) {
var id = row.idTemp;
var sysflag = row.sysflag;
var notNursingIds = '';
if(sysflag != 1){
sysflag = '';
notNursingIds = id;
}
submitUpdate(id,notNursingIds,sysflag);
}
}
},
@ -1099,62 +1106,124 @@ function initTable5() {
valign: 'middle'
},
{
title: '最近修改',
field: '',
align: 'left',
title: '最近提交',
field: 'createTime',
align: 'center',
valign: 'middle',
sortable: true,
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
if(value != null){
var color = 'red';
if(row.etimeStr != null && row.etimeStr > value){
color = 'green';
}
return '<span style="color: '+color+'">'+value+'</span>';
}else{
return value;
}
}
},
{
title: '同步时间',
field: 'sysupdatetime',
align: 'left',
field: 'sysupdatetimeStr',
align: 'center',
valign: 'middle',
sortable: true,
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return operDisTime(value);
}
},
{
title: '状态',
field: 'statusflag',
align: 'left',
field: 'statusFlagStr',
align: 'center',
valign: 'middle',
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
if(value != null){
var color = '';
if(row.statusflag == 0){
if(row.createTime != null && row.etimeStr != null && row.etimeStr < row.createTime){
color = 'red';
}
}
return '<span style="color:'+color+'">'+value+'</span>';
}else{
return value;
}
}
},
{
title: '备注',
field: 'presult',
align: 'left',
valign: 'middle',
width: 150, // 定义列的宽度单位为像素px
valign: 'middle'
},
{
title: '来源',
field: 'sysflag',
field: 'sysFlagStr',
align: 'center',
valign: 'middle',
sortable: true,
width: 50, // 定义列的宽度单位为像素px
sortable: true
},
{
title: '开始时间',
field: 'stime',
align: 'left',
field: 'stimeStr',
align: 'center',
valign: 'middle',
sortable: true,
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return operDisTime(value);
}
},
{
title: '结束时间',
field: 'etime',
align: 'left',
field: 'etimeStr',
align: 'center',
valign: 'middle',
sortable: true,
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return operDisTime(value);
}
}
],
onLoadSuccess: function (result) { //加载成功时执行
// console.info("加载成功");
//初始化条件选择框
if(table5Data == ''){
if(result != null && result != ''){
table5Data = result;
var rows = result.rows;
var sysFlagMap = new Map();
var statusFlagMap = new Map();
for (var i = 0; i < rows.length; i++) {
var sysFlag = rows[i].sysflag;
if(sysFlag != null){
sysFlagMap.set(sysFlag,rows[i].sysFlagStr);
}
var statusflag = rows[i].statusflag;
if(statusflag != null){
statusFlagMap.set(statusflag,rows[i].statusFlagStr);
}
}
//加载来源选择框
if(sysFlagMap != null){
var html = "<option value=''>请选择来源</option>";
$("#sysflag").empty();
sysFlagMap.forEach(function(value,key){
html += '<option value="'+key+'">'+value+'</option>'
});
$("#sysflag").append(html);
}
//加载状态选择框
if(statusFlagMap != null){
var html = "<option value=''>请选择状态</option>";
$("#statusflag").empty();
statusFlagMap.forEach(function(value,key){
html += '<option value="'+key+'">'+value+'</option>'
});
$("#statusflag").append(html);
}
}
}
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
@ -1176,3 +1245,48 @@ function initTable5() {
}
});
}
//同步更新
function submitUpdate(ids,notNursingIds,sysFlag) {
$.ajax({
type:'post',
url:path+'/archiveExt/submitUpdate',
data:{ids:ids,notNursingIds:notNursingIds,jzh:$("#patientId").val(),masterId:$("#idLab").text(),sysFlag:sysFlag},
dataType:'json',
success:function (data) {
if(data.code == 100){
toastr.success("同步更新已发送,请耐心等待!");
//刷新列表
initTable5();
}else{
toastr.error(data.msg);
}
}
})
}
//批量更新
$("#searchBtn6").click(function(){
var data =$("#table5").bootstrapTable('getSelections');
if(data.length == 0){
toastr.warning("请至少选中一个!");
}else{
var ids = '';
var sysflag = '';
var notNursingIds = '';
for (var i = 0; i < data.length; i++) {
var id = data[i].idTemp;
if(i != 0){
ids += ',';
}
ids += id;
if(data[i].sysflag == 1){
sysflag = 1;
}else{
if(notNursingIds != ''){
notNursingIds += ',';
}
notNursingIds += id;
}
}
submitUpdate(ids,notNursingIds,sysflag);
}
})

@ -0,0 +1,62 @@
[
{
"code": 1,
"name": "护理",
"type": "otherExtSysFlag"
},
{
"code": 2,
"name": "His",
"type": "otherExtSysFlag"
},
{
"code": 3,
"name": "Pasc",
"type": "otherExtSysFlag"
},
{
"code": 4,
"name": "心电",
"type": "otherExtSysFlag"
},
{
"code": 5,
"name": "手麻",
"type": "otherExtSysFlag"
},
{
"code": 6,
"name": "Lis",
"type": "otherExtSysFlag"
},
{
"code": 7,
"name": "首页",
"type": "otherExtSysFlag"
},
{
"code": 8,
"name": "医嘱",
"type": "otherExtSysFlag"
},
{
"code": 0,
"name": "未开始",
"type": "otherExtStatusFlag"
},
{
"code": 1,
"name": "采错",
"type": "otherExtStatusFlag"
},
{
"code": 2,
"name": "正采",
"type": "otherExtStatusFlag"
},
{
"code": 3,
"name": "完成",
"type": "otherExtStatusFlag"
}
]
Loading…
Cancel
Save