|
@@ -1,6 +1,9 @@
|
|
|
package com.diagbot.facade.data;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.dto.AnalyzeRunDTO;
|
|
|
import com.diagbot.dto.OutputInfo;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -8,11 +11,11 @@ import com.diagbot.dto.Response;
|
|
|
import com.diagbot.dto.data.AMedicalRecordDTO;
|
|
|
import com.diagbot.entity.*;
|
|
|
import com.diagbot.enums.CacheKeyEnum;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.ModeIdEnum;
|
|
|
import com.diagbot.enums.TableNameEnum;
|
|
|
-import com.diagbot.facade.BehospitalInfoFacade;
|
|
|
-import com.diagbot.facade.MedCrisisInfoFacade;
|
|
|
-import com.diagbot.facade.StrCrisisNoteFacade;
|
|
|
+import com.diagbot.facade.*;
|
|
|
+import com.diagbot.facade.str.*;
|
|
|
import com.diagbot.util.*;
|
|
|
import com.diagbot.vo.AnalyzeRunVO;
|
|
|
import com.diagbot.vo.QueryVo;
|
|
@@ -100,6 +103,10 @@ public class StructuralDataFacade {
|
|
|
private AStrInformedConsentFacade aStrInformedConsentFacade;
|
|
|
@Autowired
|
|
|
private AMedCrisisFacade aMedCrisisFacade;
|
|
|
+ @Autowired
|
|
|
+ private MedLisInfoFacade medLisInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private MedPacsInfoFacade medPacsInfoFacade;
|
|
|
|
|
|
private FJTZDBConnHarp fjtzdbConnHarp = new FJTZDBConnHarp();
|
|
|
|
|
@@ -119,6 +126,12 @@ public class StructuralDataFacade {
|
|
|
//装载数据
|
|
|
execute(structuralDataVos);
|
|
|
//
|
|
|
+ String[] modeList={"8","10","53","54","57","58","59","60","55","23"};
|
|
|
+ for (String modeId: modeList ) {
|
|
|
+ if (modeId.equals(structuralDataVos.getModeId())){
|
|
|
+ return RespDTO.onSuc("该模块没有质控条目");
|
|
|
+ }
|
|
|
+ }
|
|
|
//返回评分结构体
|
|
|
return mrIng(structuralDataVos);
|
|
|
|
|
@@ -218,17 +231,7 @@ public class StructuralDataFacade {
|
|
|
}else if("会诊申请单".equals(modelName)){
|
|
|
List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
|
|
|
if (hisViewVos.size()>0){
|
|
|
- aStrConsultationResultFacade.getOneList(hisViewVos,s.getModeId());
|
|
|
- }
|
|
|
- }else if("会诊结果单".equals(modelName)){
|
|
|
- List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
|
|
|
- if (hisViewVos.size()>0){
|
|
|
- aStrConsultationResultFacade.getOneList(hisViewVos,s.getModeId());
|
|
|
- }
|
|
|
- }else if("会诊单".equals(modelName)){
|
|
|
- List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
|
|
|
- if (hisViewVos.size()>0){
|
|
|
- aStrConsultationNoteFacade.getOneList(hisViewVos,s.getModeId());
|
|
|
+ aStrConsultationResultFacade.getOneList(hisViewVos,"31");
|
|
|
}
|
|
|
}else if ("会诊记录".equals(modelName)){
|
|
|
List<HisViewVo> hisViewVos =fjtzdbConnHarp.getHisView(this.sql(s));
|
|
@@ -249,7 +252,8 @@ public class StructuralDataFacade {
|
|
|
/**
|
|
|
* 病案首页
|
|
|
*/
|
|
|
- String sql ="select * from "+s.getTableName()+" where behospitalCode='"+s.getBehospitalCode()+"' and homePageId='"+s.getRecId()+"'" ;
|
|
|
+ String sql ="select * from "+s.getTableName()+" where behospitalCode='"+ s.getBehospitalCode()+
|
|
|
+ "' and homePageId='"+s.getRecId()+"' and patientId='"+s.getPatientId()+ "'";
|
|
|
List<HisHomePageVO> homePage =fjtzdbConnHarp.getHomePage(sql);
|
|
|
if (homePage.size()>0) {
|
|
|
aHomePageFacade.getOneList(homePage);//病案首页
|
|
@@ -271,28 +275,50 @@ public class StructuralDataFacade {
|
|
|
aHomeOperationInfoFacade.execute(homeOperationInfos);//病案首页手术
|
|
|
}
|
|
|
}else if ("医嘱信息".equals(modelName)){
|
|
|
- String sql="select * from med_doctor_advice where "+" behospitalCode='"+s.getBehospitalCode()+"' and doctorAdviceId='"+s.getRecId()+"'" ;
|
|
|
+ String sql="select * from med_doctor_advice where "+" behospitalCode='"+s.getBehospitalCode()+
|
|
|
+ "' and doctorAdviceId='"+s.getRecId()+"' and patientId='"+s.getPatientId()+ "'";
|
|
|
List<DoctorAdvice> doctorAdvice =fjtzdbConnHarp.getDoctorAdvice(sql);
|
|
|
if (doctorAdvice.size()>0){
|
|
|
aDoctorAdviceFacade.execute(doctorAdvice);
|
|
|
}
|
|
|
}else if ("入院登记".equals(modelName)) {
|
|
|
- String sql = "select * from " + s.getTableName() + " where behospitalCode='" + s.getBehospitalCode() + "'";
|
|
|
+ String sql = "select * from " + s.getTableName() + " where behospitalCode='" + s.getBehospitalCode() +"' and patientId='"+s.getPatientId()+ "'";
|
|
|
List<BehospitalInfo> behospitalInfo = fjtzdbConnHarp.getBehospitalInfo(sql);
|
|
|
if (behospitalInfo.size() > 0) {
|
|
|
aBehospitalInfoFacade.execute(behospitalInfo);
|
|
|
}
|
|
|
- }else if ("检查信息".equals(modelName)){
|
|
|
- List<MedPacsResult> pacsResult =fjtzdbConnHarp.getPacsResult(this.sql(s));
|
|
|
- if (pacsResult.size()>0){
|
|
|
- aMedPacsResultFacade.execute(pacsResult);
|
|
|
+ }
|
|
|
+ else if ("检查信息".equals(modelName)){
|
|
|
+ String sql ="select * from med_pacs_info where behospitalCode ='"+s.getBehospitalCode()+
|
|
|
+ "' and recId = '"+s.getRecId()+"' and patientId='"+s.getPatientId()+ "'";
|
|
|
+
|
|
|
+ List<MedPacsInfo> pacsInfo =fjtzdbConnHarp.getPacsInfo(sql);
|
|
|
+ if (pacsInfo.size()>0){
|
|
|
+ pacsInfo.forEach(pacs->{
|
|
|
+ medPacsInfoFacade.save(pacs);
|
|
|
+ });
|
|
|
+ List<MedPacsResult> pacsResult =fjtzdbConnHarp.getPacsResult(this.sql(s));
|
|
|
+ if (pacsResult.size()>0){
|
|
|
+ aMedPacsResultFacade.execute(pacsResult);
|
|
|
+ }
|
|
|
}
|
|
|
}else if ("检验信息".equals(modelName)){
|
|
|
- List<MedLisResult> lisResult =fjtzdbConnHarp.getLisResult(this.sql(s));
|
|
|
- if (lisResult.size()>0){
|
|
|
- aMedLisResultFacade.execute(lisResult);
|
|
|
+ String sql ="select * from med_lis_info where behospitalCode ='"+ s.getBehospitalCode()+
|
|
|
+ "' and recId = '"+s.getRecId()+"' and patientId='"+s.getPatientId()+ "'";
|
|
|
+
|
|
|
+ List<MedLisInfo> lisInfo =fjtzdbConnHarp.getLisInfo(sql);
|
|
|
+ if (lisInfo.size()>0){
|
|
|
+ lisInfo.forEach(lis->{
|
|
|
+ medLisInfoFacade.save(lis);
|
|
|
+ });
|
|
|
+ List<MedLisResult> lisResult =fjtzdbConnHarp.getLisResult(this.sql(s));
|
|
|
+ if (lisResult.size()>0){
|
|
|
+ aMedLisResultFacade.execute(lisResult);
|
|
|
+ }
|
|
|
}
|
|
|
- }else if ("谈话告知书".equals(modelName)){
|
|
|
+
|
|
|
+ }
|
|
|
+ else if ("谈话告知书".equals(modelName)){
|
|
|
List<StrTalkInform> strTalkInforms =fjtzdbConnHarp.getStrTalkInform(this.sql(s));
|
|
|
if (strTalkInforms.size()>0){
|
|
|
aStrTalkInformFacade.execute(strTalkInforms);
|
|
@@ -338,6 +364,15 @@ public class StructuralDataFacade {
|
|
|
String behospitalCode = structuralDataVos.getBehospitalCode();
|
|
|
Long hospitalId = structuralDataVos.getHospitalId();
|
|
|
Long modeId = Long.valueOf(structuralDataVos.getModeId());
|
|
|
+ QueryWrapper queryWrapper =Wrappers.query();
|
|
|
+ BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .eq("behospital_code", behospitalCode)
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N), false);
|
|
|
+ if (null == behospitalInfo){
|
|
|
+ structuralDataVos.setModeId("63");
|
|
|
+ execute(structuralDataVos);
|
|
|
+ }
|
|
|
if (structuralDataVos.getDockModeType().equals("1")) {
|
|
|
//页面模式
|
|
|
String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
|
|
@@ -366,7 +401,10 @@ public class StructuralDataFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public String sql(StructuralDataVo s){
|
|
|
- String sql ="select * from "+s.getTableName()+" t where t.behospitalCode='"+s.getBehospitalCode()+"' and t.recId= '"+s.getRecId()+"'" ;
|
|
|
+ String sql ="select * from "+s.getTableName()+
|
|
|
+ " where behospitalCode='"+s.getBehospitalCode()+
|
|
|
+ "' and recId= '"+s.getRecId()+
|
|
|
+ "' and patientId='"+s.getPatientId()+ "'";
|
|
|
|
|
|
return sql;
|
|
|
}
|