diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java index 225ee49..b729e9c 100644 --- a/src/main/java/com/docus/server/AppRunBootstrap.java +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -3,6 +3,7 @@ package com.docus.server; import lombok.extern.slf4j.Slf4j; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -11,6 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; //@EnableFeignClients(basePackages = ("com.feign")) //@EnableHystrix @SpringBootApplication(scanBasePackages ={"com.docus"}) +@MapperScan("com.docus.server.**.mapper") public class AppRunBootstrap { public static void main(String[] args) { System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); diff --git a/src/main/java/com/docus/server/CxfConfig.java b/src/main/java/com/docus/server/CxfConfig.java index d2ce69c..386e616 100644 --- a/src/main/java/com/docus/server/CxfConfig.java +++ b/src/main/java/com/docus/server/CxfConfig.java @@ -1,6 +1,7 @@ package com.docus.server; import com.docus.server.collection.webservice.IUserServer; +import com.docus.server.collection.webservice.TBasicService; import org.apache.cxf.jaxws.EndpointImpl; import lombok.RequiredArgsConstructor; import org.springframework.boot.web.servlet.ServletRegistrationBean; @@ -17,6 +18,7 @@ import javax.xml.ws.Endpoint; public class CxfConfig { private final IUserServer userServer; + private final TBasicService tBasicService; /** * 注入Servlet,注意beanName不能为dispatcherServlet * @author Fang Ruichuan @@ -33,9 +35,16 @@ public class CxfConfig { } @Bean - public Endpoint endpoint() { + public Endpoint endpoint1() { EndpointImpl endpoint = new EndpointImpl(springBus(), userServer); endpoint.publish("/api"); return endpoint; } + + @Bean + public Endpoint endpoint2() { + EndpointImpl endpoint = new EndpointImpl(springBus(), tBasicService); + endpoint.publish("/api/basic"); + return endpoint; + } } diff --git a/src/main/java/com/docus/server/collection/dto/TBasicDto.java b/src/main/java/com/docus/server/collection/dto/TBasicDto.java new file mode 100644 index 0000000..93df3c8 --- /dev/null +++ b/src/main/java/com/docus/server/collection/dto/TBasicDto.java @@ -0,0 +1,25 @@ +package com.docus.server.collection.dto; + +import lombok.Data; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.webservice + * @Author: chierhao + * @CreateTime: 2023-02-25 14:44 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class TBasicDto { + private String serialId; + private String jzh; + private String inpatientNo; + private String admissTimes; + private String name ; + private String admissDate ; + private String disDate ; + private String admissDeptName ; + private String disDeptName ; + private String attendingName; +} diff --git a/src/main/java/com/docus/server/collection/webservice/UserDto.java b/src/main/java/com/docus/server/collection/dto/UserDto.java similarity index 83% rename from src/main/java/com/docus/server/collection/webservice/UserDto.java rename to src/main/java/com/docus/server/collection/dto/UserDto.java index 77541f8..c998a2f 100644 --- a/src/main/java/com/docus/server/collection/webservice/UserDto.java +++ b/src/main/java/com/docus/server/collection/dto/UserDto.java @@ -1,4 +1,4 @@ -package com.docus.server.collection.webservice; +package com.docus.server.collection.dto; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/docus/server/collection/entity/TBasic.java b/src/main/java/com/docus/server/collection/entity/TBasic.java new file mode 100644 index 0000000..7389ea5 --- /dev/null +++ b/src/main/java/com/docus/server/collection/entity/TBasic.java @@ -0,0 +1,158 @@ +package com.docus.server.collection.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案基本信息 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TBasic对象", description = "病案基本信息") +public class TBasic implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "病案主键") + @TableId(value = "patient_id", type = IdType.ASSIGN_ID) + private String patientId; + + @ApiModelProperty(value = "住院次数") + private Integer admissTimes; + + @ApiModelProperty(value = "病案号") + private String inpatientNo; + + @ApiModelProperty(value = "住院ID号") + private String admissId; + + @ApiModelProperty(value = "患者姓名") + private String name; + + @ApiModelProperty(value = "盘号") + private String ph; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "年龄_岁") + private Integer age; + + @ApiModelProperty(value = "年龄_月") + private Integer ageMonth; + + @ApiModelProperty(value = "年龄_天") + private Integer ageDay; + + @ApiModelProperty(value = "身份证") + private String idCard; + + @ApiModelProperty(value = "手机号码") + private String telphone; + + @ApiModelProperty(value = "住院日期") + private Date admissDate; + + @ApiModelProperty(value = "住院科室") + private String admissDept; + + @ApiModelProperty(value = "住院科室名称") + private String admissDeptName; + + @ApiModelProperty(value = "出院日期") + private Date disDate; + + @ApiModelProperty(value = "出院科室") + private String disDept; + + @ApiModelProperty(value = "出院科室名称") + private String disDeptName; + + @ApiModelProperty(value = "实际住院天数") + private Integer admissDays; + + @ApiModelProperty(value = "主管医生") + private String attending; + + @ApiModelProperty(value = "主管医生名称") + private String attendingName; + + @ApiModelProperty(value = "主要诊断编码") + private String mainDiagCode; + + @ApiModelProperty(value = "主要诊断名称") + private String mainDiagName; + + @ApiModelProperty(value = "主要手术编码") + private String mainOperateCode; + + @ApiModelProperty(value = "主要手术名称") + private String mainOperateName; + + @ApiModelProperty(value = "是否死亡") + private Integer isDead; + + @ApiModelProperty(value = "是否作废(0:否,1:是)") + private Integer isCancel; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "是否归档 1:已归档,0:未归档") + private Integer isArchive; + + @ApiModelProperty(value = "归档时间") + private Date archiveTime; + + @ApiModelProperty(value = "文件来源 1:af_archive_detail,2:t_scan_assort") + private Integer fileSource; + + @ApiModelProperty(value = "完整性描述") + private String integrityDesc; + + private String bColumn1; + + private String bColumn2; + + private String bColumn3; + + private String bColumn4; + + private String bColumn5; + + private Integer bColumn6; + + private Integer bColumn7; + + private Integer bColumn8; + + private Integer bColumn9; + + private Integer bColumn10; + + @ApiModelProperty(value = "姓名缩写(内部构成)") + private String nameSpell; + + @ApiModelProperty(value = "性别名称") + private String sexName; + + @ApiModelProperty(value = "记账号") + private String jzh; + + +} diff --git a/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java b/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java new file mode 100644 index 0000000..e5dc000 --- /dev/null +++ b/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java @@ -0,0 +1,17 @@ +package com.docus.server.collection.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.server.collection.entity.TBasic; + +/** + *

