1、删除没用代码;

2、新增其他检查申请单;
master
leijx 5 years ago
parent 492a6e7871
commit af6edd3a3d

@ -76,6 +76,19 @@ public class AliasName {
// 病案首页
public static final String MEDICAL_RECORD_HOMEPAGE = "3";
// 20200605新增申请单
// 核医学
public static final String PET_CT_REPORT = "125";
//肌电图
public static final String ELECTROMYOGRAPHY = "126";
//临床试验
public static final String CLINICAL_TRIALS = "127";
//内镜
public static final String ENDOSCOPIC_REPORT = "128";
//脑彩超
public static final String BRAIN_COLOR_ULTRASOUND = "129";
//脑电图
public static final String BRAIN_ELECTRIC_REPORT = "130";
static {
DOCTOR_MAP = new HashMap<String, String>();

@ -22,6 +22,6 @@ public interface ExamApplyRepository extends JpaRepository<ExamApply, String> {
@Query("select count(o) from ExamApply o where o.applyId = ?1 and o.isValid = 0")
public Integer countExamApply(String applyId);
public ExamApply findByApplyIdAndIsValidAndIsOpenHisAndIsOpenOther(String applyId,String flag,String isOpenHis,String isOpenOther);
public ExamApply findByApplyIdAndIsValidAndIsOpenHisAndIsOpenOther(String applyId,Integer isValid,String isOpenHis,String isOpenOther);
}

@ -15,12 +15,11 @@ import java.util.List;
@Repository
public interface MessageRepository extends JpaRepository<MessageLog, Integer> {
public Integer countByInputContentAndInterfaceName(String inputContent, String interfaceName);
@Query("select o from MessageLog o where o.interfaceName = 'InpSummary' ")
public List<MessageLog> findAllHaha();
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (visit_id = ?2 ) and archiveState <> '作废'")
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (visit_id = ?2 ) and archiveState <> '作废' and is_valid = 0")
public String getArchiveMasterId(String inpNo,String visitId);

@ -173,6 +173,24 @@ public class AnalysisService {
case "放射":
examApply.setReportType(AliasName.RADIATION_REPORT);
break;
case "核医学":
examApply.setReportType(AliasName.PET_CT_REPORT);
break;
case "肌电图":
examApply.setReportType(AliasName.ELECTROMYOGRAPHY);
break;
case "临床试验":
examApply.setReportType(AliasName.CLINICAL_TRIALS);
break;
case "内镜":
examApply.setReportType(AliasName.ENDOSCOPIC_REPORT);
break;
case "脑彩超":
examApply.setReportType(AliasName.BRAIN_COLOR_ULTRASOUND);
break;
case "脑电图":
examApply.setReportType(AliasName.BRAIN_ELECTRIC_REPORT);
break;
}
}
examApplyService.save(examApply);

@ -15,11 +15,6 @@ public interface MessageService {
public void save(MessageLog log);
public Integer countByInputContentAndInterfaceName(String xmlStr, String hipMessageServer);
// 2019-10-11 查询所有9月15解析成功的数据
List<MessageLog> findAllMessage();
//2020-3-20 获取患者信息id
String getArchiveMasterId(String inpNo,String visitId);

@ -23,7 +23,7 @@ public class ExamApplyServiceImpl implements ExamApplyService {
@Override
public ExamApply findExamApply(String applyId) {
return examApplyRepository.findByApplyIdAndIsValidAndIsOpenHisAndIsOpenOther(applyId,"0","E","E");
return examApplyRepository.findByApplyIdAndIsValidAndIsOpenHisAndIsOpenOther(applyId,0,"E","E");
}
@Override

@ -34,18 +34,6 @@ public class MessageServiceImpl implements MessageService {
}
}
@Override
public Integer countByInputContentAndInterfaceName(String xmlStr, String hipMessageServer) {
return messageRepository.countByInputContentAndInterfaceName(xmlStr, hipMessageServer);
}
@Override
public List<MessageLog> findAllMessage() {
List<MessageLog> allHaha = messageRepository.findAllHaha();
System.out.println(allHaha.size());
return allHaha;
}
public String getArchiveMasterId(String inpNo,String visitId) {
return messageRepository.getArchiveMasterId(inpNo, visitId);
}

@ -253,116 +253,4 @@ public class XMLUtils {
return null;
}
public static MessageDto tryGetxpathToBean(String xmlStr, Class tClass, String source) {
MessageDto messageDto = null;
Document doc = null;
Object obj = null;
try {
xmlStr = xmlStr.replaceAll("&", "&amp;");
SAXReader saxReader = new SAXReader();
saxReader.setXMLFilter(new XMLFilterImpl() {
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
String text = new String(ch, start, length);
if (length == 1) {
if ((int) ch[0] == 160) {
char[] escape = " ".toCharArray();
super.characters(escape, 0, escape.length);
return;
}
}
super.characters(ch, start, length);
}
});
doc = saxReader.read(new ByteArrayInputStream(xmlStr.getBytes("UTF-8")), "UTF-8");
if (tClass != null) {
messageDto = getInstance(source);
obj = tClass.newInstance();
} else {
// 是检查报告的接口
String str = "/ns:ClinicalDocument/ns:component/ns:structuredBody/ns:component/ns:section/ns:entry/ns:observation/ns:code[@displayName='检查报告科室']/../ns:value/text()";
//-----------------------存在一个错误 如果str找不到 就会向外抛出异常org.apache.cxf.interceptor.Fault: org/jaxen/JaxenException
XPath x = doc.createXPath(str);
x.setNamespaceURIs(map);
Node node = x.selectSingleNode(doc);
if (node != null) {
messageDto = getInstance(node.getText());
if (messageDto != null) {
obj = messageDto.getObject();
}
}
}
if (obj != null && messageDto != null) {
if (messageDto.getPropertiesPath() != null) {
// 加载配置文件
InputStream inputStream = new BufferedInputStream(new FileInputStream(new File(messageDto.getPropertiesPath())));
Properties properties = new Properties();
//加载格式化后的流
properties.load(new InputStreamReader(inputStream, DEFAULT_ENCODING));
Enumeration<?> enumeration = properties.propertyNames();
while (enumeration.hasMoreElements()) {
String key = (String) enumeration.nextElement();
String xpath = properties.getProperty(key);
XPath x = doc.createXPath(xpath);
x.setNamespaceURIs(map);
// 根据properties的value获取xml的value
String value = "";
Node node = x.selectSingleNode(doc);
if (node != null) {
value = node.getText();
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
// 判断属性是否存在
String objField = existsField(obj.getClass(), key);
if (objField != null) {
PropertyDescriptor descriptor = new PropertyDescriptor(key, obj.getClass());
if (("class java.util.Date").equals(objField)) {
if (value != null && value.length() > 0) {
Date parse = simpleDateFormat.parse(value, new ParsePosition(0));
descriptor.getWriteMethod().invoke(obj, parse);
}
} else {
descriptor.getWriteMethod().invoke(obj, value);
}
}
String messageField = existsField(messageDto.getClass(), key);
if (messageField != null) {
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(key, messageDto.getClass());
// 给messageDto赋值
if (("class java.util.Date").equals(messageField)) {
if (value != null && value.length() > 0) {
propertyDescriptor.getWriteMethod().invoke(messageDto, simpleDateFormat.parse(value, new ParsePosition(0)));
}
} else {
propertyDescriptor.getWriteMethod().invoke(messageDto, value);
}
}
}
// 将对象转成json
messageDto.setObject(JSON.toJSONString(obj));
return messageDto;
}
}
} catch (DocumentException e) {
logger.error("出错咯!错误信息:" + e);
} catch (UnsupportedEncodingException e) {
logger.error("出错咯!错误信息:" + e);
} catch (FileNotFoundException e) {
logger.error("出错咯!错误信息:" + e);
} catch (IOException e) {
logger.error("出错咯!错误信息:" + e);
} catch (IllegalAccessException e) {
logger.error("出错咯!错误信息:" + e);
} catch (IntrospectionException e) {
logger.error("出错咯!错误信息:" + e);
} catch (InvocationTargetException e) {
logger.error("出错咯!错误信息:" + e);
} catch (InstantiationException e) {
logger.error("出错咯!错误信息:" + e);
}
return null;
}
}

@ -1,26 +1,26 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/test
# url: jdbc:mysql://10.6.1.127:3306/test
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/test
# # url: jdbc:mysql://10.6.1.127:3306/test
# username: root
# password: 123456
# driver-class-name: com.mysql.jdbc.Driver
# jpa:
# database: mysql
# show-sql: false
# hibernate:
# ddl-auto: update
# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
username: sa
password: docus@702
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa:
database: mysql
database: sql_server
show-sql: false
hibernate:
ddl-auto: update
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
# username: sa
# password: docus@702
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# jpa:
# database: sql_server
# show-sql: false
# hibernate:
# dialect: org.hibernate.dialect.SQLServer2008Dialect
dialect: org.hibernate.dialect.SQLServer2008Dialect
hikari:
#是否为只读数据库
read-only: false

Loading…
Cancel
Save