新增骨密度

master
linjj 1 year ago
parent 43576dca0b
commit 9bedd595c3

@ -20,8 +20,10 @@
<setting name="validation-enabled" value="true" />
<setting name="provider-name" value="Hibernate" />
<datasource-mapping>
<factory-entry name="Entities" />
<factory-entry name="entityManagerFactory" value="6edb82ac-2a6f-4a02-a12c-6a834b1768ab" />
</datasource-mapping>
<naming-strategy-map />
</configuration>
</facet>
</component>
@ -34,24 +36,8 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.38" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:2.1" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.20" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.1.RELEASE" level="project" />

@ -1,13 +1,43 @@
package com.ann.demo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.util.StringUtils;
import java.net.InetAddress;
@SpringBootApplication
@Slf4j
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext application = SpringApplication.run(DemoApplication.class, args);
Environment env = application.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String property = env.getProperty("server.servlet.context-path");
String path = property == null ? "" : property;
System.out.println(
"\n\t" +
"----------------------------------------------------------\n\t" +
"Application Sailrui-Boot is running! Access URLs:\n\t" +
"Local: \t\thttp://localhost:" + port + path + "/\n\t" +
"External: \thttp://" + ip + ":" + port + path + "/\n\t" +
"------------------------------------------------------------");
}
}
}

@ -90,7 +90,7 @@ public class ArchiveMaster {
/**
*
*/
private Date checkedDoctor;
private String checkedDoctor;
/**

@ -5,6 +5,7 @@ import com.ann.demo.entity.filing.ArchiveMaster;
import com.ann.demo.interfaces.HomepageDictionary;
import com.ann.demo.service.ArchiveDetailService;
import com.ann.demo.service.ArchiveMasterService;
import com.ann.demo.util.ExceptionPrintUtil;
import com.google.common.base.Objects;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -72,72 +73,86 @@ public class HomepageDictionaryImpl implements HomepageDictionary {
}
// 必须检查类型
sb = new StringBuffer();
String[] inspectionReportTypeArray;
List types;
String checkLisNotExits;
if (!mustCheckData.equals("")) {
String[] mustCheckDataArray = mustCheckData.split(",");
List<String> types = Arrays.asList(mustCheckDataArray);
String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
if (typeIsExits != null ) {
sb.append("缺失"+typeIsExits);
inspectionReportTypeArray = mustCheckData.split(",");
types = Arrays.asList(inspectionReportTypeArray);
checkLisNotExits = this.archiveDetailService.getTypeNotExits(types, masterId);
if (checkLisNotExits != null) {
sb.append("缺失" + checkLisNotExits);
}
//----------------单独处理出院记录,包含情况 2021-1-14
//----------------如果缺失出院记录那么考虑是不是24小时病历如果是那么提示不缺失如果不是 那么考虑是不是存在die病历如果是那么提示缺失死亡记录否择提示缺失出院记录
List list = new ArrayList<String>();
list.add("113");
List list = new ArrayList();
list.add("11");
String disResult = archiveDetailService.getTypeNotExits(list, masterId);
if (disResult != null ) {
//再判断是不是24小时入院
String beHospitalized = archiveDetailService.getBeHospitalized(masterId, "9");
if (!Objects.equal(beHospitalized, "24小时内入出院记录")) {
sb.append("" + disResult);
}
}
List list1 = new ArrayList();
list1.add("113");
String disResult1 = archiveDetailService.getTypeNotExits(list1, masterId);
if (disResult1 != null ) {
//再判断是不是24小时入院
String beHospitalized1 = archiveDetailService.getBeHospitalized(masterId, "9");
if (!Objects.equal(beHospitalized1, "24小时内入出院记录")) {
if (Objects.equal(archiveMaster.getDeathFlag(), "1")) {
Integer dieResult = archiveDetailService.countDetail(masterId, "17");
if(dieResult == 0){
Integer dieResult1 = archiveDetailService.countDetail(masterId, "17");
if(dieResult1 == 0){
sb.append(",死亡记录");
}
}else{
sb.append("" + disResult);
sb.append("" + disResult1);
}
}
}
//----------------单独处理出院记录
//----------------单独处理重症单中“首次护理记录单”
List list2 = new ArrayList<String>();
list2.add("7");
String huliResult = archiveDetailService.getTypeNotExits(list2, masterId);
if (huliResult != null){
//缺失首次护理记录单来源V6护士
//再判断重症单中是否有首次护理记录单
Integer result = archiveDetailService.countFirstNursingRecord(masterId, "121");
if (result==0){
//重症单中没有首次护理记录单
sb.append("缺失首次护理记录单");
//单独检验骨密度
List list2 = new ArrayList();
list1.add("130");
String disResult2 = archiveDetailService.getTypeNotExits(list2, masterId);
if (disResult2==null){
int dicomNum = archiveDetailService.getDicomNum(masterId);
if (dicomNum>0){
if (sb.length()==0){
sb.append("缺失骨密度检查报告");
}else {
sb.append(""+"缺失骨密度检查报告");
}
}
}
}
// 检验申请单
if (!inspectionReportType.equals("")) {
String[] inspectionReportTypeArray = inspectionReportType.split(",");
List<String> types = Arrays.asList(inspectionReportTypeArray);
String checkLisNotExits = archiveDetailService.getInspectionReportNotExits1(types, masterId);
if (checkLisNotExits != null ) {
inspectionReportTypeArray = inspectionReportType.split(",");
types = Arrays.asList(inspectionReportTypeArray);
checkLisNotExits = this.archiveDetailService.getInspectionReportNotExits1(types, masterId);
if (checkLisNotExits != null) {
if (sb.length() != 0) {
sb.append(";");
}
sb.append(checkLisNotExits);
}
}
//最后
if (sb.length() == 0) {
sb.append("完整");
}else{
sb.append("。如开的医嘱有对应的单子,可备注给主任。");
}
}catch (Exception e){
sb.setLength(0);
sb.append("服务器正忙");
ExceptionPrintUtil.printException(e);
logger.error("出错了:",e.getMessage());
}
return sb + "";

@ -27,6 +27,13 @@ public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, St
String getTypeNotExits(List<String> type, String masterId);
@Query(value = "select Title from archive_detail where MasterID = ?1 and flag !=0", nativeQuery = true)
String getTypeToVoid(String masterId);
@Query(value = " SELECT stuff( " +
" ( select '' +name+'缺失' + cast(COUNT(report_type) as varchar)+'份' from exam_apply e " +
" where not exists (select 1 from archive_detail a where source <> '后台' and a.apply_id = e.apply_id and a.assortid in ?1 and a.masterId = ?2 ) " +
@ -99,7 +106,7 @@ public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, St
" where e.report_type in ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
" and exists " +
" (select 1 from archive_master m where m.inp_no = e.inp_no and m.visit_id = e.visit_id " +
" and m.patient_id = e.patient_id " +
" and m.patient_id = e.patient_id AND e.name !='骨密度测定'" +
" and m.ID = ?2) order by e.report_type,e.name,e.author_report_time ",nativeQuery = true)
List<Map<Object, Object>> getAllInspectionApply(List<String> type, String masterId);
@ -118,5 +125,9 @@ public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, St
*/
@Query("select count(o.title) from ArchiveDetail o where o.masterID = ?1 and o.assortID = ?2 and o.flag = ?3 and o.title like '%首次护理记录%'")
public Integer countFirstNursingRecord(String masterId,String assortId,String flag);
@Query(value ="SELECT count(id) FROM archive_other_ext where statusFlag!=3 AND MID= ?1 AND sysFlag=20", nativeQuery = true)
public int getDicomNum(String masterId);
}

