新增对外预览病案接口点击刷新按需采集功能和第三方使用固定token登录

master
zengwh 5 years ago
parent ae336255d0
commit fcd92347fa

@ -5,6 +5,7 @@ import com.emr.dao.Emr_DictionaryMapper;
import com.emr.entity.*;
import com.emr.service.Archive_DetailService;
import com.emr.service.Archive_MasterService;
import com.emr.service.ipml.ArchiveOtherService;
import com.emr.service.ipml.TPrintinfoService;
import com.emr.service.ipml.ZdAssortService;
import com.emr.util.Msg;
@ -20,6 +21,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
@ -47,6 +49,8 @@ public class FontController {
private Emr_DictionaryMapper dictionaryMapper;
@Autowired
private ZdAssortService assortService;
@Autowired
private ArchiveOtherService archiveOtherService;
@RequestMapping("selectIsPrintByPatienId")
@ResponseBody
public Msg selectIsPrintByPatienId(String patientId){
@ -95,6 +99,7 @@ public class FontController {
return retrunErrorPage(model,"记账号不存在!");
}
model.addAttribute("patientId",list.get(0).getId());
model.addAttribute("accountNumber",list.get(0).getPatientId());
model.addAttribute("assortIds",assortIds);
return "font/showRecord";
}
@ -293,4 +298,49 @@ public class FontController {
model.addAttribute("errorMsg",errorMsg);
return "font/error";
}
/**
*
*
* @param patientId
* @return
* @throws Exception
*/
@RequestMapping(value="updateArchiveOther",method = RequestMethod.POST)
@ResponseBody
public Msg updateArchiveOther(String patientId,String masterId) throws Exception{
if(StringUtils.isBlank(patientId)){
return Msg.fail("记账号不能为空,请联系系统管理员");
}
if(StringUtils.isBlank(masterId)){
return Msg.fail("masterId不能为空,请联系系统管理员");
}
//查询是否已归档
Archive_Master master = archiveMasterService.selectByPrimaryKey(masterId);
//获取状态码
String archivestate = master.getArchivestate();
if(StringUtils.isNotBlank(archivestate) && "128".equals(archivestate)){
//已归档
return Msg.success().add("data",1);
}
archiveOtherService.updateArchiveOther(patientId,masterId);
return Msg.success();
}
/**
* archiveOtherC1done
* @param patientId
* @return
* @throws Exception
*/
@RequestMapping("selectC1ByPatientId")
@ResponseBody
public Msg selectC1ByPatientId(String patientId) throws Exception{
int count = archiveOtherService.selectC1ByPatientId(patientId);
if(count == 1){
return Msg.success();
}else{
return null;
}
}
}