+ * 病案基本信息 Mapper 接口 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +public interface TBasicMapper extends BaseMapper { + +} diff --git a/src/main/java/com/docus/server/collection/util/Result.java b/src/main/java/com/docus/server/collection/util/Result.java new file mode 100644 index 0000000..4b01851 --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/Result.java @@ -0,0 +1,98 @@ +package com.docus.server.collection.util; + +import com.docus.core.util.DateUtil; +import com.docus.core.util.Func; +import lombok.Data; + +import java.util.Date; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.util + * @Author: chierhao + * @CreateTime: 2023-02-25 16:59 + * @Description: TODO + * @Version: 1.0 + */ +@Data +public class Result { + + + + public static String success(String serialId){ + + String createTime= Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + + String message="成功"; + + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } + public static String failed(String serialId,String message){ + + String createTime= Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + + + return " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + } + +} diff --git a/src/main/java/com/docus/server/collection/util/XmlUtil.java b/src/main/java/com/docus/server/collection/util/XmlUtil.java new file mode 100644 index 0000000..a10dcef --- /dev/null +++ b/src/main/java/com/docus/server/collection/util/XmlUtil.java @@ -0,0 +1,850 @@ +/* + * Copyright (c) 2018-2028, DreamLu All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: DreamLu 卢春梦 (596392912@qq.com) + */ +package com.docus.server.collection.util; + +import com.docus.core.util.Exceptions; +import com.docus.core.util.IoUtil; +import org.springframework.lang.Nullable; +import org.w3c.dom.*; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; + +/** + * xpath解析xml + * + *
+ *     文档地址:
+ *     http://www.w3school.com.cn/xpath/index.asp
+ * 
+ * + * @author L.cm + */ +public class XmlUtil { + private final XPath path; + private final Document doc; + + private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory dbf = getDocumentBuilderFactory(); + DocumentBuilder db = dbf.newDocumentBuilder(); + doc = db.parse(inputSource); + path = getXPathFactory().newXPath(); + } + + /** + * 创建工具类 + * + * @param inputSource inputSource + * @return XmlUtil + */ + private static XmlUtil create(InputSource inputSource) { + try { + return new XmlUtil(inputSource); + } catch (ParserConfigurationException | SAXException | IOException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 转换工具类 + * + * @param inputStream inputStream + * @return XmlUtil + */ + public static XmlUtil of(InputStream inputStream) { + InputSource inputSource = new InputSource(inputStream); + return create(inputSource); + } + + /** + * 转换工具类 + * + * @param xmlStr xmlStr + * @return XmlUtil + */ + public static XmlUtil of(String xmlStr) { + StringReader sr = new StringReader(xmlStr.trim()); + InputSource inputSource = new InputSource(sr); + XmlUtil xmlUtil = create(inputSource); + IoUtil.closeQuietly(sr); + return xmlUtil; + } + + /** + * 转换路径 + * + * @param expression 表达式 + * @param item 实体 + * @param returnType 返回类型 + * @return Object + */ + private Object evalXPath(String expression, @Nullable Object item, QName returnType) { + item = null == item ? doc : item; + try { + return path.evaluate(expression, item, returnType); + } catch (XPathExpressionException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 获取String + * + * @param expression 路径 + * @return {String} + */ + public String getString(String expression) { + return (String) evalXPath(expression, null, XPathConstants.STRING); + } + + /** + * 获取Boolean + * + * @param expression 路径 + * @return {String} + */ + public Boolean getBoolean(String expression) { + return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN); + } + + /** + * 获取Number + * + * @param expression 路径 + * @return {Number} + */ + public Number getNumber(String expression) { + return (Number) evalXPath(expression, null, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param expression 路径 + * @return {Node} + */ + public Node getNode(String expression) { + return (Node) evalXPath(expression, null, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param expression 路径 + * @return NodeList + */ + public NodeList getNodeList(String expression) { + return (NodeList) evalXPath(expression, null, XPathConstants.NODESET); + } + + + /** + * 获取String + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public String getString(Object node, String expression) { + return (String) evalXPath(expression, node, XPathConstants.STRING); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public Boolean getBoolean(Object node, String expression) { + return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {Number} + */ + public Number getNumber(Object node, String expression) { + return (Number) evalXPath(expression, node, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param node 节点 + * @param expression 路径 + * @return {Node} + */ + public Node getNode(Object node, String expression) { + return (Node) evalXPath(expression, node, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return NodeList + */ + public NodeList getNodeList(Object node, String expression) { + return (NodeList) evalXPath(expression, node, XPathConstants.NODESET); + } + + /** + * 针对没有嵌套节点的简单处理 + * + * @return map集合 + */ + public Map toMap() { + Element root = doc.getDocumentElement(); + Map params = new HashMap<>(16); + + // 将节点封装成map形式 + NodeList list = root.getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if (node instanceof Element) { + params.put(node.getNodeName(), node.getTextContent()); + } + } + return params; + } + + private static volatile boolean preventedXXE = false; + + private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException { + DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory; + if (!preventedXXE) { + preventXXE(dbf); + } + return dbf; + } + + /** + * preventXXE + * + * @param dbf + * @throws ParserConfigurationException + */ + private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException { + // This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented + // Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl + dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + + // If you can't completely disable DTDs, then at least do the following: + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities + + // JDK7+ - http://xml.org/sax/features/external-general-entities + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities + + // JDK7+ - http://xml.org/sax/features/external-parameter-entities + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + + // Disable external DTDs as well + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + + // and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks" + dbf.setXIncludeAware(false); + dbf.setExpandEntityReferences(false); + preventedXXE = true; + } + + private static XPathFactory getXPathFactory() { + return XmlHelperHolder.xPathFactory; + } + + /** + * 内部类单例 + */ + private static class XmlHelperHolder { + private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + private static XPathFactory xPathFactory = XPathFactory.newInstance(); + } + private static String str; + static { + str=" \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 59 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 205室 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 2号楼16楼西区 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 南方医科大学顺德医院 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 常规 \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 张存良 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 文本 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 乳房病类 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " O \n" + + " \n" + + " 0 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 01 \n" + + " \n" + + " 出院医嘱 \n" + + " \n" + + "
\n"; + } + + public static void main(String[] args) { + XmlUtil a=XmlUtil.of(str); + Node node=null; + //id-消息流水号 + node = a.getNode("/PRPA_HIP0032/id/@extension"); + String serialId = node.toString(); + System.out.println(serialId); + //住院流水号 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension"); + String jzh = node.toString(); + System.out.println(jzh); + //住院号标识 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension"); + String inpatientNo = node.toString(); + System.out.println(inpatientNo); + //住院次数[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value"); + String admissTimes=node.toString(); + System.out.println(admissTimes); + //姓名 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value"); + String name = node.toString(); + System.out.println(name); + //入院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value"); + String admissDate = node.toString(); + System.out.println(admissDate); + //出院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value"); + String disDate = node.toString(); + System.out.println(disDate); + //入院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String admissDeptName = node.getTextContent(); + System.out.println(admissDeptName); + //出院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String disDeptName = node.getTextContent(); + System.out.println(disDeptName); + //主治医师[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name"); + String attendingName = node.getTextContent(); + System.out.println(attendingName); + } +} diff --git a/src/main/java/com/docus/server/collection/webservice/IUserServer.java b/src/main/java/com/docus/server/collection/webservice/IUserServer.java index 5ef87fe..9408aeb 100644 --- a/src/main/java/com/docus/server/collection/webservice/IUserServer.java +++ b/src/main/java/com/docus/server/collection/webservice/IUserServer.java @@ -1,5 +1,7 @@ package com.docus.server.collection.webservice; +import com.docus.server.collection.dto.UserDto; + /** * @author Fang Ruichuan * @date 2022-11-14 19:03 diff --git a/src/main/java/com/docus/server/collection/webservice/TBasicService.java b/src/main/java/com/docus/server/collection/webservice/TBasicService.java new file mode 100644 index 0000000..f1ac396 --- /dev/null +++ b/src/main/java/com/docus/server/collection/webservice/TBasicService.java @@ -0,0 +1,6 @@ +package com.docus.server.collection.webservice; + +public interface TBasicService { + + public String setTBasic(String str); +} diff --git a/src/main/java/com/docus/server/collection/webservice/impl/TBasicServiceImpl.java b/src/main/java/com/docus/server/collection/webservice/impl/TBasicServiceImpl.java new file mode 100644 index 0000000..049f530 --- /dev/null +++ b/src/main/java/com/docus/server/collection/webservice/impl/TBasicServiceImpl.java @@ -0,0 +1,129 @@ +package com.docus.server.collection.webservice.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.docus.core.util.DateUtil; +import com.docus.core.util.Func; +import com.docus.server.collection.dto.TBasicDto; +import com.docus.server.collection.entity.TBasic; +import com.docus.server.collection.mapper.TBasicMapper; +import com.docus.server.collection.util.Result; +import com.docus.server.collection.util.XmlUtil; +import com.docus.server.collection.webservice.TBasicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.w3c.dom.Node; + +import javax.jws.WebService; +import java.util.Date; +import java.util.HashMap; + +/** + * @BelongsProject: docus-webservice-sdry + * @BelongsPackage: com.docus.server.collection.webservice + * @Author: chierhao + * @CreateTime: 2023-02-25 14:52 + * @Description: TODO + * @Version: 1.0 + */ +@Service +@WebService +public class TBasicServiceImpl implements TBasicService { + + @Autowired + private TBasicMapper tBasicMapper; + + @Override + public String setTBasic(String body) { + System.out.println(body); + if (Func.isEmpty(body)) { + return Result.failed(null,"参数为空"); + } + //解析xml + TBasicDto tBasicDto = getTBasicDto(body); + + System.out.println(tBasicDto.toString()); + + //判断jzh是否重复 + TBasic selectTBasic = tBasicMapper.selectOne(new QueryWrapper().eq("jzh", tBasicDto.getJzh())); + if (selectTBasic != null) { + return Result.failed(tBasicDto.getSerialId(),"记帐号已存在"); + } + //组装数据 + TBasic tBasic=new TBasic(); + tBasic.setJzh(tBasicDto.getJzh()); + tBasic.setInpatientNo(tBasicDto.getInpatientNo()); + tBasic.setAdmissTimes(Integer.parseInt(tBasicDto.getAdmissTimes())); + tBasic.setName(tBasicDto.getName()); + Date admissDate = Func.parseDate(tBasicDto.getAdmissDate(), DateUtil.PATTERN_DATETIME_MINI); + tBasic.setAdmissDate(admissDate); + Date disDate = Func.parseDate(tBasicDto.getDisDate(), DateUtil.PATTERN_DATETIME_MINI); + tBasic.setDisDate(disDate); + tBasic.setAdmissDeptName(tBasicDto.getAdmissDeptName()); + tBasic.setDisDeptName(tBasicDto.getDisDeptName()); + tBasic.setAttendingName(tBasicDto.getAttendingName()); + //持久化 + tBasicMapper.insert(tBasic); + return Result.success(tBasicDto.getSerialId()); + } + + + public TBasicDto getTBasicDto(String str) { + TBasicDto dto=new TBasicDto(); + XmlUtil xml=XmlUtil.of(str); + Node node=null; + //id-消息流水号 + node = xml.getNode("/PRPA_HIP0032/id/@extension"); + if(Func.isEmpty(node)){ + dto.setSerialId(node.getNodeValue()); + } + //住院流水号 + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension"); + if(Func.isEmpty(node)){ + dto.setJzh(node.getNodeValue()); + } + //住院号标识 + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension"); + if(Func.isEmpty(node)){ + dto.setInpatientNo( node.getNodeValue()); + } + //住院次数[] + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value"); + if(Func.isEmpty(node)){ + dto.setAdmissTimes(node.getNodeValue()); + } + //姓名 + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value"); + if(Func.isEmpty(node)){ + dto.setName(node.getNodeValue()); + } + //入院日期时间 + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value"); + if(Func.isEmpty(node)){ + dto.setAdmissDate(node.getNodeValue()); + } + //出院日期时间 + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value"); + if(Func.isEmpty(node)){ + dto.setDisDate(node.getNodeValue()); + } + //入院诊断科室名称[] + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + if(Func.isEmpty(node)){ + dto.setAdmissDeptName(node.getTextContent()); + } + //出院诊断科室名称[] + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + if(Func.isEmpty(node)){ + dto.setDisDeptName(node.getTextContent()); + } + //主治医师[] + node = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name"); + if(Func.isEmpty(node)){ + dto.setAttendingName(node.getTextContent()); + } + return dto; + } +} + diff --git a/src/main/java/com/docus/server/collection/webservice/UserServerImpl.java b/src/main/java/com/docus/server/collection/webservice/impl/UserServerImpl.java similarity index 73% rename from src/main/java/com/docus/server/collection/webservice/UserServerImpl.java rename to src/main/java/com/docus/server/collection/webservice/impl/UserServerImpl.java index bfd496d..ea29186 100644 --- a/src/main/java/com/docus/server/collection/webservice/UserServerImpl.java +++ b/src/main/java/com/docus/server/collection/webservice/impl/UserServerImpl.java @@ -1,5 +1,7 @@ -package com.docus.server.collection.webservice; +package com.docus.server.collection.webservice.impl; +import com.docus.server.collection.webservice.IUserServer; +import com.docus.server.collection.dto.UserDto; import org.springframework.stereotype.Service; import javax.jws.WebService; diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index 0720f35..8a85abf 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -4,7 +4,7 @@ spring: application: name: @artifactId@ datasource: - url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_medicalrecord?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai username: docus password: docus702 driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml new file mode 100644 index 0000000..01f0423 --- /dev/null +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -0,0 +1,7 @@ + + + + +