@ -14,6 +14,8 @@ public interface ArchiveDetailService {
public String getTypeNotExits(List<String> type, String masterId);
public String getTypeToVoid(String masterId);
public String getCheckReportNotExits(List<String> type,String masterId);
// public String getInspectionReportNotExits(List<String> type,String masterId);
@ -27,4 +29,6 @@ public interface ArchiveDetailService {
Integer countDetail(String masterId, String s);
Integer countFirstNursingRecord(String masterId, String s);
int getDicomNum(String masterId);
}

@ -29,79 +29,67 @@ public class ArchiveDetailServiceImpl implements ArchiveDetailService {
}
@Override
public String getCheckReportNotExits(List<String> type,String masterId) {
return archiveDetailRepository.getCheckReportNotExits( type,masterId);
public String getTypeToVoid(String masterId) {
return archiveDetailRepository.getTypeToVoid(masterId);
}
@Override
public String getInspectionReportNotExits1(List<String> type,String masterId) {
public String getCheckReportNotExits(List<String> type, String masterId) {
return archiveDetailRepository.getCheckReportNotExits(type, masterId);
}
@Override
public String getInspectionReportNotExits1(List<String> type, String masterId) {
String result = null;
// 1、查出所有的检验申请单
List<Map<Object, Object>> examAllTempList = archiveDetailRepository.getAllInspectionApply(type, masterId);
if (examAllTempList == null || examAllTempList.isEmpty()){
if (examAllTempList == null || examAllTempList.isEmpty()) {
return null;
}
//转成对应的集合
List<ExamApplyDto> examAllList = new ArrayList<ExamApplyDto>();
for (Map<Object, Object> map: examAllTempList){
ExamApplyDto examApplyDto = MapObjUtil.map2Object(map,ExamApplyDto.class);
for (Map<Object, Object> map : examAllTempList) {
ExamApplyDto examApplyDto = MapObjUtil.map2Object(map, ExamApplyDto.class);
examAllList.add(examApplyDto);
}
// 2、查出所有的detail
List<String> applyIdTempList = archiveDetailRepository.getInspectionApply(type, masterId);
// 3、进行匹配
List<ExamApplyDto> resultList = new ArrayList<ExamApplyDto>(examAllList);
for (ExamApplyDto examApplyDto:examAllList) {
for (String applyId: applyIdTempList){
Pattern pattern = Pattern.compile(examApplyDto.getApplyId());
Matcher matcher = pattern.matcher(applyId);
if(matcher.find()){
resultList.remove(examApplyDto);
for (ExamApplyDto examApplyDto : examAllList) {
for (String applyId : applyIdTempList) {
if (!applyId.isEmpty()) {
Pattern pattern = Pattern.compile(examApplyDto.getApplyId());
Matcher matcher = pattern.matcher(applyId);
if (matcher.find()) {
resultList.remove(examApplyDto);
}
}
}
}
StringBuffer sb=new StringBuffer();
for (ExamApplyDto examApplyDto:
resultList) {
StringBuffer sb = new StringBuffer();
for (ExamApplyDto examApplyDto :
resultList) {
String authorReportTime = examApplyDto.getAuthorReportTime();
if(authorReportTime != null && authorReportTime.lastIndexOf(".") != -1){
authorReportTime = authorReportTime.substring(0,authorReportTime.lastIndexOf("."));
if (authorReportTime != null && authorReportTime.lastIndexOf(".") != -1) {
authorReportTime = authorReportTime.substring(0, authorReportTime.lastIndexOf("."));
}
sb.append("缺失"+examApplyDto.getName() +"("+authorReportTime+")");
sb.append("缺失" + examApplyDto.getName() + "(" + authorReportTime + ")");
}
// // 4、统计集合里元素相同的名称及数量
// Map<String, Integer> map = new HashMap<String, Integer>();
// for(ExamApplyDto examApplyDto:
// resultList){
// String name = examApplyDto.getName() ==null ? (Objects.equals(examApplyDto.getReportType(),"10") ? "检验报告" : "检查报告"):examApplyDto.getName();
// if(map.containsKey(name)){
// map.put(name, map.get(name).intValue() + 1);
// }else{
// map.put(name, new Integer(1));
// }
// }
// 5、开始拼装
// Iterator<String> keys = map.keySet().iterator();
// while(keys.hasNext()){
// String key = keys.next();
// int i = map.get(key).intValue();
// sb.append(key + "缺失" + map.get(key).intValue() + "份,");
// }
if(sb.length() > 0){
result = sb.substring(0,sb.length()-1);
if (sb.length() > 0) {
result = sb.substring(0, sb.length() - 1);
}
return result;
}
@Override
public String getBeHospitalized(String masterid,String assortId) {
return archiveDetailRepository.getResultByMasterIDAndAssortIDAndFlag(masterid,assortId,"0");
public String getBeHospitalized(String masterid, String assortId) {
return archiveDetailRepository.getResultByMasterIDAndAssortIDAndFlag(masterid, assortId, "0");
}
@Override
public Integer countDetail(String masterId, String s) {
return archiveDetailRepository.countDetail(masterId,s,"0");
return archiveDetailRepository.countDetail(masterId, s, "0");
}
// @Override
@ -111,17 +99,19 @@ public class ArchiveDetailServiceImpl implements ArchiveDetailService {
@Override
public String getCheckReportNotExits1(List<String> types, String masterId) {
return archiveDetailRepository.getCheckReportNotExits1( types,masterId);
return archiveDetailRepository.getCheckReportNotExits1(types, masterId);
}
@Override
public Integer countFirstNursingRecord(String masterId, String s) {
return archiveDetailRepository.countFirstNursingRecord(masterId,s,"0");
return archiveDetailRepository.countFirstNursingRecord(masterId, s, "0");
}
}
@Override
public int getDicomNum(String masterId) {
return archiveDetailRepository.getDicomNum(masterId);
}
}
// List<Map<Object, Object>> examAndDetailTempList = archiveDetailRepository.getInspectionApply(type, masterId);

@ -0,0 +1,40 @@
package com.ann.demo.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2020/8/4 14:18
* @UpdateUser:
* @UpdateDate: 2020/8/4 14:18
* @UpdateRemark:
* @Version: 1.0
*/
public class ExceptionPrintUtil {
private static Logger log = LogManager.getLogger(ExceptionPrintUtil.class);
public static void printException(Exception e){
//方法名
ByteArrayOutputStream baos = new ByteArrayOutputStream();
e.printStackTrace(new PrintStream(baos));
String exception = baos.toString();
log.error(exception);
try {
baos.flush();
baos.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}

@ -0,0 +1,2 @@
#server.port= 8091
#server.address=localhost

@ -39,8 +39,7 @@ spring:
#完整性核查 必查项填类型id
#9月 增加大类的校验
#mustCheckData: 3,9,20,122,123,5,7,2
mustCheckData: 3,9,20,122,123,5,2
mustCheckData: 3,9,20,122,123,5,7,2
#2020-9-23 1、新增60、110 核医学以及其他报告 2、将检查检验校验合并因超声会有合并报告
inspectionReportType: 54,59,52,57,60,110,10
checkReportType: 54,59,52,57

Loading…
Cancel
Save