增加保存骨密度扩展值

master
zengwh 2 years ago
parent 647bee7a9b
commit ab07d16a42

36
.gitignore vendored

@ -0,0 +1,36 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### log ###
/toDayLog/
/logs/

@ -1,114 +0,0 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: : " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

Binary file not shown.

@ -1 +0,0 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip

@ -0,0 +1,32 @@
package com.ann.demo.entity.interfaceEntity;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.Date;
/**
* @Description
* @Date 2019/6/17 10:27
* @Created by ljx
*/
@Data
@Table
@Entity
public class MessageExtend {
@Id
@Column(name = "masterId", nullable = false)
private String masterId;
/**
*
*/
private Integer type;
/**
*
*/
private String extendValue;
}

@ -0,0 +1,20 @@
package com.ann.demo.repository;
import com.ann.demo.entity.interfaceEntity.MessageExtend;
import com.ann.demo.entity.interfaceEntity.MessageLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @Description
* @Date 2022/05/18
* @Created by zengwenhe
*/
@Repository
public interface MessageExtendRepository extends JpaRepository<MessageExtend, Integer> {
}

@ -22,5 +22,7 @@ public interface MessageRepository extends JpaRepository<MessageLog, Integer> {
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (visit_id = ?2 ) and (patient_id = ?3) and archiveState <> '作废' and is_valid = 0")
public String getArchiveMasterId(String inpNo,String visitId,String patientId);
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (patient_id = ?2) and archiveState <> '作废' and is_valid = 0")
public String getArchiveMasterId(String inpNo,String patientId);
}

