新增骨密度

master
linjj 1 year ago
parent 43576dca0b
commit 9bedd595c3

@ -20,8 +20,10 @@
<setting name="validation-enabled" value="true" /> <setting name="validation-enabled" value="true" />
<setting name="provider-name" value="Hibernate" /> <setting name="provider-name" value="Hibernate" />
<datasource-mapping> <datasource-mapping>
<factory-entry name="Entities" />
<factory-entry name="entityManagerFactory" value="6edb82ac-2a6f-4a02-a12c-6a834b1768ab" /> <factory-entry name="entityManagerFactory" value="6edb82ac-2a6f-4a02-a12c-6a834b1768ab" />
</datasource-mapping> </datasource-mapping>
<naming-strategy-map />
</configuration> </configuration>
</facet> </facet>
</component> </component>
@ -34,24 +36,8 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <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-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-starter:2.2.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot: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; package com.ann.demo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; 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 @SpringBootApplication
@Slf4j
public class DemoApplication { 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.interfaces.HomepageDictionary;
import com.ann.demo.service.ArchiveDetailService; import com.ann.demo.service.ArchiveDetailService;
import com.ann.demo.service.ArchiveMasterService; import com.ann.demo.service.ArchiveMasterService;
import com.ann.demo.util.ExceptionPrintUtil;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -72,72 +73,86 @@ public class HomepageDictionaryImpl implements HomepageDictionary {
} }
// 必须检查类型 // 必须检查类型
sb = new StringBuffer(); sb = new StringBuffer();
String[] inspectionReportTypeArray;
List types;
String checkLisNotExits;
if (!mustCheckData.equals("")) { if (!mustCheckData.equals("")) {
String[] mustCheckDataArray = mustCheckData.split(","); inspectionReportTypeArray = mustCheckData.split(",");
List<String> types = Arrays.asList(mustCheckDataArray); types = Arrays.asList(inspectionReportTypeArray);
String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId); checkLisNotExits = this.archiveDetailService.getTypeNotExits(types, masterId);
if (typeIsExits != null ) { if (checkLisNotExits != null) {
sb.append("缺失"+typeIsExits); sb.append("缺失" + checkLisNotExits);
} }
//----------------单独处理出院记录,包含情况 2021-1-14 //----------------单独处理出院记录,包含情况 2021-1-14
//----------------如果缺失出院记录那么考虑是不是24小时病历如果是那么提示不缺失如果不是 那么考虑是不是存在die病历如果是那么提示缺失死亡记录否择提示缺失出院记录 //----------------如果缺失出院记录那么考虑是不是24小时病历如果是那么提示不缺失如果不是 那么考虑是不是存在die病历如果是那么提示缺失死亡记录否择提示缺失出院记录
List list = new ArrayList<String>(); List list = new ArrayList();
list.add("113");
list.add("11"); list.add("11");
String disResult = archiveDetailService.getTypeNotExits(list, masterId); String disResult = archiveDetailService.getTypeNotExits(list, masterId);
if (disResult != null ) { if (disResult != null ) {
//再判断是不是24小时入院 //再判断是不是24小时入院
String beHospitalized = archiveDetailService.getBeHospitalized(masterId, "9"); String beHospitalized = archiveDetailService.getBeHospitalized(masterId, "9");
if (!Objects.equal(beHospitalized, "24小时内入出院记录")) { 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")) { if (Objects.equal(archiveMaster.getDeathFlag(), "1")) {
Integer dieResult = archiveDetailService.countDetail(masterId, "17"); Integer dieResult1 = archiveDetailService.countDetail(masterId, "17");
if(dieResult == 0){ if(dieResult1 == 0){
sb.append(",死亡记录"); sb.append(",死亡记录");
} }
}else{ }else{
sb.append("" + disResult); sb.append("" + disResult1);
} }
} }
} }
//----------------单独处理出院记录 //单独检验骨密度
List list2 = new ArrayList();
//----------------单独处理重症单中“首次护理记录单” list1.add("130");
List list2 = new ArrayList<String>(); String disResult2 = archiveDetailService.getTypeNotExits(list2, masterId);
list2.add("7"); if (disResult2==null){
String huliResult = archiveDetailService.getTypeNotExits(list2, masterId); int dicomNum = archiveDetailService.getDicomNum(masterId);
if (huliResult != null){ if (dicomNum>0){
//缺失首次护理记录单来源V6护士 if (sb.length()==0){
//再判断重症单中是否有首次护理记录单 sb.append("缺失骨密度检查报告");
Integer result = archiveDetailService.countFirstNursingRecord(masterId, "121"); }else {
if (result==0){ sb.append(""+"缺失骨密度检查报告");
//重症单中没有首次护理记录单 }
sb.append("缺失首次护理记录单");
} }
} }
} }
// 检验申请单 // 检验申请单
if (!inspectionReportType.equals("")) { if (!inspectionReportType.equals("")) {
String[] inspectionReportTypeArray = inspectionReportType.split(","); inspectionReportTypeArray = inspectionReportType.split(",");
List<String> types = Arrays.asList(inspectionReportTypeArray); types = Arrays.asList(inspectionReportTypeArray);
String checkLisNotExits = archiveDetailService.getInspectionReportNotExits1(types, masterId); checkLisNotExits = this.archiveDetailService.getInspectionReportNotExits1(types, masterId);
if (checkLisNotExits != null ) { if (checkLisNotExits != null) {
if (sb.length() != 0) { if (sb.length() != 0) {
sb.append(";"); sb.append(";");
} }
sb.append(checkLisNotExits); sb.append(checkLisNotExits);
} }
} }
//最后
if (sb.length() == 0) { if (sb.length() == 0) {
sb.append("完整"); sb.append("完整");
}else{ }else{
sb.append("。如开的医嘱有对应的单子,可备注给主任。"); sb.append("。如开的医嘱有对应的单子,可备注给主任。");
} }
}catch (Exception e){ }catch (Exception e){
sb.setLength(0); sb.setLength(0);
sb.append("服务器正忙"); sb.append("服务器正忙");
ExceptionPrintUtil.printException(e);
logger.error("出错了:",e.getMessage()); logger.error("出错了:",e.getMessage());
} }
return sb + ""; return sb + "";