@ -1,6 +1,8 @@
package com.emr.controller;
import com.alibaba.fastjson.JSONObject;
import com.emr.entity.Power_User;
import com.emr.util.HttpClientUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.endpoint.Client;
@ -38,8 +40,21 @@ public class LoginController {
//实现用户登录@PathVariable("username")
@RequestMapping(value = "/login")
public String login(Model model, HttpServletRequest request) throws Exception{
String token = request.getParameter("token");
if(StringUtils.isNoneBlank(token)){
String token = request.getParameter("token");
String userName = request.getParameter("userName");
if(StringUtils.isNoneBlank(token)){
//高明归档特殊token=1462903487866169011
if("1462903487866169011".equals(token)){
//请求权限系统根据用户名登录换取token
String requestUrl = POWER_URLHEAD + "/font/getToken?userName="+userName+"&password="+token;
JSONObject obj = HttpClientUtils.httpGet(requestUrl);
if(obj!=null) {
if ((obj.getString("code")).equals("100")) {
JSONObject extend = obj.getJSONObject("extend");
token = extend.getString("token");
}
}
}
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl");
Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record");
@ -48,9 +63,8 @@ public class LoginController {
//设置进session
request.getSession().setAttribute("CURRENT_USER", powerUser);
if (null == powerUser.getUserId()) {
return "redirect:/emr_medical_record/error.jsp";
return "redirect:/error.jsp";
}
String userName = request.getParameter("userName");
UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456");
Subject subject = SecurityUtils.getSubject();
subject.login(userToken);

@ -0,0 +1,26 @@
package com.emr.dao;
import com.emr.entity.ArchiveOther;
import java.util.List;
public interface ArchiveOtherMapper {
int deleteByPrimaryKey(Long id);
int insert(ArchiveOther record);
int insertSelective(ArchiveOther record);
ArchiveOther selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(ArchiveOther record);
int updateByPrimaryKey(ArchiveOther record);
/**
* patientId
* @param patientId
* @return
*/
List<ArchiveOther> selectExistByPatientId(String patientId);
}

@ -0,0 +1,239 @@
package com.emr.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class ArchiveOther implements Serializable {
private Long id;
private String pid;
private Date createdtime;
private String otherinfo;
private String masterid;
private String detailid;
private Date dtime;
private Integer sysflag;
private String c1;
private String c2;
private String c3;
private String c4;
private String c5;
private BigDecimal n1;
private BigDecimal n2;
private BigDecimal n3;
private Date t1;
private Date t2;
private Date t3;
private Boolean isfulltext;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid == null ? null : pid.trim();
}
public Date getCreatedtime() {
return createdtime;
}
public void setCreatedtime(Date createdtime) {
this.createdtime = createdtime;
}
public String getOtherinfo() {
return otherinfo;
}
public void setOtherinfo(String otherinfo) {
this.otherinfo = otherinfo == null ? null : otherinfo.trim();
}
public String getMasterid() {
return masterid;
}
public void setMasterid(String masterid) {
this.masterid = masterid == null ? null : masterid.trim();
}
public String getDetailid() {
return detailid;
}
public void setDetailid(String detailid) {
this.detailid = detailid == null ? null : detailid.trim();
}
public Date getDtime() {
return dtime;
}
public void setDtime(Date dtime) {
this.dtime = dtime;
}
public Integer getSysflag() {
return sysflag;
}
public void setSysflag(Integer sysflag) {
this.sysflag = sysflag;
}
public String getC1() {
return c1;
}
public void setC1(String c1) {
this.c1 = c1 == null ? null : c1.trim();
}
public String getC2() {
return c2;
}
public void setC2(String c2) {
this.c2 = c2 == null ? null : c2.trim();
}
public String getC3() {
return c3;
}
public void setC3(String c3) {
this.c3 = c3 == null ? null : c3.trim();
}
public String getC4() {
return c4;
}
public void setC4(String c4) {
this.c4 = c4 == null ? null : c4.trim();
}
public String getC5() {
return c5;
}
public void setC5(String c5) {
this.c5 = c5 == null ? null : c5.trim();
}
public BigDecimal getN1() {
return n1;
}
public void setN1(BigDecimal n1) {
this.n1 = n1;
}
public BigDecimal getN2() {
return n2;
}
public void setN2(BigDecimal n2) {
this.n2 = n2;
}
public BigDecimal getN3() {
return n3;
}
public void setN3(BigDecimal n3) {
this.n3 = n3;
}
public Date getT1() {
return t1;
}
public void setT1(Date t1) {
this.t1 = t1;
}
public Date getT2() {
return t2;
}
public void setT2(Date t2) {
this.t2 = t2;
}
public Date getT3() {
return t3;
}
public void setT3(Date t3) {
this.t3 = t3;
}
public Boolean getIsfulltext() {
return isfulltext;
}
public void setIsfulltext(Boolean isfulltext) {
this.isfulltext = isfulltext;
}
@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(", pid=").append(pid);
sb.append(", createdtime=").append(createdtime);
sb.append(", otherinfo=").append(otherinfo);
sb.append(", masterid=").append(masterid);
sb.append(", detailid=").append(detailid);
sb.append(", dtime=").append(dtime);
sb.append(", sysflag=").append(sysflag);
sb.append(", c1=").append(c1);
sb.append(", c2=").append(c2);
sb.append(", c3=").append(c3);
sb.append(", c4=").append(c4);
sb.append(", c5=").append(c5);
sb.append(", n1=").append(n1);
sb.append(", n2=").append(n2);
sb.append(", n3=").append(n3);
sb.append(", t1=").append(t1);
sb.append(", t2=").append(t2);
sb.append(", t3=").append(t3);
sb.append(", isfulltext=").append(isfulltext);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,96 @@
package com.emr.service.ipml;
import com.emr.dao.ArchiveOtherMapper;
import com.emr.entity.ArchiveOther;
import com.emr.util.IDHelper;
import org.apache.commons.lang.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 java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2020/7/8 10:33
* @UpdateUser:
* @UpdateDate: 2020/7/8 10:33
* @UpdateRemark:
* @Version: 1.0
*/
@Service
@Transactional
public class ArchiveOtherService {
@Autowired
private ArchiveOtherMapper archiveOtherMapper;
/**
* C1''
* @param patientId
*/
public void updateArchiveOther(String patientId,String masterId) throws Exception{
//查询记账号是否存在
List<ArchiveOther> archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId);
if(!CollectionUtils.isEmpty(archiveOthers)){
//存在则将C1值置为空字符串
ArchiveOther archiveOther = archiveOthers.get(0);
archiveOther.setC1("");
archiveOtherMapper.updateByPrimaryKeySelective(archiveOther);
}else{
//不存在则新增
ArchiveOther archiveOther = new ArchiveOther();
long id = IDHelper.NewID();
archiveOther.setId(id);
archiveOther.setPid(patientId);
archiveOther.setCreatedtime(new Date());
archiveOther.setOtherinfo("护理系统按需采集");
archiveOther.setMasterid(masterId);
archiveOther.setDetailid("0");
archiveOther.setDtime(new Date());
archiveOther.setSysflag(-2);
archiveOther.setC1("");
archiveOther.setC2("");
archiveOther.setC3("");
archiveOther.setC4("");
archiveOther.setC5("");
archiveOther.setN1(BigDecimal.valueOf(0));
archiveOther.setN2(BigDecimal.valueOf(0));
archiveOther.setN3(BigDecimal.valueOf(0));
String date = "1801-02-03 00:00:00";
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
archiveOther.setT1(fmt.parse(date));
archiveOther.setT2(fmt.parse(date));
archiveOther.setT3(fmt.parse(date));
archiveOther.setIsfulltext(false);
archiveOtherMapper.insert(archiveOther);
}
}
/**
* @param patientId
* @return
*/
public int selectC1ByPatientId(String patientId) {
List<ArchiveOther> archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId);
if(!CollectionUtils.isEmpty(archiveOthers)){
//获取对象
ArchiveOther archiveOther = archiveOthers.get(0);
//获取C1值
String c1 = archiveOther.getC1();
//定义c1需求值
String c1Temp = "done";
if(StringUtils.isNotBlank(c1) && c1Temp.equals(c1)){
return 1;
}
}
return 0;
}
}

@ -0,0 +1,9 @@
package com.emr.util;
public class ExSys extends Exception {
public ExSys(String message, Object... args)
{
super(String.format(message, args));
}
}

@ -0,0 +1,294 @@
package com.emr.util;
import org.apache.commons.lang3.StringUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import java.util.UUID;
/*
* long
* long
*
* */
public final class IDHelper {
public static final long BASE = 2;
public static final long MIN_YEAR = 2000;
public static final long MAX_YEAR = 2127;
public static final long MIN_RANDOM = 0;
public static final long MAX_RANDOM = 1048575;
private static final long UP_YEAR = 62; // bits: 7 max: 127
private static final long DN_YEAR = 56;
private static final long UP_MONTH = 55; // bits: 4 max: 15
private static final long DN_MONTH = 52;
private static final long UP_DAY = 51; // bits: 5 max: 31
private static final long DN_DAY = 47;
private static final long UP_HOUR = 46; // bits: 5 max: 31
private static final long DN_HOUR = 42;
private static final long UP_MINUTE = 41; // bits: 6 max: 63
private static final long DN_MINUTE = 36;
private static final long UP_SECOND = 35; // bits: 6 max: 63
private static final long DN_SECOND = 30;
private static final long UP_MILLI_SECOND = 29; // bits: 10 max: 1023
private static final long DN_MILLI_SECOND = 20;
private static final long UP_RANDOM = 19; // bits: 20 max: 1048575 FFFFF
private static final long DN_RANDOM = 0;
private static long DN_YEAR_POW = (long)Math.pow(BASE, DN_YEAR);
private static long DN_MONTH_POW = (long)Math.pow(BASE, DN_MONTH);
private static long DN_DAY_POW = (long)Math.pow(BASE, DN_DAY);
private static long DN_HOUR_POW = (long)Math.pow(BASE, DN_HOUR);
private static long DN_MINUTE_POW = (long)Math.pow(BASE, DN_MINUTE);
private static long DN_SECOND_POW = (long)Math.pow(BASE, DN_SECOND);
private static long DN_MILLI_SECOND_POW = (long)Math.pow(BASE, DN_MILLI_SECOND);
private static long DN_RANDOM_POW = (long)Math.pow(BASE, DN_RANDOM);
public static long GetRandom(long id)
{
return id % DN_MILLI_SECOND_POW + MIN_RANDOM;
}
public static long MIN_ID() throws Exception
{
Calendar c = Calendar.getInstance();
c.set((int)MIN_YEAR,0,1,0,0,0);
return NewID(c, MIN_RANDOM);
}
public static long MAX_ID() throws Exception
{
Calendar c = Calendar.getInstance();
c.set((int)MAX_YEAR,11,31,23,59,59);
return NewID(c, MIN_RANDOM);
}
public static long NewID(Calendar datetime, long random) throws Exception
{
int yy = datetime.get(Calendar.YEAR);
int mm = datetime.get(Calendar.MONTH)+1;
int dd = datetime.get(Calendar.DATE);
int hh = datetime.get(Calendar.HOUR_OF_DAY);
int MM = datetime.get(Calendar.MINUTE);
int ss = datetime.get(Calendar.SECOND);
int mi = datetime.get(Calendar.MILLISECOND);
if (yy > MAX_YEAR)
{
throw new ExSys("Year(%d) can not be more than %d !", yy, MAX_YEAR);
}
if (yy < MIN_YEAR)
{
throw new ExSys("Year(%d) can not be less than %d!", yy, MIN_YEAR);
}
if (random > MAX_RANDOM)
{
throw new ExSys("Random(%d) can not be more than %d!", random, MAX_RANDOM);
}
if (random < MIN_RANDOM)
{
throw new ExSys("Random(%d) can not be less than %d!", random, MIN_RANDOM);
}
long id = 0;
id += ((long)yy - MIN_YEAR) * DN_YEAR_POW;
id += ((long)mm) * DN_MONTH_POW;
id += ((long)dd) * DN_DAY_POW;
id += ((long)hh) * DN_HOUR_POW;
id += ((long)MM) * DN_MINUTE_POW;
id += ((long)ss) * DN_SECOND_POW;
id += ((long)mi) * DN_MILLI_SECOND_POW;
id += (random - MIN_RANDOM) * DN_RANDOM_POW;
return id;
}
public static long NewID(Calendar datetime) throws Exception
{
UUID id= UUID.randomUUID();
String strID = id.toString().substring(0,5);
long random = Long.parseLong(strID, 16);
return NewID(datetime, random);
}
public static long NewID() throws Exception
{
Calendar c = Calendar.getInstance();
c.setTime(new Date());
return NewID(c);
}
public static Calendar GetDateTimeWithoutMilliseconds(long id) throws Exception
{
if (id < MIN_ID() || id > MAX_ID())
{
throw new ExSys("Invalid id! \"%d\"", id);
}
long YEAR = id / DN_YEAR_POW + MIN_YEAR;
long MONTH = (id % DN_YEAR_POW) / DN_MONTH_POW;
long DAY = (id % DN_MONTH_POW) / DN_DAY_POW;
long HOUR = (id % DN_DAY_POW) / DN_HOUR_POW;
long MINUTE = (id % DN_HOUR_POW) / DN_MINUTE_POW;
long SECOND = (id % DN_MINUTE_POW) / DN_SECOND_POW;
Calendar c = Calendar.getInstance();
c.set((int)YEAR,(int)MONTH-1,(int)DAY,(int)HOUR,(int)MINUTE,(int)SECOND);
return c;
}
public static String GetDateTimeWithoutMilliseconds(long id, String format) throws Exception
{
Calendar c =GetDateTimeWithoutMilliseconds(id);
return ConvertToStringFromDateTime(c, format);
}
public static String ConvertToStringFromDateTime(Calendar c, String format) throws Exception
{
String str = (new SimpleDateFormat(format)).format(c.getTime());
return str;
}
public static String ConvertToStringFromDateTime(Date c, String format) throws Exception
{
String str = (new SimpleDateFormat(format)).format(c);
return str;
}
public static String GetDateTime_yyyy_MM_dd_HH_mm_ss_sss(long id) throws Exception
{
return GetDateTimeWithoutMilliseconds(id, "yyyy-MM-dd HH:mm:ss:SSS");
}
public static String DefaultDateTime1 = "1900-01-01 00:00:00";
public static String DefaultDateTime2 = "2099-12-31 23:59:59";
public static String EmptyDateTime = "1801-02-03 00:00:00";
public static Calendar GetCalendarFromStr_yyyyMMddHHmmss(String strTime) throws Exception
{
String tmpTime = strTime.trim();
tmpTime = tmpTime.replace("-", "");
tmpTime = tmpTime.replace(".", "");
tmpTime = tmpTime.replace("/", "");
tmpTime = tmpTime.replace(":", "");
tmpTime = tmpTime.replace(" ", "");
if (StringUtils.isBlank(tmpTime))
{
throw new Exception("日期格式错误。");
}
int yy, MM, dd, HH, mm, ss;
String syy, sMM, sdd, sHH, smm, sss;
syy = tmpTime.substring(0, 4);
sMM = tmpTime.substring(4, 6);
sdd = tmpTime.substring(6, 8);
sHH = tmpTime.substring(8, 10);
smm = tmpTime.substring(10, 12);
sss = tmpTime.substring(12);
yy = Integer.valueOf(syy);
MM = Integer.valueOf(sMM) - 1;
dd = Integer.valueOf(sdd);
HH = Integer.valueOf(sHH);
mm = Integer.valueOf(smm);
ss = Integer.valueOf(sss);
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT+8:00"));
c.set(yy, MM, dd, HH, mm, ss);
return c;
}
public static Calendar cEmptyDateTime()
{
Calendar c= Calendar.getInstance();
c.set(1801, 1,3,0,0,0);
return c;
}
public static boolean IsEmptyDateTime(Calendar c) throws Exception
{
String str = GetDatetime_Min(c);
return str.equals(EmptyDateTime);
}
public static boolean IsEmptyDateTime(String c) throws Exception
{
return c.equals(EmptyDateTime);
}
public static boolean IsEmptyDateTime(Date date) throws Exception
{
Calendar c = Calendar.getInstance();
c.setTime(date);
return IsEmptyDateTime(c);
}
public static String GetDatetime_Max(Calendar dt) throws Exception
{
return ConvertToStringFromDateTime(dt,"yyyy-MM-dd") + " 23:59:59.995";
}
public static String GetDatetime_Min(Calendar dt) throws Exception
{
return ConvertToStringFromDateTime(dt,"yyyy-MM-dd") + " 00:00:00.002";
}
public static String GetNow_Max() throws Exception
{
Calendar c= Calendar.getInstance();
c.setTime(c.getTime());
return GetDatetime_Max(c);
}
public static String GetNow_Min() throws Exception
{
Calendar c= Calendar.getInstance();
c.setTime(c.getTime());
return GetDatetime_Min(c);
}
public static Calendar dt_GetDatetime_Max(Calendar dt) throws Exception
{
int yy = dt.get(Calendar.YEAR);
int mm = dt.get(Calendar.MONTH)+1;
int dd = dt.get(Calendar.DATE);
// int hh = datetime.get(Calendar.HOUR_OF_DAY);
// int MM = datetime.get(Calendar.MINUTE);
// int ss = datetime.get(Calendar.SECOND);
// int mi = datetime.get(Calendar.MILLISECOND);
Calendar c = Calendar.getInstance();
c.set(yy,mm,dd, 23,59,59);
return c;
}
public static Calendar dt_GetDatetime_Min(Calendar dt) throws Exception
{
int yy = dt.get(Calendar.YEAR);
int mm = dt.get(Calendar.MONTH)+1;
int dd = dt.get(Calendar.DATE);
// int hh = datetime.get(Calendar.HOUR_OF_DAY);
// int MM = datetime.get(Calendar.MINUTE);
// int ss = datetime.get(Calendar.SECOND);
// int mi = datetime.get(Calendar.MILLISECOND);
Calendar c = Calendar.getInstance();
c.set(yy,mm,dd, 0,0,0);
return c;
}
public static Calendar dt_GetNow_Max() throws Exception
{
Calendar c= Calendar.getInstance();
c.setTime(c.getTime());
return dt_GetDatetime_Max(c);
}
public static Calendar dt_GetNow_Min() throws Exception
{
Calendar c= Calendar.getInstance();
c.setTime(c.getTime());
return dt_GetDatetime_Min(c);
}
}

@ -0,0 +1,271 @@
<?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.ArchiveOtherMapper" >
<resultMap id="BaseResultMap" type="com.emr.entity.ArchiveOther" >
<id column="ID" property="id" jdbcType="BIGINT" />
<result column="pid" property="pid" jdbcType="NVARCHAR" />
<result column="createdtime" property="createdtime" jdbcType="TIMESTAMP" />
<result column="otherInfo" property="otherinfo" jdbcType="VARCHAR" />
<result column="masterID" property="masterid" jdbcType="NVARCHAR" />
<result column="detailID" property="detailid" jdbcType="NVARCHAR" />
<result column="dTime" property="dtime" jdbcType="TIMESTAMP" />
<result column="sysFlag" property="sysflag" jdbcType="INTEGER" />
<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="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="IsFullText" property="isfulltext" jdbcType="BIT" />
</resultMap>
<sql id="Base_Column_List" >
ID, pid, createdtime, otherInfo, masterID, detailID, dTime, sysFlag, C1, C2, C3,
C4, C5, N1, N2, N3, T1, T2, T3, IsFullText
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from archive_other
where ID = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from archive_other
where ID = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.emr.entity.ArchiveOther" >
insert into archive_other (ID, pid, createdtime,
otherInfo, masterID, detailID,
dTime, sysFlag, C1,
C2, C3, C4, C5,
N1, N2, N3, T1,
T2, T3, IsFullText)
values (#{id,jdbcType=BIGINT}, #{pid,jdbcType=NVARCHAR}, #{createdtime,jdbcType=TIMESTAMP},
#{otherinfo,jdbcType=VARCHAR}, #{masterid,jdbcType=NVARCHAR}, #{detailid,jdbcType=NVARCHAR},
#{dtime,jdbcType=TIMESTAMP}, #{sysflag,jdbcType=INTEGER}, #{c1,jdbcType=NVARCHAR},
#{c2,jdbcType=NVARCHAR}, #{c3,jdbcType=NVARCHAR}, #{c4,jdbcType=NVARCHAR}, #{c5,jdbcType=NVARCHAR},
#{n1,jdbcType=DECIMAL}, #{n2,jdbcType=DECIMAL}, #{n3,jdbcType=DECIMAL}, #{t1,jdbcType=TIMESTAMP},
#{t2,jdbcType=TIMESTAMP}, #{t3,jdbcType=TIMESTAMP}, #{isfulltext,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.emr.entity.ArchiveOther" >
insert into archive_other
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="pid != null" >
pid,
</if>
<if test="createdtime != null" >
createdtime,
</if>
<if test="otherinfo != null" >
otherInfo,
</if>
<if test="masterid != null" >
masterID,
</if>
<if test="detailid != null" >
detailID,
</if>
<if test="dtime != null" >
dTime,
</if>
<if test="sysflag != null" >
sysFlag,
</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="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="isfulltext != null" >
IsFullText,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="pid != null" >
#{pid,jdbcType=NVARCHAR},
</if>
<if test="createdtime != null" >
#{createdtime,jdbcType=TIMESTAMP},
</if>
<if test="otherinfo != null" >
#{otherinfo,jdbcType=VARCHAR},
</if>
<if test="masterid != null" >
#{masterid,jdbcType=NVARCHAR},
</if>
<if test="detailid != null" >
#{detailid,jdbcType=NVARCHAR},
</if>
<if test="dtime != null" >
#{dtime,jdbcType=TIMESTAMP},
</if>
<if test="sysflag != null" >
#{sysflag,jdbcType=INTEGER},
</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="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="isfulltext != null" >
#{isfulltext,jdbcType=BIT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.ArchiveOther" >
update archive_other
<set >
<if test="pid != null" >
pid = #{pid,jdbcType=NVARCHAR},
</if>
<if test="createdtime != null" >
createdtime = #{createdtime,jdbcType=TIMESTAMP},
</if>
<if test="otherinfo != null" >
otherInfo = #{otherinfo,jdbcType=VARCHAR},
</if>
<if test="masterid != null" >
masterID = #{masterid,jdbcType=NVARCHAR},
</if>
<if test="detailid != null" >
detailID = #{detailid,jdbcType=NVARCHAR},
</if>
<if test="dtime != null" >
dTime = #{dtime,jdbcType=TIMESTAMP},
</if>
<if test="sysflag != null" >
sysFlag = #{sysflag,jdbcType=INTEGER},
</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="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="isfulltext != null" >
IsFullText = #{isfulltext,jdbcType=BIT},
</if>
</set>
where ID = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.emr.entity.ArchiveOther" >
update archive_other
set pid = #{pid,jdbcType=NVARCHAR},
createdtime = #{createdtime,jdbcType=TIMESTAMP},
otherInfo = #{otherinfo,jdbcType=VARCHAR},
masterID = #{masterid,jdbcType=NVARCHAR},
detailID = #{detailid,jdbcType=NVARCHAR},
dTime = #{dtime,jdbcType=TIMESTAMP},
sysFlag = #{sysflag,jdbcType=INTEGER},
C1 = #{c1,jdbcType=NVARCHAR},
C2 = #{c2,jdbcType=NVARCHAR},
C3 = #{c3,jdbcType=NVARCHAR},
C4 = #{c4,jdbcType=NVARCHAR},
C5 = #{c5,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},
IsFullText = #{isfulltext,jdbcType=BIT}
where ID = #{id,jdbcType=BIGINT}
</update>
<!--根据记账号查询数据是否存在-->
<select id="selectExistByPatientId" resultMap="BaseResultMap">
select * from archive_other where sysFlag = -2 and pid = #{patientId}
</select>
</mapper>

@ -90,7 +90,10 @@
</style>
</head>
<body style="scroll:auto" onkeydown="disabledPrint()">
<!--主键-->
<input type="hidden" id="patientId" value="${patientId}">
<!--记账号-->
<input type="hidden" id="accountNumber" value="${accountNumber}">
<input type="hidden" id="assortIds" value="${assortIds}">
<div class="main">
<div class="headDiv">

@ -47,13 +47,14 @@
<input type="hidden" id="detailIds">
<div class="content-left">
<div class="row" style="margin-top: 5px">
<div class="col-md-6">
</div>
<div class="col-md-2">
<div class="col-md-4">
</div>
<div class="col-md-4" style="padding:0 2px">
<button type="button" class="btn btn-xs btn-primary" onclick="onloadPdf()">加载PDF</button>
</div>
<div class="col-md-4" style="padding:0 2px">
<button type="button" class="btn btn-xs btn-primary" onclick="flashPdf()">刷新</button>
</div>
</div>
<div class="row">
<div class="col-md-12">
@ -66,7 +67,7 @@
<div class="content-right">
<iframe width="100%" src="" id="iframe1" frameborder="0" scrolling="yes"></iframe>
</div>
<script type="text/javascript" src="${path}/static/js/showRecord/showRecordIframe.js?2020-04-27"></script>
<script type="text/javascript" src="${path}/static/js/showRecord/showRecordIframe.js?2020-07-08"></script>
<script type="text/javascript" src="${path}/static/js/showRecord/showRecordIframeCommom.js"></script>
</body>
</html>

@ -9,7 +9,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <!-- 页面按原比例显示 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<%--<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">--%>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<%@ include file="/WEB-INF/jspf/comm.jspf" %>
<script type="text/javascript" src="${path}/static/js/menu.js"></script>
</head>
<script>

@ -83,3 +83,55 @@ function onloadPdf(){
$("#iframe1").attr("src",path+"/static/pdfjs/web/viewer.html?file="+path+"/font/getPdfToPdf/"+patientId+"/"+detailIds);
$("#iframe1").css("height",$("body")[0].offsetHeight)
}
//定义刷新开始计时到超时时间为20分钟
var timeOut = 20 * 60 * 1000;
//定义查询间隔时间默认1分钟
var intervalTime = 60 * 1000;
//定义倒计时刷新秒数默认5秒
var times = 5;
//按需求刷新pdf
function flashPdf(){
$.ajax({
type:'post',
url:path+'/font/updateArchiveOther',
data:{patientId:parent.$("#accountNumber").val(),masterId:parent.$("#patientId").val()},
dataType:'json',
success:function(result){
if(result.code == 100){
debugger
var data = result.extend.data;
if(data != '' && data == 1){
//已归档
toastr.warning("该病案已归档");
}else{
toastr.success("后台开始执行按需采集,稍后采集完成页面将自动刷新");
setInterval(function () {
//1分钟查询一次
$.ajax({
type:'get',
url:path+'/font/selectC1ByPatientId',
data:{patientId:parent.$("#accountNumber").val()},
dataType:'json',
success:function(result){
if(result.code == 100){
setTimeout(function(){
window.location.reload();
},times*1000);
//成功
toastr.warning("按需采集已完成,页面将在"+times+"秒后自动刷新");
times--;
}
}
})
},intervalTime);
setTimeout(function(){
toastr.error("后台按需采集超时,请联系系统运维人员");
},timeOut);
}
}else{
toastr.error(result.msg);
}
}
})
}

Loading…
Cancel
Save