@ -10,18 +10,19 @@ import com.ann.demo.entity.filing.MessageSubordinate;
import com.ann.demo.entity.filing.WebserviceInfo;
import com.ann.demo.entity.filing.dto.MessageDto;
import com.ann.demo.entity.filing.dto.PatientMainDto;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.entity.interfaceEntity.ExamApply;
import com.ann.demo.entity.interfaceEntity.MessageLog;
import com.ann.demo.entity.interfaceEntity.UltrasonicReport;
import com.ann.demo.entity.interfaceEntity.*;
import com.ann.demo.entity.other.RunningItem;
import com.ann.demo.entity.other.ServerHelper;
import com.ann.demo.repository.ArchiveMasterRepository;
import com.ann.demo.repository.MessageExtendRepository;
import com.ann.demo.utils.XMLUtils;
import com.ann.demo.utils.XmlUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.thymeleaf.util.StringUtils;
import org.w3c.dom.Node;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
@ -51,6 +52,9 @@ public class AnalysisService {
@Autowired
ExamApplyService examApplyService;
@Autowired
MessageExtendRepository messageExtendRepository;
/**
* 2019-7-8
*
@ -85,10 +89,16 @@ public class AnalysisService {
String visitId = archiveMasterRepository.findVisitIdByTimeAndInpNo(date, messageDto.getInpNo());
messageDto.setVisitId(visitId);
}
archiveMasterId = messageService.getArchiveMasterId(messageDto.getInpNo(), messageDto.getVisitId(),messageDto.getPatientId());
if(StringUtils.isEmpty(archiveMasterId) && "119".equals(messageDto.getType())){
archiveMasterId = messageService.getArchiveMasterId(messageDto.getInpNo(),messageDto.getPatientId());
}
if(archiveMasterId != null){
if (Objects.equals(messageDto.getEntity(), ExamApply.class.getName())) { // 申请单
//设置骨密度的需要值存进extend_value字段里
if("119".equals(messageDto.getType())){
setExtendValue(message, archiveMasterId);
}
ExamApply examApply = JSON.parseObject(messageDto.getObject().toString(), ExamApply.class);
textContentTemp = changeApply(examApply,parameter);
}
@ -130,6 +140,22 @@ public class AnalysisService {
return outContent;
}
/**
*
* @param masterId
* @param message
*/
private void setExtendValue(String message,String masterId) {
XmlUtil xmlUtil = XmlUtil.of(message);
Node node = xmlUtil.getNode("/POOR_IN200901UV/controlActProcess/subject/placerGroup/component2/observationRequest/component2/observationRequest/AccessionNo/@value");
String textContent = node.getTextContent();
MessageExtend messageExtend = new MessageExtend();
messageExtend.setMasterId(masterId);
messageExtend.setType(1);
messageExtend.setExtendValue(textContent);
messageExtendRepository.save(messageExtend);
}
private String changeApply(ExamApply examApply,String interfaceName) throws Exception{
String textContent = null;

@ -18,4 +18,6 @@ public interface MessageService {
//2020-3-20 获取患者信息id
String getArchiveMasterId(String inpNo,String visitId,String patientId);
String getArchiveMasterId(String inpNo,String patientId);
}

@ -38,5 +38,8 @@ public class MessageServiceImpl implements MessageService {
return messageRepository.getArchiveMasterId(inpNo, visitId,patientId);
}
public String getArchiveMasterId(String inpNo,String patientId) {
return messageRepository.getArchiveMasterId(inpNo,patientId);
}
}

@ -0,0 +1,349 @@
package com.ann.demo.utils;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* @author
* @description: XXX
* @createTime 2023/5/18 15:51
*/
public class Xml2Map {
private static Map<String, String> parseXml2Map(String xml, Map<String, String> map) {
try {
SAXReader reader = new SAXReader();
Document doc = reader.read(new StringReader(xml));
Element root = doc.getRootElement();
String path = "";
if (map.containsKey(root.getName().trim())) {
path = map.get(root.getName().trim());
map.remove(root.getName().trim());
}
for (Iterator i = root.elementIterator(); i.hasNext();) {
Element element = (Element) i.next();
if (element.isTextOnly()) {
if (path.length() > 0) {
map.put(path + element.getName().trim(), element.getTextTrim());
} else {
map.put(element.getName().trim(), element.getTextTrim());
}
} else {
map.put(element.getName().trim(), path+ element.getName().trim() + ".");
parseXml2Map(element.asXML(), map);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
String str = "<POOR_IN200901UV\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns=\"urn:hl7-org:v3\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 ../../Schemas/POOR_IN200901UV20.xsd\">\n" +
" <id extension=\"JHIPBS303\"></id>\n" +
" <creationTime value=\"2023-05-17 10:21:55\"></creationTime>\n" +
" <interactionId root=\"\" extension=\"POOR_IN200901UV20\"></interactionId>\n" +
" <processingCode code=\"P\"></processingCode>\n" +
" <processingModeCode code=\"T\"></processingModeCode>\n" +
" <acceptAckCode code=\"NE\"></acceptAckCode>\n" +
" <receiver typeCode=\"RCV\">\n" +
" <device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
" <id>\n" +
" <item root=\"1.2.156.112698.1.1.1\" extension=\"HIS\"></item>\n" +
" </id>\n" +
" </device>\n" +
" </receiver>\n" +
" <sender typeCode=\"SND\">\n" +
" <device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
" <id>\n" +
" <item root=\"1.2.156.112698.2.1.1\" extension=\"放射\"></item>\n" +
" </id>\n" +
" </device>\n" +
" </sender>\n" +
" <controlActProcess classCode=\"CACT\" moodCode=\"EVN\">\n" +
" <code code=\"new\"></code>\n" +
" <subject typeCode=\"SUBJ\" xsi:nil=\"false\">\n" +
" <placerGroup classCode=\"GROUPER\" moodCode=\"RQO\">\n" +
" <subject>\n" +
" <patient classCode=\"PAT\">\n" +
" <id>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.5\" extension=\"02\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.6\" extension=\"000757309000\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.21\" extension=\"1659561\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.23\" extension=\"1659561\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.22\" extension=\"1\"></item>\n" +
" </id>\n" +
" <addr xsi:type=\"BAG_AD\">\n" +
" <item use=\"TMP\">\n" +
" <part type=\"BNR\" value=\"脊柱微创外科病房\" code=\"1120102\" codeSystem=\"1.2.156.112698.1.1.1.4.7\"></part>\n" +
" <part type=\"CAR\" value=\"1043\"></part>\n" +
" </item>\n" +
" </addr>\n" +
" <patientPerson classCode=\"PSN\">\n" +
" <id>\n" +
" <item extension=\"440824195812258314\" root=\"1.2.156.112698.1.1.2.1.8\"></item>\n" +
" <item extension=\"\" root=\"1.2.156.112698.1.1.2.1.4\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"杨茂青\"></part>\n" +
" </item>\n" +
" </name>\n" +
" <telecom xsi:type=\"BAG_TEL\">\n" +
" <item value=\"13413637636\"></item>\n" +
" </telecom>\n" +
" <administrativeGenderCode code=\"1\" codeSystem=\"1.2.156.112698.1.1.1.2.1\"></administrativeGenderCode>\n" +
" <birthTime value=\"19581225000000\">\n" +
" <originalText value=\"64岁\"></originalText>\n" +
" </birthTime>\n" +
" <addr xsi:type=\"BAG_AD\">\n" +
" <item use=\"H\">\n" +
" <part type=\"AL\" value=\"贸易城新城路三横二号\"></part>\n" +
" </item>\n" +
" </addr>\n" +
" <maritalStatusCode code=\"2\" codeSystem=\"1.2.156.112698.1.1.1.2.2\"></maritalStatusCode>\n" +
" <ethnicGroupCode>\n" +
" <item code=\"\" codeSystem=\"1.2.156.112698.1.1.1.2.3\"></item>\n" +
" </ethnicGroupCode>\n" +
" <asEmployee classCode=\"EMP\">\n" +
" <occupationCode code=\"90\" codeSystem=\"1.2.156.112698.1.1.1.2.5\">\n" +
" <displayName value=\"其他\"></displayName>\n" +
" </occupationCode>\n" +
" <employerOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"\"></part>\n" +
" </item>\n" +
" </name>\n" +
" <contactParty classCode=\"CON\" xsi:nil=\"true\"></contactParty>\n" +
" </employerOrganization>\n" +
" </asEmployee>\n" +
" <asCitizen>\n" +
" <politicalNation>\n" +
" <code code=\"\" codeSystem=\"1.2.156.112698.1.1.1.2.4\">\n" +
" <displayName value=\"\"></displayName>\n" +
" </code>\n" +
" </politicalNation>\n" +
" </asCitizen>\n" +
" <contactParty classCode=\"CON\">\n" +
" <telecom xsi:type=\"BAG_TEL\">\n" +
" <item use=\"MC\" value=\"\" capabilities=\"voice\"></item>\n" +
" </telecom>\n" +
" <contactPerson>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item use=\"IDE\">\n" +
" <part value=\"\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </contactPerson>\n" +
" </contactParty>\n" +
" <text value=\"双上肢麻痛1月余\"></text>\n" +
" </patientPerson>\n" +
" <providerOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\">\n" +
" <id>\n" +
" <item extension=\"1120102\" root=\"1.2.156.112698.1.1.1.4.1\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"脊柱微创外科病房\"></part>\n" +
" </item>\n" +
" </name>\n" +
" <asOrganizationPartOf classCode=\"PART\">\n" +
" <wholeOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <id>\n" +
" <item extension=\"12440000455858169P\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"广东医科大学附属医院\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </wholeOrganization>\n" +
" </asOrganizationPartOf>\n" +
" </providerOrganization>\n" +
" </patient>\n" +
" </subject>\n" +
" <author>\n" +
" <time value=\"20230516171700\"></time>\n" +
" <assignedEntity classCode=\"ASSIGNED\">\n" +
" <id>\n" +
" <item extension=\"06616\" root=\"1.2.156.112698.1.1.1.4.2\"></item>\n" +
" </id>\n" +
" <assignedPerson determinerCode=\"INSTANCE\" classCode=\"PSN\">\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"梁振\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </assignedPerson>\n" +
" <representedOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <id>\n" +
" <item extension=\"1120102\" root=\"1.2.156.112698.1.1.1.4.10\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"脊柱微创外科病房\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </representedOrganization>\n" +
" </assignedEntity>\n" +
" </author>\n" +
" <verifier typeCode=\"VRF\">\n" +
" <time value=\"2023-05-17 10:21:55\"></time>\n" +
" <assignedEntity classCode=\"ASSIGNED\">\n" +
" <id>\n" +
" <item extension=\"\" root=\"1.2.156.112698.1.1.1.4.2\"></item>\n" +
" </id>\n" +
" <assignedPerson determinerCode=\"INSTANCE\" classCode=\"PSN\">\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"吴丽梅\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </assignedPerson>\n" +
" </assignedEntity>\n" +
" </verifier>\n" +
" <component2>\n" +
" <observationRequest classCode=\"OBS\" moodCode=\"RQO\">\n" +
" <id>\n" +
" <item extension=\"118300424\"></item>\n" +
" </id>\n" +
" <code code=\"2\" codeSystem=\"1.2.156.112698.1.1.1.4.5\">\n" +
" <displayName value=\"检查类\"></displayName>\n" +
" </code>\n" +
" <text value=\"\"></text>\n" +
" <statusCode code=\"E\"></statusCode>\n" +
" <effectiveTime xsi:type=\"IVL_TS\">\n" +
" <any value=\"20230516171700\"></any>\n" +
" </effectiveTime>\n" +
" <addr xsi:type=\"BAG_AD\">\n" +
" <item use=\"H\">\n" +
" <part type=\"AL\" value=\"12楼\"></part>\n" +
" </item>\n" +
" </addr>\n" +
" <specimen typeCode=\"SPC\">\n" +
" <specimen classCode=\"SPEC\">\n" +
" <id extension=\"\"></id>\n" +
" <code code=\"\" codeSystem=\"1.2.156.112698.1.1.1.3.5\"></code>\n" +
" <subjectOf1 typeCode=\"SBJ\">\n" +
" <specimenCollectionProcess moodCode=\"EVN\" classCode=\"SPECCOLLECT\">\n" +
" <code></code>\n" +
" <text value=\"\"></text>\n" +
" </specimenCollectionProcess>\n" +
" </subjectOf1>\n" +
" </specimen>\n" +
" </specimen>\n" +
" <location typeCode=\"LOC\">\n" +
" <time>\n" +
" <any value=\"\"></any>\n" +
" </time>\n" +
" <serviceDeliveryLocation classCode=\"SDLOC\">\n" +
" <serviceProviderOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <id>\n" +
" <item extension=\"1120101\" root=\"1.2.156.112698.1.1.1.4.1\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"关节外科(运动医学中心)病房\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </serviceProviderOrganization>\n" +
" </serviceDeliveryLocation>\n" +
" </location>\n" +
" <component2>\n" +
" <observationRequest classCode=\"OBS\">\n" +
" <id>\n" +
" <item extension=\"118300424\"></item>\n" +
" </id>\n" +
" <code code=\"26627\" codeSystem=\"1.2.156.112698.1.1.1.4.11\">\n" +
" <displayName value=\"骨密度测定\"></displayName>\n" +
" </code>\n" +
" <text value=\"\"></text>\n" +
" <statusCode value=\"0\"></statusCode>\n" +
" <effectiveTime xsi:type=\"NO\" validTimeLow=\"\" validTimeHigh=\"\">\n" +
" <code code=\"ONCE\" codeSystem=\"1.2.156.112698.1.1.1.4.44\">\n" +
" <displayName value=\"ONCE\"></displayName>\n" +
" </code>\n" +
" </effectiveTime>\n" +
" <methodCode>\n" +
" <item code=\"26627\" codeSystem=\"1.2.156.112698.1.1.1.4.41\">\n" +
" <displayName value=\"骨密度测定\"></displayName>\n" +
" </item>\n" +
" </methodCode>\n" +
" <targetSiteCode>\n" +
" <item code=\"\" codeSystem=\"1.2.156.112698.1.1.1.4.8\">\n" +
" <displayName value=\"\"></displayName>\n" +
" </item>\n" +
" </targetSiteCode>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0102\" codeSystem=\"1.2.156.112698.1.1.1.4.15\">\n" +
" <displayName value=\"收费状态标识\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"ST\" value=\"1\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0103\" codeSystem=\"1.2.156.112698.1.1.1.4.15\">\n" +
" <displayName value=\"费用金额\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"ST\" value=\"192.5\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0104\" codeSystem=\"1.2.156.112698.1.1.1.4.16\">\n" +
" <displayName value=\"病理检验标志\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"BL01\" value=\"0\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0105\" codeSystem=\"1.2.156.112698.1.1.1.4.17\">\n" +
" <displayName value=\"送检标本\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"BL02\" value=\"0\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <ReceiptNo value=\"\"></ReceiptNo>\n" +
" <AccessionNo value=\"OT20230517008\"></AccessionNo>\n" +
" </observationRequest>\n" +
" </component2>\n" +
" <subjectOf6 contextConductionInd=\"false\" xsi:nil=\"false\">\n" +
" <seperatableInd value=\"false\"></seperatableInd>\n" +
" <annotation>\n" +
" <text value=\"\"></text>\n" +
" <statusCode code=\"completed\"></statusCode>\n" +
" <author>\n" +
" <assignedEntity classCode=\"ASSIGNED\" value=\"确认诊断\"></assignedEntity>\n" +
" </author>\n" +
" </annotation>\n" +
" </subjectOf6>\n" +
" <AccessionNo value=\"OT20230517008\"></AccessionNo>\n" +
" </observationRequest>\n" +
" </component2>\n" +
" </placerGroup>\n" +
" </subject>\n" +
" </controlActProcess>\n" +
"</POOR_IN200901UV>";
map = parseXml2Map(str, map);
System.out.println(map.toString());
String key = "controlActProcess.subject.placerGroup.component2.observationRequest.component2.observationRequest.AccessionNo";
for(Map.Entry<String,String> map1:map.entrySet()){
System.out.println(map1.getKey());
}
String s = map.get(key);
System.out.println(s);
}
}

@ -0,0 +1,602 @@
/*
* 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.ann.demo.utils;
import org.springframework.lang.Nullable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
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;
/**
* xpathxml
*
* <pre>
*
* http://www.w3school.com.cn/xpath/index.asp
* </pre>
*
* @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) {
e.printStackTrace();
return null;
}
}
/**
*
*
* @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) {
e.printStackTrace();
return null;
}
}
/**
* 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<String, String> toMap() {
Element root = doc.getDocumentElement();
Map<String, String> 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();
}
public static void main(String[] args) {
XmlUtil a=XmlUtil.of("<POOR_IN200901UV\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns=\"urn:hl7-org:v3\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 ../../Schemas/POOR_IN200901UV20.xsd\">\n" +
" <id extension=\"JHIPBS303\"></id>\n" +
" <creationTime value=\"2023-05-17 10:21:55\"></creationTime>\n" +
" <interactionId root=\"\" extension=\"POOR_IN200901UV20\"></interactionId>\n" +
" <processingCode code=\"P\"></processingCode>\n" +
" <processingModeCode code=\"T\"></processingModeCode>\n" +
" <acceptAckCode code=\"NE\"></acceptAckCode>\n" +
" <receiver typeCode=\"RCV\">\n" +
" <device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
" <id>\n" +
" <item root=\"1.2.156.112698.1.1.1\" extension=\"HIS\"></item>\n" +
" </id>\n" +
" </device>\n" +
" </receiver>\n" +
" <sender typeCode=\"SND\">\n" +
" <device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
" <id>\n" +
" <item root=\"1.2.156.112698.2.1.1\" extension=\"放射\"></item>\n" +
" </id>\n" +
" </device>\n" +
" </sender>\n" +
" <controlActProcess classCode=\"CACT\" moodCode=\"EVN\">\n" +
" <code code=\"new\"></code>\n" +
" <subject typeCode=\"SUBJ\" xsi:nil=\"false\">\n" +
" <placerGroup classCode=\"GROUPER\" moodCode=\"RQO\">\n" +
" <subject>\n" +
" <patient classCode=\"PAT\">\n" +
" <id>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.5\" extension=\"02\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.6\" extension=\"000757309000\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.21\" extension=\"1659561\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.23\" extension=\"1659561\"></item>\n" +
" <item root=\"1.2.156.112698.1.1.2.1.22\" extension=\"1\"></item>\n" +
" </id>\n" +
" <addr xsi:type=\"BAG_AD\">\n" +
" <item use=\"TMP\">\n" +
" <part type=\"BNR\" value=\"脊柱微创外科病房\" code=\"1120102\" codeSystem=\"1.2.156.112698.1.1.1.4.7\"></part>\n" +
" <part type=\"CAR\" value=\"1043\"></part>\n" +
" </item>\n" +
" </addr>\n" +
" <patientPerson classCode=\"PSN\">\n" +
" <id>\n" +
" <item extension=\"440824195812258314\" root=\"1.2.156.112698.1.1.2.1.8\"></item>\n" +
" <item extension=\"\" root=\"1.2.156.112698.1.1.2.1.4\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"杨茂青\"></part>\n" +
" </item>\n" +
" </name>\n" +
" <telecom xsi:type=\"BAG_TEL\">\n" +
" <item value=\"13413637636\"></item>\n" +
" </telecom>\n" +
" <administrativeGenderCode code=\"1\" codeSystem=\"1.2.156.112698.1.1.1.2.1\"></administrativeGenderCode>\n" +
" <birthTime value=\"19581225000000\">\n" +
" <originalText value=\"64岁\"></originalText>\n" +
" </birthTime>\n" +
" <addr xsi:type=\"BAG_AD\">\n" +
" <item use=\"H\">\n" +
" <part type=\"AL\" value=\"贸易城新城路三横二号\"></part>\n" +
" </item>\n" +
" </addr>\n" +
" <maritalStatusCode code=\"2\" codeSystem=\"1.2.156.112698.1.1.1.2.2\"></maritalStatusCode>\n" +
" <ethnicGroupCode>\n" +
" <item code=\"\" codeSystem=\"1.2.156.112698.1.1.1.2.3\"></item>\n" +
" </ethnicGroupCode>\n" +
" <asEmployee classCode=\"EMP\">\n" +
" <occupationCode code=\"90\" codeSystem=\"1.2.156.112698.1.1.1.2.5\">\n" +
" <displayName value=\"其他\"></displayName>\n" +
" </occupationCode>\n" +
" <employerOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"\"></part>\n" +
" </item>\n" +
" </name>\n" +
" <contactParty classCode=\"CON\" xsi:nil=\"true\"></contactParty>\n" +
" </employerOrganization>\n" +
" </asEmployee>\n" +
" <asCitizen>\n" +
" <politicalNation>\n" +
" <code code=\"\" codeSystem=\"1.2.156.112698.1.1.1.2.4\">\n" +
" <displayName value=\"\"></displayName>\n" +
" </code>\n" +
" </politicalNation>\n" +
" </asCitizen>\n" +
" <contactParty classCode=\"CON\">\n" +
" <telecom xsi:type=\"BAG_TEL\">\n" +
" <item use=\"MC\" value=\"\" capabilities=\"voice\"></item>\n" +
" </telecom>\n" +
" <contactPerson>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item use=\"IDE\">\n" +
" <part value=\"\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </contactPerson>\n" +
" </contactParty>\n" +
" <text value=\"双上肢麻痛1月余\"></text>\n" +
" </patientPerson>\n" +
" <providerOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\">\n" +
" <id>\n" +
" <item extension=\"1120102\" root=\"1.2.156.112698.1.1.1.4.1\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"脊柱微创外科病房\"></part>\n" +
" </item>\n" +
" </name>\n" +
" <asOrganizationPartOf classCode=\"PART\">\n" +
" <wholeOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <id>\n" +
" <item extension=\"12440000455858169P\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"广东医科大学附属医院\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </wholeOrganization>\n" +
" </asOrganizationPartOf>\n" +
" </providerOrganization>\n" +
" </patient>\n" +
" </subject>\n" +
" <author>\n" +
" <time value=\"20230516171700\"></time>\n" +
" <assignedEntity classCode=\"ASSIGNED\">\n" +
" <id>\n" +
" <item extension=\"06616\" root=\"1.2.156.112698.1.1.1.4.2\"></item>\n" +
" </id>\n" +
" <assignedPerson determinerCode=\"INSTANCE\" classCode=\"PSN\">\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"梁振\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </assignedPerson>\n" +
" <representedOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <id>\n" +
" <item extension=\"1120102\" root=\"1.2.156.112698.1.1.1.4.10\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"脊柱微创外科病房\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </representedOrganization>\n" +
" </assignedEntity>\n" +
" </author>\n" +
" <verifier typeCode=\"VRF\">\n" +
" <time value=\"2023-05-17 10:21:55\"></time>\n" +
" <assignedEntity classCode=\"ASSIGNED\">\n" +
" <id>\n" +
" <item extension=\"\" root=\"1.2.156.112698.1.1.1.4.2\"></item>\n" +
" </id>\n" +
" <assignedPerson determinerCode=\"INSTANCE\" classCode=\"PSN\">\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"吴丽梅\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </assignedPerson>\n" +
" </assignedEntity>\n" +
" </verifier>\n" +
" <component2>\n" +
" <observationRequest classCode=\"OBS\" moodCode=\"RQO\">\n" +
" <id>\n" +
" <item extension=\"118300424\"></item>\n" +
" </id>\n" +
" <code code=\"2\" codeSystem=\"1.2.156.112698.1.1.1.4.5\">\n" +
" <displayName value=\"检查类\"></displayName>\n" +
" </code>\n" +
" <text value=\"\"></text>\n" +
" <statusCode code=\"E\"></statusCode>\n" +
" <effectiveTime xsi:type=\"IVL_TS\">\n" +
" <any value=\"20230516171700\"></any>\n" +
" </effectiveTime>\n" +
" <addr xsi:type=\"BAG_AD\">\n" +
" <item use=\"H\">\n" +
" <part type=\"AL\" value=\"12楼\"></part>\n" +
" </item>\n" +
" </addr>\n" +
" <specimen typeCode=\"SPC\">\n" +
" <specimen classCode=\"SPEC\">\n" +
" <id extension=\"\"></id>\n" +
" <code code=\"\" codeSystem=\"1.2.156.112698.1.1.1.3.5\"></code>\n" +
" <subjectOf1 typeCode=\"SBJ\">\n" +
" <specimenCollectionProcess moodCode=\"EVN\" classCode=\"SPECCOLLECT\">\n" +
" <code></code>\n" +
" <text value=\"\"></text>\n" +
" </specimenCollectionProcess>\n" +
" </subjectOf1>\n" +
" </specimen>\n" +
" </specimen>\n" +
" <location typeCode=\"LOC\">\n" +
" <time>\n" +
" <any value=\"\"></any>\n" +
" </time>\n" +
" <serviceDeliveryLocation classCode=\"SDLOC\">\n" +
" <serviceProviderOrganization determinerCode=\"INSTANCE\" classCode=\"ORG\">\n" +
" <id>\n" +
" <item extension=\"1120101\" root=\"1.2.156.112698.1.1.1.4.1\"></item>\n" +
" </id>\n" +
" <name xsi:type=\"BAG_EN\">\n" +
" <item>\n" +
" <part value=\"关节外科(运动医学中心)病房\"></part>\n" +
" </item>\n" +
" </name>\n" +
" </serviceProviderOrganization>\n" +
" </serviceDeliveryLocation>\n" +
" </location>\n" +
" <component2>\n" +
" <observationRequest classCode=\"OBS\">\n" +
" <id>\n" +
" <item extension=\"118300424\"></item>\n" +
" </id>\n" +
" <code code=\"26627\" codeSystem=\"1.2.156.112698.1.1.1.4.11\">\n" +
" <displayName value=\"骨密度测定\"></displayName>\n" +
" </code>\n" +
" <text value=\"\"></text>\n" +
" <statusCode value=\"0\"></statusCode>\n" +
" <effectiveTime xsi:type=\"NO\" validTimeLow=\"\" validTimeHigh=\"\">\n" +
" <code code=\"ONCE\" codeSystem=\"1.2.156.112698.1.1.1.4.44\">\n" +
" <displayName value=\"ONCE\"></displayName>\n" +
" </code>\n" +
" </effectiveTime>\n" +
" <methodCode>\n" +
" <item code=\"26627\" codeSystem=\"1.2.156.112698.1.1.1.4.41\">\n" +
" <displayName value=\"骨密度测定\"></displayName>\n" +
" </item>\n" +
" </methodCode>\n" +
" <targetSiteCode>\n" +
" <item code=\"\" codeSystem=\"1.2.156.112698.1.1.1.4.8\">\n" +
" <displayName value=\"\"></displayName>\n" +
" </item>\n" +
" </targetSiteCode>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0102\" codeSystem=\"1.2.156.112698.1.1.1.4.15\">\n" +
" <displayName value=\"收费状态标识\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"ST\" value=\"1\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0103\" codeSystem=\"1.2.156.112698.1.1.1.4.15\">\n" +
" <displayName value=\"费用金额\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"ST\" value=\"192.5\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0104\" codeSystem=\"1.2.156.112698.1.1.1.4.16\">\n" +
" <displayName value=\"病理检验标志\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"BL01\" value=\"0\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <pertinentInformation typeCode=\"PERT\" contextConductionInd=\"false\">\n" +
" <observation classCode=\"OBS\" moodCode=\"INT\">\n" +
" <code code=\"0105\" codeSystem=\"1.2.156.112698.1.1.1.4.17\">\n" +
" <displayName value=\"送检标本\"></displayName>\n" +
" </code>\n" +
" <value xsi:type=\"BL02\" value=\"0\"></value>\n" +
" </observation>\n" +
" </pertinentInformation>\n" +
" <ReceiptNo value=\"\"></ReceiptNo>\n" +
" <AccessionNo value=\"OT20230517008\"></AccessionNo>\n" +
" </observationRequest>\n" +
" </component2>\n" +
" <subjectOf6 contextConductionInd=\"false\" xsi:nil=\"false\">\n" +
" <seperatableInd value=\"false\"></seperatableInd>\n" +
" <annotation>\n" +
" <text value=\"\"></text>\n" +
" <statusCode code=\"completed\"></statusCode>\n" +
" <author>\n" +
" <assignedEntity classCode=\"ASSIGNED\" value=\"确认诊断\"></assignedEntity>\n" +
" </author>\n" +
" </annotation>\n" +
" </subjectOf6>\n" +
" <AccessionNo value=\"OT20230517008\"></AccessionNo>\n" +
" </observationRequest>\n" +
" </component2>\n" +
" </placerGroup>\n" +
" </subject>\n" +
" </controlActProcess>\n" +
"</POOR_IN200901UV>");
XPath path = a.path;
System.out.println(path);
Node node = a.getNode("/POOR_IN200901UV/controlActProcess/subject/placerGroup/component2/observationRequest/component2/observationRequest/AccessionNo/@value");
String textContent = node.getTextContent();
String s = node.toString();
System.out.println(node);
}
}

@ -12,9 +12,9 @@ spring:
# hibernate:
# ddl-auto: update
# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
url: jdbc:sqlserver://localhost:1433;DatabaseName=zj_record_new
username: sa
password: docus@702
password: docus702
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa:
database: sql_server

Loading…
Cancel
Save