@ -27,6 +27,13 @@ public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, St
String getTypeNotExits(List<String> type, String masterId); 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( " + @Query(value = " SELECT stuff( " +
" ( select '' +name+'缺失' + cast(COUNT(report_type) as varchar)+'份' from exam_apply e " + " ( 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 ) " + " 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' " + " 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 " + " and exists " +
" (select 1 from archive_master m where m.inp_no = e.inp_no and m.visit_id = e.visit_id " + " (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) " 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); 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 '%首次护理记录%'") @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); 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 getTypeNotExits(List<String> type, String masterId);
public String getTypeToVoid(String masterId);
public String getCheckReportNotExits(List<String> type,String masterId); public String getCheckReportNotExits(List<String> type,String masterId);
// public String getInspectionReportNotExits(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 countDetail(String masterId, String s);
Integer countFirstNursingRecord(String masterId, String s); Integer countFirstNursingRecord(String masterId, String s);
int getDicomNum(String masterId);
} }

@ -29,79 +29,67 @@ public class ArchiveDetailServiceImpl implements ArchiveDetailService {
} }
@Override @Override
public String getCheckReportNotExits(List<String> type,String masterId) { public String getTypeToVoid(String masterId) {
return archiveDetailRepository.getCheckReportNotExits( type,masterId); return archiveDetailRepository.getTypeToVoid(masterId);
} }
@Override @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; String result = null;
// 1、查出所有的检验申请单 // 1、查出所有的检验申请单
List<Map<Object, Object>> examAllTempList = archiveDetailRepository.getAllInspectionApply(type, masterId); List<Map<Object, Object>> examAllTempList = archiveDetailRepository.getAllInspectionApply(type, masterId);
if (examAllTempList == null || examAllTempList.isEmpty()){ if (examAllTempList == null || examAllTempList.isEmpty()) {
return null; return null;
} }
//转成对应的集合 //转成对应的集合
List<ExamApplyDto> examAllList = new ArrayList<ExamApplyDto>(); List<ExamApplyDto> examAllList = new ArrayList<ExamApplyDto>();
for (Map<Object, Object> map: examAllTempList){ for (Map<Object, Object> map : examAllTempList) {
ExamApplyDto examApplyDto = MapObjUtil.map2Object(map,ExamApplyDto.class); ExamApplyDto examApplyDto = MapObjUtil.map2Object(map, ExamApplyDto.class);
examAllList.add(examApplyDto); examAllList.add(examApplyDto);
} }
// 2、查出所有的detail // 2、查出所有的detail
List<String> applyIdTempList = archiveDetailRepository.getInspectionApply(type, masterId); List<String> applyIdTempList = archiveDetailRepository.getInspectionApply(type, masterId);
// 3、进行匹配 // 3、进行匹配
List<ExamApplyDto> resultList = new ArrayList<ExamApplyDto>(examAllList); List<ExamApplyDto> resultList = new ArrayList<ExamApplyDto>(examAllList);
for (ExamApplyDto examApplyDto:examAllList) { for (ExamApplyDto examApplyDto : examAllList) {
for (String applyId: applyIdTempList){ for (String applyId : applyIdTempList) {
Pattern pattern = Pattern.compile(examApplyDto.getApplyId()); if (!applyId.isEmpty()) {
Matcher matcher = pattern.matcher(applyId); Pattern pattern = Pattern.compile(examApplyDto.getApplyId());
if(matcher.find()){ Matcher matcher = pattern.matcher(applyId);
resultList.remove(examApplyDto); if (matcher.find()) {
resultList.remove(examApplyDto);
}
} }
} }
} }
StringBuffer sb=new StringBuffer(); StringBuffer sb = new StringBuffer();
for (ExamApplyDto examApplyDto: for (ExamApplyDto examApplyDto :
resultList) { resultList) {
String authorReportTime = examApplyDto.getAuthorReportTime(); String authorReportTime = examApplyDto.getAuthorReportTime();
if(authorReportTime != null && authorReportTime.lastIndexOf(".") != -1){ if (authorReportTime != null && authorReportTime.lastIndexOf(".") != -1) {
authorReportTime = authorReportTime.substring(0,authorReportTime.lastIndexOf(".")); authorReportTime = authorReportTime.substring(0, authorReportTime.lastIndexOf("."));
} }
sb.append("缺失"+examApplyDto.getName() +"("+authorReportTime+")"); sb.append("缺失" + examApplyDto.getName() + "(" + authorReportTime + ")");
} }
// // 4、统计集合里元素相同的名称及数量 if (sb.length() > 0) {
// Map<String, Integer> map = new HashMap<String, Integer>(); result = sb.substring(0, sb.length() - 1);
// 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);
} }
return result; return result;
} }
@Override @Override
public String getBeHospitalized(String masterid,String assortId) { public String getBeHospitalized(String masterid, String assortId) {
return archiveDetailRepository.getResultByMasterIDAndAssortIDAndFlag(masterid,assortId,"0"); return archiveDetailRepository.getResultByMasterIDAndAssortIDAndFlag(masterid, assortId, "0");
} }
@Override @Override
public Integer countDetail(String masterId, String s) { public Integer countDetail(String masterId, String s) {
return archiveDetailRepository.countDetail(masterId,s,"0"); return archiveDetailRepository.countDetail(masterId, s, "0");
} }
// @Override // @Override
@ -111,17 +99,19 @@ public class ArchiveDetailServiceImpl implements ArchiveDetailService {
@Override @Override
public String getCheckReportNotExits1(List<String> types, String masterId) { public String getCheckReportNotExits1(List<String> types, String masterId) {
return archiveDetailRepository.getCheckReportNotExits1( types,masterId); return archiveDetailRepository.getCheckReportNotExits1(types, masterId);
} }
@Override @Override
public Integer countFirstNursingRecord(String masterId, String s) { 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); // 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 #完整性核查 必查项填类型id
#9月 增加大类的校验 #9月 增加大类的校验
#mustCheckData: 3,9,20,122,123,5,7,2 mustCheckData: 3,9,20,122,123,5,7,2
mustCheckData: 3,9,20,122,123,5,2
#2020-9-23 1、新增60、110 核医学以及其他报告 2、将检查检验校验合并因超声会有合并报告 #2020-9-23 1、新增60、110 核医学以及其他报告 2、将检查检验校验合并因超声会有合并报告
inspectionReportType: 54,59,52,57,60,110,10 inspectionReportType: 54,59,52,57,60,110,10
checkReportType: 54,59,52,57 checkReportType: 54,59,52,57

Loading…
Cancel
Save