1、增加出院召回接口

2、判断患者住院信息,改成患者ID+住院次数
3、将判断患者住院信息,挪到先检验,再做后续操作
master
leijx 5 years ago
parent ca9b5ed6ee
commit 1e494017b7

@ -2,7 +2,6 @@ package com.ann.demo.controller;
import com.ann.demo.entity.constant.InterfaceName;
import com.ann.demo.service.impl.AnalysisService;
import com.ann.demo.service.UserService;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,8 +21,6 @@ public class TestController {
@Autowired
AnalysisService analysisService;
@Autowired
UserService userService;
@RequestMapping("/demo")
public String aa() {

@ -11,21 +11,21 @@ import java.util.Map;
*/
public class AliasName {
public static final String USER = "用户字典";
public static final String DEPARTMENT = "科室字典";
// 超声报告
public static final String ULTRASONIC_REPORT = "57";
// 病理检查报告单
public static final String PATHOLOGY_REPORT = "52";
// 放射诊断报告单 54
public static final String RADIATION_REPORT = "54";
// 心电图报告单 59
public static final String EKG_REPORT = "59";
// public static final String USER = "用户字典";
//
// public static final String DEPARTMENT = "科室字典";
//
// // 超声报告
// public static final String ULTRASONIC_REPORT = "57";
//
// // 病理检查报告单
// public static final String PATHOLOGY_REPORT = "52";
//
// // 放射诊断报告单 54
// public static final String RADIATION_REPORT = "54";
//
// // 心电图报告单 59
// public static final String EKG_REPORT = "59";
// 入院记录
public static final String ADMISSION_RECORD = "9";
@ -48,80 +48,83 @@ public class AliasName {
// 同步死亡医嘱
public static final String DIE_MEDICAL_ADVICE = "132";
// 出院召回
public static final String PARAMETER_DISCHARGE_BACK = "8";
// 手麻
public static final String HANDNUMBNESS_REPORT = "117";
// public static final String HANDNUMBNESS_REPORT = "117";
// ICU报告
public static final String ICU_REPORT = "121";
// public static final String ICU_REPORT = "121";
// 其他类型 目前来说 是手麻系统的其他三个
public static final String OTHER = "18";
// public static final String OTHER = "18";
// 检查申请单
public static final String PARAMETER_EXAMAPPLY = "119";
// 输血单
public static final String BLOODAPPLY_REPORT = "120";
// PET/CT报告单
public static final String PETCT_REPORT = "60";
// 检验申请单
public static final String PARAMETER_INSPECTIONAPPLY = "118";
// 检验报告
public static final String INSPECTION_REPORT = "10";
// 扫描文件
public static final String SCANNING_FILE = "30";
// 护理、医生
public static final Map<String, String> DOCTOR_MAP;
public static final Map<String, String> NURSE_MAP;
// 病案首页
public static final String MEDICAL_RECORD_HOMEPAGE = "3";
// 20191021 申请单变更状态
public static final String EXAM_APPLY_STATE_CHANGE = "31";
// 20200701 长期医嘱
public static final String PRN = "122";
// 20200701 临时医嘱
public static final String SOS = "123";
static {
DOCTOR_MAP = new HashMap<String, String>();
DOCTOR_MAP.put("入院记录", "9");
DOCTOR_MAP.put("病程记录", "11");
DOCTOR_MAP.put("术前文书", "12");
DOCTOR_MAP.put("手术资料", "13");
DOCTOR_MAP.put("讨论记录", "14");
DOCTOR_MAP.put("会诊记录", "15");
DOCTOR_MAP.put("出院记录", "113");
DOCTOR_MAP.put("死亡记录", "17");
DOCTOR_MAP.put("VTE文书", "23");
DOCTOR_MAP.put("其他记录", "18");
DOCTOR_MAP.put("医护共用", "19");
DOCTOR_MAP.put("知情同意", "20");
DOCTOR_MAP.put("疾病危重", "21");
DOCTOR_MAP.put("VTE记录", "22");
DOCTOR_MAP.put("病案首页", "3");
DOCTOR_MAP.put("病历文书", "");
NURSE_MAP = new HashMap<String, String>();
NURSE_MAP.put("首次护理记录", "7");
NURSE_MAP.put("护理文书", "6");
NURSE_MAP.put("专科单护理", "24");
NURSE_MAP.put("知情文件", "8");
NURSE_MAP.put("体温单", "5");
NURSE_MAP.put("护理记录", "2");
NURSE_MAP.put("评估单", "4");
NURSE_MAP.put("病历护理文书", "");
}
// public static final String PARAMETER_EXAMAPPLY = "119";
// // 输血单
// public static final String BLOODAPPLY_REPORT = "120";
//
// // PET/CT报告单
// public static final String PETCT_REPORT = "60";
//
// // 检验申请单
// public static final String PARAMETER_INSPECTIONAPPLY = "118";
//
// // 检验报告
// public static final String INSPECTION_REPORT = "10";
//
// // 扫描文件
// public static final String SCANNING_FILE = "30";
// // 护理、医生
// public static final Map<String, String> DOCTOR_MAP;
// public static final Map<String, String> NURSE_MAP;
//
// // 病案首页
// public static final String MEDICAL_RECORD_HOMEPAGE = "3";
//
// // 20191021 申请单变更状态
// public static final String EXAM_APPLY_STATE_CHANGE = "31";
//
// // 20200701 长期医嘱
// public static final String PRN = "122";
//
// // 20200701 临时医嘱
// public static final String SOS = "123";
//
//
// static {
// DOCTOR_MAP = new HashMap<String, String>();
// DOCTOR_MAP.put("入院记录", "9");
// DOCTOR_MAP.put("病程记录", "11");
// DOCTOR_MAP.put("术前文书", "12");
// DOCTOR_MAP.put("手术资料", "13");
// DOCTOR_MAP.put("讨论记录", "14");
// DOCTOR_MAP.put("会诊记录", "15");
// DOCTOR_MAP.put("出院记录", "113");
// DOCTOR_MAP.put("死亡记录", "17");
// DOCTOR_MAP.put("VTE文书", "23");
// DOCTOR_MAP.put("其他记录", "18");
// DOCTOR_MAP.put("医护共用", "19");
// DOCTOR_MAP.put("知情同意", "20");
// DOCTOR_MAP.put("疾病危重", "21");
// DOCTOR_MAP.put("VTE记录", "22");
// DOCTOR_MAP.put("病案首页", "3");
// DOCTOR_MAP.put("病历文书", "");
//
// NURSE_MAP = new HashMap<String, String>();
// NURSE_MAP.put("首次护理记录", "7");
// NURSE_MAP.put("护理文书", "6");
// NURSE_MAP.put("专科单护理", "24");
// NURSE_MAP.put("知情文件", "8");
// NURSE_MAP.put("体温单", "5");
// NURSE_MAP.put("护理记录", "2");
// NURSE_MAP.put("评估单", "4");
// NURSE_MAP.put("病历护理文书", "");
// }
}

@ -1,16 +0,0 @@
package com.ann.demo.entity.constant;
/**
* @Description
* @Date 2019/6/13 16:39
* @Created by ljx
*/
public class Identification {
public static final String INSERT = "insert";
public static final String UPDATE = "update";
public static final String DELETE = "delete";
}

@ -140,4 +140,10 @@ public class InterfaceName {
*/
public static final String PARAMETER_INSPECTIONAPPLY = "InspectionApplyRequest";
//20200909 新增出院召回
public static final String PARAMETER_DISCHARGE_BACK = "CalPatientOutRequest";
}

@ -1,16 +0,0 @@
package com.ann.demo.entity.constant;
/**
* @Description HL7V3xml
* @Date 2019/6/13 21:50
* @Created by ljx
*/
public class OutParaConstant {
public static final boolean RESULT_CODE_SUCCESS = true;
public static final boolean RESULT_CODE_FILED = false;
public static final String RESULT_CONTENT_SUCCESS = "成功";
public static final String RESULT_CONTENT_FILED = "失败";
}

@ -118,4 +118,12 @@ public class WebserviceId {
*/
public static final String DIE_MEDICAL_ADVICE = "21";
/**
* 20200909
*/
public static final String PARAMETER_DISCHARGE_BACK = "22";
}

@ -1,26 +0,0 @@
package com.ann.demo.entity.interfaceEntity;
import lombok.Data;
import java.util.Date;
/**
*
*
* @Author: LeiJiaXin
* @Date: 2019/8/22 15:42
*/
@Data
public class BloodApply {
private Date xmlCreateTime;
private String inpNo;
private String visitId;
private String patientId;
private String reportAddress;
}

@ -1,41 +0,0 @@
package com.ann.demo.entity.interfaceEntity;
import lombok.Data;
import java.util.Date;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/10 10:04
*/
@Data
public class EMRData {
// 2019-9-28 新增id
private String applyId;
private Date xmlCreateTime;
private String inpNo;
private String visitId;
private String patientId;
// 病历文书
private String type;
private String reportAddress;
private String lastModifyTime;
private String commitTime;
// 知情同意
private String subType;
// 知情同意下面的类型
private String detailType;
//排序的时间
private String captionDateTime;
}

@ -1,38 +0,0 @@
package com.ann.demo.entity.interfaceEntity;
import lombok.Data;
import java.util.Date;
/**
*
*
* @Author: LeiJiaXin
* @Date: 2019/12/23 15:42
*/
@Data
public class InspectionApply {
private String applyId;
private Date xmlCreateTime;
private String inpNo;
private String visitId;
private String patientId;
private Date authorReportTime;
private String result;
private Integer isValid = 0;
/**
* 2019-10-21 E F
*/
private String isOpen;
}

@ -0,0 +1,60 @@
package com.ann.demo.entity.interfaceEntity;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
* @Description
* @Date 2020/7/1 9:00
* @Created by ljx
*/
@Table
@Entity
@Data
public class InterfaceHisCache {
@Id
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
@GeneratedValue(generator = "system-uuid")
private String id;
private String inpNo;
private String visitId;
// 医嘱类型 0代表临时医嘱 1代表长期医嘱
private String type;
private String pdfPath;
private String remark;
// 0代表未处理 1代表已处理 2代表处理异常 3代表召回作废
private String state = "0";
//2020-7-6 新增修改时间
private Date updateTime = new Date();
public InterfaceHisCache(String inpNo, String visitId, String type) {
this.inpNo = inpNo;
this.visitId = visitId;
this.type = type;
}
public void setValue(String state, String remark, Date updateTime) {
this.state = state;
this.remark = remark;
this.updateTime = updateTime;
}
public InterfaceHisCache() {
}
}

@ -28,9 +28,6 @@ public class HomepageDictionaryImpl implements HomepageDictionary {
@Autowired
private AnalysisService analysisService;
@Autowired
ExamApplyService examApplyService;
@Override
public String HIPMessageServer(String action, String message) {
String result = "";
@ -65,13 +62,16 @@ public class HomepageDictionaryImpl implements HomepageDictionary {
// 同步死亡医嘱
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.DIE_MEDICAL_ADVICE, WebserviceId.DIE_MEDICAL_ADVICE);
break;
case InterfaceName.PARAMETER_DISCHARGE_BACK:
// 同步召回信息
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_DISCHARGE_BACK, WebserviceId.PARAMETER_DISCHARGE_BACK);
break;
}
}
}catch (Exception e){
logger.error("当前参数:{},报错信息:{}",action,e.getMessage());
return "";
}
// ---------------------------------------这里捕捉 参数为空
return result;
}

@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
@ -16,8 +17,11 @@ import java.util.List;
@Repository
public interface ArchiveMasterRepository extends JpaRepository<ArchiveMaster, String> {
@Query("select o.id from ArchiveMaster o where o.patientId = ?1 and o.visitId = ?2 and o.inpNo =?3 and isValid = 0")
public String findArchiveMasterId(String patientId, String visitId, String inpNo);
@Query("select o.id from ArchiveMaster o where o.visitId = ?1 and o.patientId =?2 and isValid = 0 and archivestate <> '作废' ")
public String findArchiveMasterId( String visitId, String patientId);
public ArchiveMaster findArchiveMasterById(String id);
@Transactional
@Modifying
@ -26,12 +30,9 @@ public interface ArchiveMasterRepository extends JpaRepository<ArchiveMaster, St
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.transferDept = ?2 where o.id = ?1 and o.isValid = 0 ")
@Query("update ArchiveMaster o set o.transferDept = ?2 where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
public Integer transferDepartment(String id, String transferDept);
@Query("select o.deptAdmissionTo from ArchiveMaster o where o.patientId = ?1 and o.visitId = ?2 and o.inpNo =?3")
public String findArchiveMasterDept(String patientId, String visitId, String inpNo);
public ArchiveMaster findByIdAndIsValid(String id, Integer isValid);
public ArchiveMaster findByPatientIdAndVisitIdAndIsValid(String patientId, String visitId, Integer isValid);
@ -43,24 +44,33 @@ public interface ArchiveMasterRepository extends JpaRepository<ArchiveMaster, St
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.checkedDatetime = null where o.id = ?1 and o.isValid = 0 ")
@Query("update ArchiveMaster o set o.checkedDatetime = null where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
public Integer updateCheckedDatetime(String id);
@Query("select o.transferDept from ArchiveMaster o where o.id = ?1")
@Query("select o.transferDept from ArchiveMaster o where o.id = ?1 and o.isValid = 0 and archivestate <> '作废'")
String findTransferDept(String id);
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.name = ?3,o.sex = ?2 where o.id = ?1 and o.isValid = 0 ")
@Query("update ArchiveMaster o set o.name = ?3,o.sex = ?2 where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
Integer updateArchiveMaster(String id, String sex, String name);
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.deathFlag = ?2 where o.id = ?1 and o.isValid = 0 ")
@Query("update ArchiveMaster o set o.deathFlag = ?2 where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
Integer updateDeathFlag(String id, String deathFlag);
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.doctorInCharge = ?2 where o.id = ?1 and o.isValid = 0 ")
@Query("update ArchiveMaster o set o.doctorInCharge = ?2 where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
Integer updateDoctorInCharge(String id, String doctorInCharge);
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.name = ?2 , o.sex = ?3 ,o.admissionDateTime = ?4 ,o.deptAdmissionTo = ?5 where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
void updateArchiveMasterByUpdate(String id,String name, String sex, Date admissionDateTime, String deptAdmissionTo);
@Transactional
@Modifying
@Query("update ArchiveMaster o set o.archiveState = '在院' where o.id = ?1 and o.isValid = 0 and archivestate <> '作废' ")
Integer updateArchiveMasterArchiveState(String id);
}

@ -1,13 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.CommonTable1;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/6 15:49
*/
@Repository
public interface CommonTable1Repository extends JpaRepository<CommonTable1, String> {
}

@ -1,13 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.CommonTable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/6 15:49
*/
@Repository
public interface CommonTableRepository extends JpaRepository<CommonTable, String> {
}

@ -1,17 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.Department;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/7/16 9:53
*/
@Repository
public interface DepartmentRepository extends JpaRepository<Department, String> {
@Query("select o from Department o where o.DEPT_CODE = ?1 and o.isValid = ?2 ")
public Department findDepartmentByDeptCodeAndIsValid(String deptCode, Integer isValid);
}

@ -1,14 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.DiagDetail;
import com.ann.demo.entity.normalEntity.ids.DiagDetailIds;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/6 15:49
*/
@Repository
public interface DiagDetailRepository extends JpaRepository<DiagDetail, DiagDetailIds> {
}

@ -1,17 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.EMRDictionary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/21 16:04
*/
@Repository
public interface EMRDictionaryRepository extends JpaRepository<EMRDictionary, Integer> {
@Query("select o from EMRDictionary o where o.DEPT_CODE = ?1 and o.isValid = ?2 ")
public EMRDictionary findEMRDictionaryByCodeAndIsValid(String code, Integer isValid);
}

@ -1,26 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.interfaceEntity.ExamApply;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/22 16:22
*/
@Repository
public interface ExamApplyRepository extends JpaRepository<ExamApply, String> {
@Transactional
@Modifying
@Query("update ExamApply o set o.isValid = 1 where o.applyId = ?1 and o.isValid = 0 ")
public Integer updateExamApplyIsValidById(String applyId);
@Query("select count(o) from ExamApply o where o.applyId = ?1 and o.isValid = 0")
public Integer countExamApply(String applyId);
public ExamApply findByApplyId(String applyId);
}

@ -0,0 +1,22 @@
package com.ann.demo.repository;
import com.ann.demo.entity.interfaceEntity.InterfaceHisCache;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import javax.transaction.Transactional;
import java.util.List;
public interface InterfaceHisCacheRepository extends JpaRepository<InterfaceHisCache,String> {
public List<InterfaceHisCache> findAllByStateAndPdfPathIsNotNull(String state);
public InterfaceHisCache findByInpNoAndVisitIdAndStateAndType(String inpNo,String visitId,String state,String type);
@Transactional
@Modifying
@Query(value = "update InterfaceHisCache o set o.state = ?1 where o.id = ?2 and o.state = 0 and o.type = ?3 ")
public Integer updateStateById(String state, String id, String type);
}

@ -1,23 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepageCache;
import com.ann.demo.entity.normalEntity.ids.MedicalRecordHomepageCacheIds;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/26 9:31
*/
@Repository
public interface MedicalRecordHomepageCacheRepository extends JpaRepository<MedicalRecordHomepageCache, MedicalRecordHomepageCacheIds> {
public MedicalRecordHomepageCache findByMasterId(String masterId);
@Modifying
@Query("update MedicalRecordHomepageCache m set m.isAdd = 1 where m.masterId = ?1 and m.isAdd = 0")
public void updateIsValid(String masterId);
}

@ -1,14 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.OperDetail;
import com.ann.demo.entity.normalEntity.ids.OperDetailIds;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/6 15:49
*/
@Repository
public interface OperDetailRepository extends JpaRepository<OperDetail, OperDetailIds> {
}

@ -1,15 +0,0 @@
package com.ann.demo.repository;
import com.ann.demo.entity.normalEntity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* @Author: LeiJiaXin
* @Date: 2019/7/16 9:53
*/
@Repository
public interface UserRepository extends JpaRepository<User, String> {
}

@ -10,9 +10,9 @@ import java.util.List;
*/
public interface ArchiveMasterService {
public void save(ArchiveMaster archiveMaster);
public void save(ArchiveMaster archiveMaster) throws Exception;
public String findArchiveMasterId(String patientId, String visitId, String inpNo);
public String findArchiveMasterId( String visitId, String patientId);
// 修改患者入院状态
public boolean updateArchiveMasterValid(String archiveMasterId);
@ -23,14 +23,13 @@ public interface ArchiveMasterService {
// 出院
public void discharge(ArchiveMaster archiveMaster);
public ArchiveMaster findByInpNoAndVisitIdAndIsValid(String inpNo, String visitId) throws Exception;
public ArchiveMaster findByPatientIdAndVisitIdAndIsValid(String inpNo, String visitId) throws Exception;
// 病案首页定时器,查询所有归档
public List<ArchiveMaster> findAllArchiveMaster();
boolean updateCheckedDatetime(String id);
// // 病案首页定时器,查询所有归档
// public List<ArchiveMaster> findAllArchiveMaster();
//
// boolean updateCheckedDatetime(String id);
// 2020-5-11 更新患者信息
boolean updateArchiveMaster(ArchiveMaster archiveMaster);
@ -40,4 +39,6 @@ public interface ArchiveMasterService {
//20200609 同步管床医师
boolean updateArchiveMasterBydoctorInCharge(ArchiveMaster archiveMaster);
boolean updateArchiveMasterArchiveState(ArchiveMaster archiveMaster);
}

@ -1,18 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.normalEntity.Department;
/**
* @Description
* @Date 2019/7/16 9:56
* @Created by ljx
*/
public interface DepartmentService {
public void save(Department department);
public void delete(Department department);
public Department findDepartment(String user_dept);
}

@ -1,16 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.normalEntity.EMRDictionary;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/21 16:08
*/
public interface EMRDictionaryService {
public void save(EMRDictionary emrDictionary);
public void delete(EMRDictionary emrDictionary);
public EMRDictionary findEMRDictionary(String code);
}

@ -1,22 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.interfaceEntity.ExamApply;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/22 16:20
*/
public interface ExamApplyService {
public void save(ExamApply examApply);
/* public boolean updateExamApplyIsValidById(String id);*/
//public String findId(String applyId,String inpNo,String visitId,String patientId);
public ExamApply findExamApply(String applyId);
Integer countExamApply(String applyId);
boolean updateExamApplyIsValid(String applyId);
}

@ -0,0 +1,22 @@
package com.ann.demo.service;
import com.ann.demo.entity.interfaceEntity.InterfaceHisCache;
import java.util.List;
public interface InterfaceHisCacheService {
//查询所有未处理的状态
public List<InterfaceHisCache> findInterfaceHisCacheByState();
//修改状态
public boolean updateState(String state, String id, String type);
void save(InterfaceHisCache interfaceHisCache);
InterfaceHisCache findInterfaceHisCache(String inpNo, String visitId, String type);
}

@ -1,20 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepage;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepageCache;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/26 9:26
*/
public interface MedicalRecordHomepageCacheService {
public boolean save(String masterId) throws Exception;
public boolean save(MedicalRecordHomepageCache m) throws Exception;
void delete(String masterId) throws Exception;
public MedicalRecordHomepageCache handleMedicalRecordHomepageCache(MedicalRecordHomepage medicalRecordHomepage) throws Exception;
}

@ -1,13 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepage;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/6 15:46
*/
public interface MedicalRecordHomepageService {
public boolean save(MedicalRecordHomepage medicalRecordHomepage);
}

@ -1,17 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.normalEntity.User;
/**
* @Description
* @Date 2019/7/16 9:56
* @Created by ljx
*/
public interface UserService {
public void save(User user);
public void delete(User user);
}

@ -30,8 +30,6 @@ import java.util.Objects;
@Component
public class AnalysisService {
static final Logger logger = LoggerFactory.getLogger(AnalysisService.class);
@Autowired
MessageService messageService;
@ -41,12 +39,6 @@ public class AnalysisService {
@Autowired
ArchiveMasterService archiveMasterService;
@Autowired
ExamApplyService examApplyService;
@Autowired
MedicalRecordHomepageCacheService medicalRecordHomepageCacheService;
/**
* 2019-7-8
*
@ -68,11 +60,14 @@ public class AnalysisService {
messageService.save(messageLog);
MessageDto messageDto = XMLUtils.xpathToBean(message, tClass, parameter);
if (messageDto != null) {
type = messageDto.getType();
xmlCreateTime = messageDto.getXmlCreateTime();
String textContentTemp = null;
if (Objects.equals(messageDto.getEntity(), ArchiveMaster.class.getName())) { // 患者信息
ArchiveMaster archiveMaster = JSON.parseObject(messageDto.getObject().toString(), ArchiveMaster.class);
//查询患者是否存在
archiveMasterId = archiveMasterService.findArchiveMasterId(archiveMaster.getPatientId(), archiveMaster.getVisitId(), archiveMaster.getInpNo());
archiveMasterId = archiveMasterService.findArchiveMasterId( archiveMaster.getVisitId(), archiveMaster.getPatientId());
if (archiveMasterId != null) {
// 如果不是新增 都会查询id
archiveMaster.setId(archiveMasterId);
@ -87,68 +82,72 @@ public class AnalysisService {
if (textContentTemp != null && textContentTemp.indexOf("-") != -1) {
archiveMasterId = textContentTemp;
}
xmlCreateTime = messageDto.getXmlCreateTime();
type = messageDto.getType();
typeCodeValue = "AA";
result = 1;
}
} else {
textContent = "传过来的消息无法解析。。";
}
outContent = XMLUtils.generateV3XmlStr(typeCodeValue, textContent);
endTime = System.currentTimeMillis();
messageLog.setValue(archiveMasterId,outContent, result, messageDto == null ? "" : JSON.toJSONString(messageDto), xmlCreateTime, (endTime - startTime), new Date(), type, textContent);
messageService.save(messageLog);
logger.info("-----------------------" + type + ":" + (endTime - startTime) + "-------------------------");
return outContent;
}
private String changeArchiveMaster(ArchiveMaster archiveMaster, String changeStatus, String aliasName) throws Exception{
String textContent = null;
if (changeStatus != null || aliasName != null) {
String archiveMasterId = archiveMaster.getId();
if (archiveMasterId != null) {
if (aliasName.equals(AliasName.ADMISSION_RECORD) && Objects.equals(changeStatus, "update") ) { //入院消息 更新患者住院信息
archiveMasterService.save(archiveMaster); //
}else if (aliasName.equals(AliasName.CANCELLATION_DISCHARGE) && Objects.equals(changeStatus, "delete")) { // 取消入院
archiveMasterService.updateArchiveMasterValid(archiveMasterId);
}else if (aliasName.equals(AliasName.TRANSFER_RECORD)) { // 转科
archiveMasterService.transferDepartment(archiveMaster);
} else if (aliasName.equals(AliasName.DISCHARGE_RECORD)) { // 出院
archiveMasterService.discharge(archiveMaster);
}else if(aliasName.equals(AliasName.PATIENT_UPDATE)){ //患者信息修改
if(!archiveMasterService.updateArchiveMaster(archiveMaster)){
textContent = "患者更新失败";
}
}else if(aliasName.equals(AliasName.DIE_MEDICAL_ADVICE)){ //死亡信息同步
String deathFlag = "0";
if(Objects.equals(changeStatus,"new")){
deathFlag = "1";
}
archiveMaster.setDeathFlag(deathFlag);
if(!archiveMasterService.updateArchiveMasterByDeathFlag(archiveMaster)){
textContent = "死亡信息同步失败";
}
}else if(aliasName.equals(AliasName.BED_MANAGER)){ //管床医师同步
if(!archiveMasterService.updateArchiveMasterBydoctorInCharge(archiveMaster)){
textContent = "管床医师同步失败";
try {
if (changeStatus != null || aliasName != null) {
String archiveMasterId = archiveMaster.getId();
if (archiveMasterId != null) {
if (aliasName.equals(AliasName.ADMISSION_RECORD) && Objects.equals(changeStatus, "update")) { //入院消息 更新患者住院信息
archiveMasterService.save(archiveMaster); //
} else if (aliasName.equals(AliasName.CANCELLATION_DISCHARGE) && Objects.equals(changeStatus, "delete")) { // 取消入院
archiveMasterService.updateArchiveMasterValid(archiveMasterId);
} else if (aliasName.equals(AliasName.TRANSFER_RECORD)) { // 转科
archiveMasterService.transferDepartment(archiveMaster);
} else if (aliasName.equals(AliasName.DISCHARGE_RECORD)) { // 出院
archiveMasterService.discharge(archiveMaster);
} else if (aliasName.equals(AliasName.PATIENT_UPDATE)) { //患者信息修改
if (!archiveMasterService.updateArchiveMaster(archiveMaster)) {
textContent = "患者更新失败";
}
} else if (aliasName.equals(AliasName.DIE_MEDICAL_ADVICE)) { //死亡信息同步
String deathFlag = "1";
if (Objects.equals(changeStatus, "cancel")) {
deathFlag = "0";
}
archiveMaster.setDeathFlag(deathFlag);
if (!archiveMasterService.updateArchiveMasterByDeathFlag(archiveMaster)) {
textContent = "死亡信息同步失败";
}
} else if (aliasName.equals(AliasName.BED_MANAGER)) { //管床医师同步
if (!archiveMasterService.updateArchiveMasterBydoctorInCharge(archiveMaster)) {
textContent = "管床医师同步失败";
}
} else if(aliasName.equals(AliasName.PARAMETER_DISCHARGE_BACK)){ //出院召回
if (!archiveMasterService.updateArchiveMasterArchiveState(archiveMaster)) {
textContent = "出院召回同步失败";
}
}else {
textContent = "信息有错(存在患者入院消息可能已发送)";
}
} else {
textContent = "信息有错(存在患者入院消息可能已发送)";
}
}else {
if (Objects.equals(changeStatus, "new")) { //入院消息 新增患者住院信息
archiveMasterService.save(archiveMaster);
textContent = archiveMaster.getId();
}else{
textContent = "没有入院信息";
if (Objects.equals(changeStatus, "new") && aliasName.equals(AliasName.ADMISSION_RECORD)) { //入院消息 新增患者住院信息
archiveMasterService.save(archiveMaster);
textContent = archiveMaster.getId();
} else {
textContent = "没有入院信息";
}
}
} else {
textContent = "信息解析错误";
}
} else {
textContent = "信息解析错误";
}catch (Exception e){
return e.getMessage();
}
return textContent;
}

@ -1,14 +1,19 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.entity.interfaceEntity.InterfaceHisCache;
import com.ann.demo.repository.ArchiveMasterRepository;
import com.ann.demo.service.ArchiveMasterService;
import com.ann.demo.service.InterfaceHisCacheService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Objects;
/**
* @Author: LeiJiaXin
@ -26,7 +31,8 @@ public class ArchiveMasterServiceImpl implements ArchiveMasterService {
private InterfaceHisCacheService interfaceHisCacheService;
@Override
public void save(ArchiveMaster archiveMaster) {
public void save(ArchiveMaster archiveMaster) throws Exception{
// 处理性别
if (archiveMaster.getSex() != null) {
String sex = archiveMaster.getSex();
switch (sex) {
@ -45,12 +51,29 @@ public class ArchiveMasterServiceImpl implements ArchiveMasterService {
}
archiveMaster.setSex(sex);
}
archiveMasterRepository.save(archiveMaster);
//2020-8-17 如果不等于null那么就是入院信息更新操作
if(archiveMaster.getId() != null ){
ArchiveMaster archiveMasterTemp = archiveMasterRepository.findArchiveMasterById(archiveMaster.getId());
// 写了一段多余判断是否为null的检验~
if(archiveMaster.getName() == null ){
archiveMaster.setName(archiveMasterTemp.getName());
}else if(archiveMaster.getSex() == null){
archiveMaster.setSex(archiveMasterTemp.getSex());
}else if(archiveMaster.getAdmissionDateTime() == null){
archiveMaster.setAdmissionDateTime(archiveMasterTemp.getAdmissionDateTime());
}else if(archiveMaster.getDeptAdmissionTo() == null){
archiveMaster.setDeptAdmissionTo(archiveMasterTemp.getDeptAdmissionTo());
}
archiveMasterRepository.updateArchiveMasterByUpdate(archiveMaster.getId(),archiveMaster.getName(),archiveMaster.getSex(),archiveMaster.getAdmissionDateTime(),archiveMaster.getDeptAdmissionTo());
}else{
archiveMasterRepository.save(archiveMaster);
}
}
@Override
public String findArchiveMasterId(String patientId, String visitId, String inpNo) {
return archiveMasterRepository.findArchiveMasterId(patientId, visitId, inpNo);
public String findArchiveMasterId(String visitId, String patientId) {
return archiveMasterRepository.findArchiveMasterId( visitId, patientId);
}
@Override
@ -86,7 +109,7 @@ public class ArchiveMasterServiceImpl implements ArchiveMasterService {
//20200703 出院写入医嘱数据
for (int type = 0; type<2;type++){
InterfaceHisCache interfaceHisCache =
interfaceHisCacheService.findInterfaceHisCache(archiveMaster.getInpNo(), archiveMaster.getVisitId(), "1");
interfaceHisCacheService.findInterfaceHisCache(archiveMaster.getInpNo(), archiveMaster.getVisitId(), type+"");
if(interfaceHisCache == null){
interfaceHisCache = new InterfaceHisCache(archiveMaster.getInpNo(),archiveMaster.getVisitId(),type+"");
interfaceHisCacheService.save(interfaceHisCache);
@ -96,27 +119,27 @@ public class ArchiveMasterServiceImpl implements ArchiveMasterService {
}
}
@Override
public ArchiveMaster findByInpNoAndVisitIdAndIsValid(String inpNo, String visitId) throws Exception {
return archiveMasterRepository.findByInpNoAndVisitIdAndIsValid(inpNo, visitId, 0);
}
// @Override
// public ArchiveMaster findByInpNoAndVisitIdAndIsValid(String inpNo, String visitId) throws Exception {
// return archiveMasterRepository.findByInpNoAndVisitIdAndIsValid(inpNo, visitId, 0);
// }
@Override
public ArchiveMaster findByPatientIdAndVisitIdAndIsValid(String patientId, String visitId) throws Exception {
return archiveMasterRepository.findByPatientIdAndVisitIdAndIsValid(patientId, visitId, 0);
}
@Override
public List<ArchiveMaster> findAllArchiveMaster() {
return archiveMasterRepository.findAllArchiveMaster();
}
@Override
public boolean updateCheckedDatetime(String id) {
if (archiveMasterRepository.updateCheckedDatetime(id) > 0)
return true;
return false;
}
// @Override
// public List<ArchiveMaster> findAllArchiveMaster() {
// return archiveMasterRepository.findAllArchiveMaster();
// }
//
// @Override
// public boolean updateCheckedDatetime(String id) {
// if (archiveMasterRepository.updateCheckedDatetime(id) > 0)
// return true;
// return false;
// }
@Override
public boolean updateArchiveMaster(ArchiveMaster archiveMaster) {
@ -156,4 +179,21 @@ public class ArchiveMasterServiceImpl implements ArchiveMasterService {
return true;
return false;
}
@Override
public boolean updateArchiveMasterArchiveState(ArchiveMaster archiveMaster) {
if(archiveMasterRepository.updateArchiveMasterArchiveState(archiveMaster.getId()) > 0){
//20200703 出院召回删除 医嘱数据
for (int type = 0; type < 2; type++) {
InterfaceHisCache interfaceHisCache =
interfaceHisCacheService.findInterfaceHisCache(archiveMaster.getInpNo(), archiveMaster.getVisitId(), type + "");
if (interfaceHisCache != null) {
interfaceHisCacheService.updateState( "3", interfaceHisCache.getId(), type+"" );
}
}
return true;
}
return false;
}
}

@ -1,49 +0,0 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.normalEntity.Department;
import com.ann.demo.repository.DepartmentRepository;
import com.ann.demo.service.DepartmentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description
* @Date 2019/7/9 16:43
* @Created by ljx
*/
@Service
public class DepartmentServiceImpl implements DepartmentService {
static final Logger logger = LoggerFactory.getLogger(DepartmentServiceImpl.class);
@Autowired
DepartmentRepository departmentRepository;
@Override
public void save(Department department) {
//打日志信息
try {
departmentRepository.save(department);
} catch (Exception e) {
logger.error("出错咯!错误信息:" + e);
}
}
@Override
public void delete(Department department) {
//打日志信息
try {
departmentRepository.delete(department);
} catch (Exception e) {
logger.error("出错咯!错误信息:" + e);
}
}
@Override
public Department findDepartment(String user_dept) {
// ------------------确认 isValid 0是正常 1是停用
return departmentRepository.findDepartmentByDeptCodeAndIsValid(user_dept, 0);
}
}

@ -1,48 +0,0 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.normalEntity.EMRDictionary;
import com.ann.demo.repository.EMRDictionaryRepository;
import com.ann.demo.service.EMRDictionaryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/21 16:08
*/
@Service
public class EMRDictionaryServiceImpl implements EMRDictionaryService {
static final Logger logger = LoggerFactory.getLogger(EMRDictionaryServiceImpl.class);
@Autowired
EMRDictionaryRepository emrDictionaryRepository;
@Override
public void save(EMRDictionary emrDictionary) {
//打日志信息
try {
emrDictionaryRepository.save(emrDictionary);
} catch (Exception e) {
logger.error("出错咯!错误信息:" + e);
}
}
@Override
public void delete(EMRDictionary emrDictionary) {
//打日志信息
try {
emrDictionaryRepository.delete(emrDictionary);
} catch (Exception e) {
logger.error("出错咯!错误信息:" + e);
}
}
@Override
public EMRDictionary findEMRDictionary(String code) {
// ------------------确认 isValid 0是正常 1是停用
return emrDictionaryRepository.findEMRDictionaryByCodeAndIsValid(code, 0);
}
}

@ -1,40 +0,0 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.interfaceEntity.ExamApply;
import com.ann.demo.repository.ExamApplyRepository;
import com.ann.demo.service.ExamApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/22 16:20
*/
@Service
public class ExamApplyServiceImpl implements ExamApplyService {
@Autowired
ExamApplyRepository examApplyRepository;
@Override
public void save(ExamApply examApply) {
examApplyRepository.save(examApply);
}
@Override
public ExamApply findExamApply(String applyId) {
return examApplyRepository.findByApplyId(applyId);
}
@Override
public Integer countExamApply(String applyId) {
return examApplyRepository.countExamApply(applyId);
}
@Override
public boolean updateExamApplyIsValid(String applyId) {
if (examApplyRepository.updateExamApplyIsValidById(applyId) > 0)
return true;
return false;
}
}

@ -0,0 +1,40 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.interfaceEntity.InterfaceHisCache;
import com.ann.demo.repository.InterfaceHisCacheRepository;
import com.ann.demo.service.InterfaceHisCacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class InterfaceHisCacheServiceImpl implements InterfaceHisCacheService {
@Autowired
private InterfaceHisCacheRepository interfaceHisCacheRepository;
@Override
public List<InterfaceHisCache> findInterfaceHisCacheByState() {
return interfaceHisCacheRepository.findAllByStateAndPdfPathIsNotNull("0");
}
@Override
public boolean updateState(String state,String id,String type ) {
if(interfaceHisCacheRepository.updateStateById(state,id,type) > 0)
return true;
return false;
}
@Override
public void save(InterfaceHisCache interfaceHisCache) {
interfaceHisCacheRepository.save(interfaceHisCache);
}
@Override
public InterfaceHisCache findInterfaceHisCache(String inpNo, String visitId, String type) {
return interfaceHisCacheRepository.findByInpNoAndVisitIdAndStateAndType(inpNo,visitId,"0",type);
}
}

@ -1,156 +0,0 @@
package com.ann.demo.service.impl;
import com.alibaba.fastjson.JSON;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.entity.normalEntity.*;
import com.ann.demo.repository.MedicalRecordHomepageCacheRepository;
import com.ann.demo.service.ArchiveMasterService;
import com.ann.demo.service.MedicalRecordHomepageCacheService;
import com.ann.demo.service.MedicalRecordHomepageService;
import com.ann.demo.utils.PinYinUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
/**l
* @Author: LeiJiaXin
* @Date: 2019/9/26 9:27
*/
@Service
public class MedicalRecordHomepageCacheServiceImpl implements MedicalRecordHomepageCacheService {
static final Logger logger = LoggerFactory.getLogger(MedicalRecordHomepageCacheServiceImpl.class);
@Autowired
MedicalRecordHomepageCacheRepository medicalRecordHomepageCacheRepository;
@Autowired
MedicalRecordHomepageService medicalRecordHomepageService;
@Autowired
ArchiveMasterService archiveMasterService;
@Override
public boolean save(String masterId) throws Exception{
MedicalRecordHomepageCache medicalRecordHomepageCache = medicalRecordHomepageCacheRepository.findByMasterId(masterId);
if (medicalRecordHomepageCache != null) {
MedicalRecordHomepage m = JSON.parseObject(medicalRecordHomepageCache.getContent(), MedicalRecordHomepage.class);
if (medicalRecordHomepageService.save(m)) {
return true;
}
}
return false;
}
@Override
public boolean save(MedicalRecordHomepageCache medicalRecordHomepageCache) throws Exception{
try {
MedicalRecordHomepageCache mrh = medicalRecordHomepageCacheRepository.findByMasterId(medicalRecordHomepageCache.getMasterId());
if (mrh != null) {
medicalRecordHomepageCache.setRemark("已更新");
}
medicalRecordHomepageCacheRepository.save(medicalRecordHomepageCache);
return true;
} catch (Exception e) {
return false;
}
}
@Override
@Transactional
public void delete(String masterId) throws Exception{
medicalRecordHomepageCacheRepository.updateIsValid(masterId);
}
@Override
public MedicalRecordHomepageCache handleMedicalRecordHomepageCache(MedicalRecordHomepage medicalRecordHomepage) throws Exception{
// 查询主键 姓名简写 是否手术 是否过敏药物
String masterId = null;
MedicalRecordHomepageCache medicalRecordHomepageCache = null;
CommonTable commonTable = medicalRecordHomepage.getCommonTable();
if (commonTable != null) {
if (commonTable.getYZY002() != null && commonTable.getYZY001() != null) {
ArchiveMaster archiveMaster = archiveMasterService.findByPatientIdAndVisitIdAndIsValid(commonTable.getYZY001(), commonTable.getYZY002());
if (archiveMaster != null) {
masterId = archiveMaster.getId();
if (masterId != null) {
List<OperDetail> operDetails = medicalRecordHomepage.getOperDetails();
List<DiagDetail> diagDetails = medicalRecordHomepage.getDiagDetails();
CommonTable1 commonTable1 = medicalRecordHomepage.getCommonTable1();
if (commonTable1 != null) {
// 处理公共表
commonTable.setMasterId(masterId);
// 将 患者id 赋值给 病案号
commonTable.setInpatient_no(commonTable.getYZY001());
if (operDetails != null) {
if (operDetails.size() > 0) {
commonTable.setIsOper("有");
} else {
commonTable.setIsOper("没有");
}
} else {
commonTable.setIsOper("没有");
}
if (commonTable.getAAC003() != null) {
commonTable.setNameCym(PinYinUtils.getPingYin(commonTable.getAAC003()));
}
String akc023 = commonTable.getAKC023();
if (akc023 != null) {
if (akc023.indexOf("岁") != -1) {
commonTable.setAge(Integer.parseInt(akc023.substring(0, akc023.indexOf("岁"))));
} else if (akc023.indexOf("月") != -1 && akc023.indexOf("岁") == -1) {
commonTable.setAge_month(Integer.parseInt(akc023.substring(0, akc023.indexOf("月"))));
} else if (akc023.indexOf("天") != -1 && akc023.indexOf("岁") == -1 && akc023.indexOf("月") == -1) {
commonTable.setAge_day(Integer.parseInt(akc023.substring(0, akc023.indexOf("天"))));
}
}
// 处理公共表1
if (commonTable1.getYZY046() != null) {
commonTable1.setIs_medicine("是");
} else {
commonTable1.setIs_medicine("否");
}
commonTable1.setMasterId(masterId);
// 保存手术表
if (operDetails != null) {
for (OperDetail operDetail : operDetails) {
operDetail.setMasterId(masterId);
}
}
// 诊断表
if (diagDetails != null) {
for (DiagDetail diagDetail : diagDetails) {
diagDetail.setMasterId(masterId);
// 20200528 取出院诊断的主要诊断
if(Objects.equals(diagDetail.getYZY203(),"3") && Objects.equals(diagDetail.getYZY201(),1) ){
medicalRecordHomepage.getOtherData().setMainDiagCode(diagDetail.getAKC196());
commonTable.setMainDiagName(diagDetail.getAKC185());
}
}
}
medicalRecordHomepage.setCommonTable(commonTable);
medicalRecordHomepage.setCommonTable1(commonTable1);
medicalRecordHomepage.setDiagDetails(diagDetails);
medicalRecordHomepage.setOperDetails(operDetails);
medicalRecordHomepageCache = new MedicalRecordHomepageCache(masterId, JSON.toJSONString(medicalRecordHomepage));
return medicalRecordHomepageCache;
}
}
}
}
}
return null;
}
}

@ -1,68 +0,0 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.normalEntity.*;
import com.ann.demo.repository.*;
import com.ann.demo.service.MedicalRecordHomepageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: LeiJiaXin
* @Date: 2019/8/6 15:46
*/
@Service
public class MedicalRecordHomepageServiceImpl implements MedicalRecordHomepageService {
static final Logger logger = LoggerFactory.getLogger(MedicalRecordHomepageServiceImpl.class);
@Autowired
DiagDetailRepository diagDetailRepository;
@Autowired
CommonTable1Repository commonTable1Repository;
@Autowired
CommonTableRepository commonTableRepository;
@Autowired
OperDetailRepository operDetailRepository;
@Autowired
ArchiveMasterRepository archiveMasterRepository;
public boolean save(MedicalRecordHomepage medicalRecordHomepage) {
// 查询主键 姓名简写 是否手术 是否过敏药物
String masterId = medicalRecordHomepage.getCommonTable().getMasterId();
try {
List<OperDetail> operDetails = medicalRecordHomepage.getOperDetails();
List<DiagDetail> diagDetails = medicalRecordHomepage.getDiagDetails();
// 保存手术表
if (operDetails != null) {
for (OperDetail operDetail : operDetails) {
operDetail.setMasterId(masterId);
operDetailRepository.save(operDetail);
}
}
// 诊断表
if (diagDetails != null) {
for (DiagDetail diagDetail : diagDetails) {
diagDetail.setMasterId(masterId);
diagDetailRepository.save(diagDetail);
}
}
// 保存公共表
commonTableRepository.save(medicalRecordHomepage.getCommonTable());
// 保存公共表 1
commonTable1Repository.save(medicalRecordHomepage.getCommonTable1());
return true;
} catch (Exception e) {
logger.error("保存病案首页出错咯!错误信息:" + e);
return false;
}
}
}

@ -1,62 +0,0 @@
package com.ann.demo.service.impl;
import com.ann.demo.entity.normalEntity.EMRDictionary;
import com.ann.demo.entity.normalEntity.User;
import com.ann.demo.repository.UserRepository;
import com.ann.demo.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description
* @Date 2019/7/9 16:43
* @Created by ljx
*/
@Service
public class UserServiceImpl implements UserService {
static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired
UserRepository userRepository;
@Autowired
EMRDictionaryServiceImpl emrDictionaryService;
@Override
public void save(User user) {
//打日志信息
try {
// 获取科室 根据科室类型区分临床和非临床,临床的然后有资质的就是医生,没有资质的就是护士
Integer roleId = 0;
if (user.getUSER_DEPT() != null) {
EMRDictionary emrDictionary = emrDictionaryService.findEMRDictionary(user.getUSER_DEPT());
if (emrDictionary != null) {
if (emrDictionary.getCLINIC_ATTR() == 0) {
if (user.getEDUCATION_FLAG() == 0) { // 无资质 护士
roleId = 1;
} else { // 有资质 为 1 医生
roleId = 2;
}
}
}
}
user.setUSER_TYPE(roleId);
userRepository.save(user);
} catch (Exception e) {
logger.error("出错咯!错误信息:" + e);
}
}
@Override
public void delete(User user) {
//打日志信息
try {
userRepository.delete(user);
} catch (Exception e) {
logger.error("出错咯!错误信息:" + e);
}
}
}

@ -57,20 +57,9 @@ public class DateUtils {
public static void main(String[] args) {
/* //LocalDate date1 = LocalDate.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd hh:mm:ss");
String date = "2019/06/29 00:00:00";
LocalDate date1 = LocalDate.parse(date,dateTimeFormatter);
LocalDate date2 = LocalDate.of(date1.getYear(), date1.getMonth(), date1.getDayOfMonth());
int age = date2.until(date1).getDays();
System.out.println("You're " + age + " years old.");*/
File file = new File("C:/Users/ljx/Desktop/pdf/外3");
File[] files = file.listFiles();
for (File file1 : files) {
System.out.println(file1.getName());
}
int old = 10;
int newOld = old + (old >> 2);
System.out.println(newOld);
}
/**

@ -1,135 +0,0 @@
package com.ann.demo.utils;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepage;
import com.ann.demo.entity.normalEntity.OperDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* @Description
* @Date 2019/7/2 16:56
* @Created by ljx
*/
public class DownloadUtils {
static final Logger logger = LoggerFactory.getLogger(DownloadUtils.class);
/**
* Url
*
* @param urlStr
* @param fileName
* @param savePath
* @throws IOException
*/
public static void downLoadByUrl(String urlStr, String fileName, String savePath) throws IOException {
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
//设置超时间为5秒
conn.setConnectTimeout(5 * 1000);
//防止屏蔽程序抓取而返回403错误
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
//得到输入流
InputStream inputStream = conn.getInputStream();
//获取自己数组
byte[] getData = readInputStream(inputStream);
//文件保存位置
File saveDir = new File(savePath);
if (!saveDir.exists()) {
saveDir.mkdir();
}
File file = new File(saveDir + File.separator + fileName);
FileOutputStream fos = new FileOutputStream(file);
fos.write(getData);
if (fos != null) {
fos.close();
}
if (inputStream != null) {
inputStream.close();
}
System.out.println("info:" + url + " download success");
}
/**
*
*
* @param inputStream
* @return
* @throws IOException
*/
public static byte[] readInputStream(InputStream inputStream) throws IOException {
byte[] buffer = new byte[1024];
int len = 0;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
while ((len = inputStream.read(buffer)) != -1) {
bos.write(buffer, 0, len);
}
bos.close();
return bos.toByteArray();
}
//从共享目录下载文件
public static boolean cmdFile(String path, File imageFile) {
boolean result = false;
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
Runtime.getRuntime().exec("net use \\10.6.0.74 his /user:his");
in = new BufferedInputStream(new FileInputStream(path));
out = new BufferedOutputStream(new FileOutputStream(imageFile));
byte[] buffer = new byte[1024];
while (in.read(buffer) != -1) {
out.write(buffer);
buffer = new byte[1024];
}
out.flush();
result = true;
} catch (IOException e) {
// FileUtils.deleteImageFile(imageFile);
logger.error("出错咯!错误信息:" + e);
} finally {
try {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
} catch (IOException e) {
// FileUtils.deleteImageFile(imageFile);
e.printStackTrace();
}
}
return result;
}
public static void main(String[] args) {
/* // String file_path = "D:/images/2019/7/25/456.txt";
// File file = new File(file_path);
try {
downLoadByUrl("http://localhost:8080/static/bootstrap/15abd8b4-794a-499a-ab03-abdf14cf331f.pdf","hahaha.pdf","D:/images/");
} catch (IOException e) {
e.printStackTrace();
}*/
Field[] fields = MedicalRecordHomepage.class.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
if (field.getGenericType().toString().equals(OperDetail.class.toString())) {
System.out.println(field.getName());
}
}
}
}

@ -1,103 +0,0 @@
package com.ann.demo.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.io.*;
import java.time.LocalDateTime;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
/**
*
*
* @Author: LeiJiaXin
* @Date: 2019/8/7 11:15
*/
@Component
public class PinYinUtils {
// 拼音路径
public static String path;
@Value("${file.pinyinPath}")
private String pathTemp;
@PostConstruct
public void init() {
path = pathTemp;
}
/**
* ,
*
* @param inputString
* @return
*/
public static String getPingYin(String inputString) {
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
String output = "";
try {
if (inputString != null && inputString.length() > 0
&& !"null".equals(inputString)) {
String substring = diffPro(inputString);
char[] input = substring.trim().toCharArray();
for (int i = 0; i < input.length; i++) {
if (Character.toString(input[i]).matches(
"[\\u4E00-\\u9FA5]+")) {
char temp = PinyinHelper.toHanyuPinyinStringArray(input[i], defaultFormat)[0].charAt(0);
output += temp + "";
} else {
output += Character.toString(input[i]);
}
}
} else {
return null;
}
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
return output;
}
/**
* pinyin.properties
*
* @param inputString
* @return
*/
private static String diffPro(String inputString) {
Properties properties = new Properties();
try {
InputStream inputStream = new BufferedInputStream(new FileInputStream(new File(path)));
properties.load(new InputStreamReader(inputStream, "utf-8"));
Set keyValue = properties.keySet();
for (Iterator it = keyValue.iterator(); it.hasNext(); ) {
String key = (String) it.next();
if (inputString.substring(0, key.length()).equals(key)) {
String value = inputString.substring(key.length(), inputString.length());
return properties.getProperty(key) + value;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return inputString;
}
public static void main(String[] args) {
System.out.println(LocalDateTime.now());
}
}

@ -1,124 +0,0 @@
package com.ann.demo.utils;
import com.ann.demo.entity.other.QuartzBean;
import org.quartz.*;
/**
* @Author: LeiJiaXin
* @Date: 2019/7/13 16:53
*/
public class QuartzUtils {
/**
*
*
* @param scheduler
* @param quartzBean
* @throws Exception
*/
public static void createScheduleJob(Scheduler scheduler, QuartzBean quartzBean) {
try {
//获取到定时任务的执行类 必须是类的绝对路径名称
//定时任务类需要是job类的具体实现 QuartzJobBean是job的抽象类。
Class<? extends Job> jobClass = (Class<? extends Job>) Class.forName(quartzBean.getJobClass());
// 构建定时任务信息
JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(quartzBean.getJobName()).build();
// 设置定时任务执行方式
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(quartzBean.getCronExpression());
// 构建触发器trigger
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(quartzBean.getJobName()).withSchedule(scheduleBuilder).build();
scheduler.scheduleJob(jobDetail, trigger);
} catch (ClassNotFoundException e) {
System.out.println("定时任务类路径出错:请输入类的绝对路径");
} catch (SchedulerException e) {
System.out.println("创建定时任务出错:" + e.getMessage());
}
}
/**
*
*
* @param scheduler
* @param jobName
* @throws SchedulerException
*/
public static void pauseScheduleJob(Scheduler scheduler, String groupName, String jobName) {
JobKey jobKey = JobKey.jobKey(jobName, groupName);
try {
scheduler.pauseJob(jobKey);
} catch (SchedulerException e) {
System.out.println("暂停定时任务出错:" + e.getMessage());
}
}
/**
*
*
* @param scheduler
* @param jobName
* @throws SchedulerException
*/
public static void resumeScheduleJob(Scheduler scheduler, String groupName, String jobName) {
JobKey jobKey = JobKey.jobKey(jobName, groupName);
try {
scheduler.resumeJob(jobKey);
} catch (SchedulerException e) {
System.out.println("启动定时任务出错:" + e.getMessage());
}
}
/**
*
*
* @param scheduler
* @param jobName
* @throws SchedulerException
*/
public static void runOnce(Scheduler scheduler, String jobName) {
JobKey jobKey = JobKey.jobKey(jobName);
try {
scheduler.triggerJob(jobKey);
} catch (SchedulerException e) {
System.out.println("运行定时任务出错:" + e.getMessage());
}
}
/**
*
*
* @param scheduler
* @param quartzBean
* @throws SchedulerException
*/
public static void updateScheduleJob(Scheduler scheduler, QuartzBean quartzBean) {
try {
//获取到对应任务的触发器
TriggerKey triggerKey = TriggerKey.triggerKey(quartzBean.getJobName());
//设置定时任务执行方式
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(quartzBean.getCronExpression());
//重新构建任务的触发器trigger
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
//重置对应的job
scheduler.rescheduleJob(triggerKey, trigger);
} catch (SchedulerException e) {
System.out.println("更新定时任务出错:" + e.getMessage());
}
}
/**
*
*
* @param scheduler
* @param jobName
* @throws SchedulerException
*/
public static void deleteScheduleJob(Scheduler scheduler, String jobName) {
JobKey jobKey = JobKey.jobKey(jobName);
try {
scheduler.deleteJob(jobKey);
} catch (SchedulerException e) {
System.out.println("删除定时任务出错:" + e.getMessage());
}
}
}

@ -78,6 +78,12 @@ public class XMLUtils {
@Value("${file.bedManagerPath}")
private String bedManagerPathTemp;
// 出院召回同步
public static String dischargeBackPath;
@Value("${file.dischargeBackPath}")
private String dischargeBackPathTemp;
@PostConstruct
public void init() {
path = pathTemp;
@ -87,97 +93,13 @@ public class XMLUtils {
transferRecordPath = transferRecordPathTemp;
dieMedicalAdvicePath = dieMedicalAdvicePathTemp;
bedManagerPath = bedManagerPathTemp;
dischargeBackPath = dischargeBackPathTemp;
}
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
// 病案首页独享
private static SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
/**
* xml
*/
public static String generateXmlStr(OutPara outPara) throws Exception{
Field[] fields = outPara.getClass().getDeclaredFields();
// 创建XML
Document document = DocumentHelper.createDocument();
Element response = document.addElement("RESPONSE");
for (Field field : fields) {
field.setAccessible(true);
response
.addElement(field.getName())
.addText(field.get(outPara).toString());
}
return document.getRootElement().asXML();
}
/**
* xml
*/
public static <T> T xmlStrToObject(String xmlStr, Class<T> type) throws Exception{
if (StringUtils.isEmpty(xmlStr)) {
return null;
}
Document doc = null; // 将xml格式的字符串转换成Document对象
T obj = null; // 创建 JavaBean 对象
obj = type.newInstance();
doc = DocumentHelper.parseText(xmlStr);
// 获取根节点
Element root = doc.getRootElement();
// 获取根节点下的所有元素
List children = root.elements();
// 循环所有子元素
if (children != null && children.size() > 0) {
for (int i = 0; i < children.size(); i++) {
Element child = (Element) children.get(i);
Field[] fields = obj.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
String fieldName = field.getName();
if (fieldName.equals(child.getName())) {
Type genericType = field.getGenericType();
Object[] args = new Object[1];
String value = child.getTextTrim();
// 赋值
PropertyDescriptor descriptor = new PropertyDescriptor(fieldName, type);
if (("java.lang.Integer").equals(genericType.getTypeName()) || genericType.getTypeName().equals("int")) {
if (value != null && value.length() > 0) {
args[0] = Integer.parseInt(value + "");
descriptor.getWriteMethod().invoke(obj, args);
}
} else if ((Date.class.getName()).equals(genericType.getTypeName())) {
descriptor.getWriteMethod().invoke(obj, simpleDateFormat.parse(value, new ParsePosition(0)));
} else if (("java.lang.Long").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("long")) {
if (value != null && value.length() > 0) {
args[0] = Long.parseLong(value + "");
descriptor.getWriteMethod().invoke(obj, args);
}
} else if (("java.lang.Boolean").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("boolean")) {
if (value != null && value.length() > 0) {
args[0] = Boolean.valueOf(value + "");
descriptor.getWriteMethod().invoke(obj, args);
}
} else if (("java.lang.Double").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("double")) {
if (value != null && value.length() > 0) {
args[0] = Double.parseDouble(value + "");
descriptor.getWriteMethod().invoke(obj, args);
}
} else if (("java.lang.Float").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("float")) {
if (value != null && value.length() > 0) {
args[0] = Float.parseFloat(value + "");
descriptor.getWriteMethod().invoke(obj, args);
}
} else {
descriptor.getWriteMethod().invoke(obj, value);
}
break;
}
}
}
}
return obj;
}
/**
* V3xml
*/
@ -326,6 +248,9 @@ public class XMLUtils {
case InterfaceName.DIE_MEDICAL_ADVICE: // 同步死亡医嘱
messageDto = new MessageDto(ArchiveMaster.class.getName(), new ArchiveMaster(), AliasName.DIE_MEDICAL_ADVICE, dieMedicalAdvicePath, source);
break;
case InterfaceName.PARAMETER_DISCHARGE_BACK: // 同步出院召回
messageDto = new MessageDto(ArchiveMaster.class.getName(), new ArchiveMaster(), AliasName.PARAMETER_DISCHARGE_BACK, dischargeBackPath, source);
break;
}
return messageDto;
}
@ -341,163 +266,4 @@ public class XMLUtils {
return null;
}
/**
* xml
*/
public static <T> T xmlStrToObject1(String xmlStr, Class<T> type) throws Exception{
if (StringUtils.isEmpty(xmlStr)) {
return null;
}
Document doc = null; // 将xml格式的字符串转换成Document对象
T obj = null; // 创建 JavaBean 对象 最外层对象
obj = type.newInstance();
doc = DocumentHelper.parseText(xmlStr);
// 获取根节点
Element root = doc.getRootElement();
// 获取根节点下的所有元素
List<Element> zeroElements = root.elements(); // 所有的节点 OperDetails
// 循环所有子元素
if (zeroElements != null && zeroElements.size() > 0) {
CommonTable commonTable = null;
CommonTable1 commonTable1 = null;
List<OperDetail> operDetails = null;
List<DiagDetail> diagDetails = null;
//20200525 新增其他节点,用于校验
OtherData otherData = null;
if (Objects.equals(type.toString(), MedicalRecordHomepage.class.toString())) {
commonTable = new CommonTable();
commonTable1 = new CommonTable1();
diagDetails = new ArrayList<>();
operDetails = new ArrayList<>();
otherData = new OtherData();
}
for (Element zeroElement : zeroElements) {
// Element zeroElement = (Element) zeroElements.get(i);
Field[] fields = obj.getClass().getDeclaredFields(); // MedicalRecordHomepage下的属性
String value = zeroElement.getTextTrim();
for (Field field : fields) {
field.setAccessible(true);
PropertyDescriptor descriptor = new PropertyDescriptor(field.getName(), type);
Class aClass = field.getType();
if (field.getName().toString().equals(zeroElement.getName()) && field.getName().equals("OperDetails")) {
List<Element> elements = zeroElement.elements(); // 如果节点下面有子节点 OperDetail1 OperDetail2
for (Element nextChild : elements) {
List<Element> finalElements = nextChild.elements(); // 子节点下面还有子节点 YZY201
OperDetail operDetail = new OperDetail();
Field[] operDetailFields = operDetail.getClass().getDeclaredFields();
for (Element finalElement : finalElements) {
value = finalElement.getTextTrim();
for (Field operDetailField : operDetailFields) {
operDetailField.setAccessible(true);
if (operDetailField.getName().equals(finalElement.getName())) {
operDetail = evaluation(operDetail, operDetailField, OperDetail.class, value);
break;
}
}
}
operDetails.add(operDetail);
}
// 给 MedicalRecordHomepage 属性 赋值
descriptor.getWriteMethod().invoke(obj, operDetails);
} else if (field.getName().toString().equals(zeroElement.getName()) && field.getName().equals("DiagDetails")) {
List<Element> elements = zeroElement.elements(); // 如果节点下面有子节点 OperDetail1 OperDetail2
for (Element nextChild : elements) {
List<Element> finalElements = nextChild.elements(); // 子节点下面还有子节点 YZY201
DiagDetail diagDetail = new DiagDetail();
Field[] diagDetailFields = diagDetail.getClass().getDeclaredFields();
for (Element finalElement : finalElements) {
value = finalElement.getTextTrim();
for (Field operDetailField : diagDetailFields) {
operDetailField.setAccessible(true);
if (operDetailField.getName().equals(finalElement.getName())) {
diagDetail = evaluation(diagDetail, operDetailField, DiagDetail.class, value);
break;
}
}
}
diagDetails.add(diagDetail);
}
// 给 MedicalRecordHomepage 属性 赋值
descriptor.getWriteMethod().invoke(obj, diagDetails);
} else {
if (field.getGenericType().toString().equals(CommonTable.class.toString())) {
Field[] commonTableFields = aClass.getDeclaredFields();
for (Field commonTableField : commonTableFields) {
commonTableField.setAccessible(true);
if (commonTableField.getName().equals(zeroElement.getName())) {
commonTable = evaluation(commonTable, commonTableField, aClass, value);
break;
}
}
descriptor.getWriteMethod().invoke(obj, commonTable);
} else if (field.getGenericType().toString().equals(CommonTable1.class.toString())) {
Field[] commonTable1Fields = aClass.getDeclaredFields();
for (Field commonTableField : commonTable1Fields) {
commonTableField.setAccessible(true);
if (commonTableField.getName().equals(zeroElement.getName())) {
commonTable1 = evaluation(commonTable1, commonTableField, aClass, value);
break;
}
}
descriptor.getWriteMethod().invoke(obj, commonTable1);
}else if (field.getGenericType().toString().equals(OtherData.class.toString())) {
Field[] commonTable1Fields = aClass.getDeclaredFields();
for (Field otherDataField : commonTable1Fields) {
otherDataField.setAccessible(true);
if (otherDataField.getName().equals(zeroElement.getName())) {
otherData = evaluation(otherData, otherDataField, aClass, value);
break;
}
}
descriptor.getWriteMethod().invoke(obj, otherData);
}
}
}
}
}
return obj;
}
private static <T> T evaluation(T obj, Field field, Class<T> type, String value) throws Exception {
// 赋值
String fieldName = field.getName();
Type genericType = field.getGenericType();
PropertyDescriptor descriptor = new PropertyDescriptor(fieldName, type);
if (("java.lang.Integer").equals(genericType.getTypeName()) || genericType.getTypeName().equals("int")) {
if (value != null && value.length() > 0) {
descriptor.getWriteMethod().invoke(obj, Integer.parseInt(value + ""));
}
} else if ((Date.class.getName()).equals(genericType.getTypeName())) {
if (value != null && value.length() > 0) {
Date parse = null;
parse = simpleDateFormat.parse(value, new ParsePosition(0));
if (parse == null) {
parse = simpleDateFormat1.parse(value, new ParsePosition(0));
}
descriptor.getWriteMethod().invoke(obj, parse);
}
} else if (("java.lang.Long").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("long")) {
if (value != null && value.length() > 0) {
descriptor.getWriteMethod().invoke(obj, Long.parseLong(value + ""));
}
} else if (("java.lang.Boolean").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("boolean")) {
if (value != null && value.length() > 0) {
descriptor.getWriteMethod().invoke(obj, Boolean.valueOf(value + ""));
}
} else if (("java.lang.Double").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("double")) {
if (value != null && value.length() > 0) {
descriptor.getWriteMethod().invoke(obj, Double.parseDouble(value + ""));
}
} else if (("java.lang.Float").equalsIgnoreCase(genericType.getTypeName()) || genericType.getTypeName().equals("float")) {
if (value != null && value.length() > 0) {
descriptor.getWriteMethod().invoke(obj, Float.parseFloat(value + ""));
}
} else {
descriptor.getWriteMethod().invoke(obj, value);
}
return obj;
}
}

@ -54,3 +54,4 @@ file:
pinyinPath: D:\\1\pinyin.properties
dieMedicalAdvicePath: D:\\1\dieMedicalAdvice.properties
bedManagerPath: D:\\1\bedManager.properties
dischargeBackPath: D:\\1\dischargeBack.properties

@ -5,7 +5,7 @@
<!-- 格式化输出:%date表示日期%thread表示线程名%-5level级别从左显示5个字符宽度 %msg日志消息%n是换行符-->
<property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
<!-- 定义日志存储的路径,不要配置相对路径 -->
<property name="FILE_PATH" value="D:/logs/%d{yyyy-MM-dd}/demo.%i.log"/>
<property name="FILE_PATH" value="D:/logs/%d{yyyy-MM-dd}/HISInterface.%i.log"/>
<!-- 控制台输出日志 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<!-- 日志级别过滤INFO以下 -->

@ -50,6 +50,7 @@
<option value="PatientRegistryReviseRequest">患者信息更新服务</option>
<option value="DieMedicalAdviceRequest">死亡医嘱</option>
<option value="BedManagerRequest">主管医生</option>
<option value="CalPatientOutRequest">出院召回</option>
</select>
</div>
</div>

Loading…
Cancel
Save