diff --git a/docus-webservice/dataConfig/homeQualitySet.json b/docus-webservice/dataConfig/homeQualitySet.json new file mode 100644 index 0000000..cb74ef8 --- /dev/null +++ b/docus-webservice/dataConfig/homeQualitySet.json @@ -0,0 +1,158 @@ +{ + "selectColumns":[ + { + "serialNumber": "1", + "tableName": "t_basic_sub", + "columnName": "healthy_card", + "qualityColumn": "VUID", + "byNull":0 + }, + { + "serialNumber": "2", + "tableName": "t_basic", + "columnName": "admiss_id", + "qualityColumn": "INHOSP_INDEX_NO", + "byNull":0 + }, + { + "serialNumber": "3", + "tableName": "t_basic", + "columnName": "inpatient_no", + "qualityColumn": "INHOSP_NO", + "byNull":0 + }, + { + "serialNumber": "4", + "tableName": "t_basic", + "columnName": "emp_id", + "qualityColumn": "EMPI_ID", + "byNull":0 + }, + { + "serialNumber": "5", + "tableName": "t_basic", + "columnName": "dis_date", + "qualityColumn": "DISCHARGE_DATETIME", + "byNull":0 + }, + { + "serialNumber": "6", + "tableName": "t_basic", + "columnName": "name", + "qualityColumn": "PAT_NAME", + "byNull":0 + }, + { + "serialNumber": "7", + "tableName": "t_basic", + "columnName": "admiss_times", + "qualityColumn": "VISIT_NO", + "byNull":0 + }, + { + "serialNumber": "8", + "tableName": "t_basic", + "columnName": "visit_type_code", + "qualityColumn": "VISIT_TYPE_CODE", + "byNull":0 + }, + { + "serialNumber": "9", + "tableName": "t_basic", + "columnName": "visit_type_name", + "qualityColumn": "VISIT_TYPE_NAME", + "byNull":0 + }, + { + "serialNumber": "10", + "tableName": "t_basic", + "columnName": "admiss_days", + "qualityColumn": "INHOSP_DAYS", + "byNull":0 + }, + { + "serialNumber": "11", + "tableName": "t_basic", + "columnName": "id_card", + "qualityColumn": "ID_NUMBER", + "byNull":0 + }, + { + "serialNumber": "12", + "tableName": "t_basic", + "columnName": "main_diag_code", + "qualityColumn": "WM_DIAG_CODE", + "byNull":0 + }, + { + "serialNumber": "13", + "tableName": "t_basic", + "columnName": "main_diag_name", + "qualityColumn": "WM_DIAG_NAME", + "byNull":0 + }, + { + "serialNumber": "14", + "tableName": "t_basic", + "columnName": "attending", + "qualityColumn": "WM_DIAG_DR_CODE", + "byNull":0 + }, + { + "serialNumber": "15", + "tableName": "t_basic", + "columnName": "attending_name", + "qualityColumn": "WM_DIAG_DR_NAME", + "byNull":0 + }, + { + "serialNumber": "16", + "tableName": "t_basic", + "columnName": "tcm_diag_code", + "qualityColumn": "TCM_DIAG_CODE", + "byNull":0 + }, + { + "serialNumber": "17", + "tableName": "t_basic", + "columnName": "tcm_diag_name", + "qualityColumn": "TCM_DIAG_NAME", + "byNull":0 + }, + { + "serialNumber": "18", + "tableName": "t_basic", + "columnName": "dis_dept", + "qualityColumn": "DEPT_CODE", + "byNull":1 + }, + { + "serialNumber": "19", + "tableName": "t_basic", + "columnName": "dis_dept_name", + "qualityColumn": "DEPT_NAME", + "byNull":1 + }, + { + "serialNumber": "20", + "tableName": "t_basic", + "columnName": "jzh", + "qualityColumn": "ACCOUNT_NUM", + "byNull":1 + }, + { + "serialNumber": "21", + "tableName": "t_basic", + "columnName": "ward_palce", + "qualityColumn": "SUBOR_HOSPITAL_DISTRICT", + "byNull":1 + }, + { + "serialNumber": "22", + "tableName": "t_basic", + "columnName": "admiss_dept", + "qualityColumn": "ADMIT_DEPT_COD", + "byNull":1 + } + ] +} \ No newline at end of file diff --git a/docus-webservice/lombok.config b/docus-webservice/lombok.config new file mode 100644 index 0000000..4f55f03 --- /dev/null +++ b/docus-webservice/lombok.config @@ -0,0 +1 @@ +lombok.var.flagUsage = ALLOW \ No newline at end of file diff --git a/docus-webservice/pom.xml b/docus-webservice/pom.xml index 57afefc..b0b3955 100644 --- a/docus-webservice/pom.xml +++ b/docus-webservice/pom.xml @@ -21,6 +21,7 @@ org.springframework.boot spring-boot-starter + org.dom4j dom4j @@ -37,6 +38,36 @@ fastjson 1.2.75 + + mysql + mysql-connector-java + 8.0.15 + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + 1.16.14 + + + com.spring4all + swagger-spring-boot-starter + 1.9.0.RELEASE + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.baomidou + mybatis-plus-boot-starter + 3.3.0 + org.springframework.boot spring-boot-starter-test diff --git a/docus-webservice/src/main/java/com/docus/webservice/DocusWebserviceApplication.java b/docus-webservice/src/main/java/com/docus/webservice/DocusWebserviceApplication.java index 074cf45..4a0574a 100644 --- a/docus-webservice/src/main/java/com/docus/webservice/DocusWebserviceApplication.java +++ b/docus-webservice/src/main/java/com/docus/webservice/DocusWebserviceApplication.java @@ -1,5 +1,6 @@ package com.docus.webservice; +import com.docus.webservice.run.RunServer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -7,6 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class DocusWebserviceApplication { public static void main(String[] args) { + System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); SpringApplication.run(DocusWebserviceApplication.class, args); } diff --git a/docus-webservice/src/main/java/com/docus/webservice/config/MybatisPlusConfig.java b/docus-webservice/src/main/java/com/docus/webservice/config/MybatisPlusConfig.java new file mode 100644 index 0000000..d438d46 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/config/MybatisPlusConfig.java @@ -0,0 +1,66 @@ +package com.docus.webservice.config; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties; +import com.baomidou.mybatisplus.core.MybatisConfiguration; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import lombok.RequiredArgsConstructor; +import lombok.experimental.var; +import org.apache.ibatis.logging.nologging.NoLoggingImpl; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import javax.annotation.PostConstruct; +import java.util.Objects; + +@Configuration +@RequiredArgsConstructor +@EnableTransactionManagement +@MapperScan("com.docus.webservice.mapper") +@ConditionalOnClass(value = {PaginationInterceptor.class}) +public class MybatisPlusConfig { + + + private final MybatisPlusProperties mybatisPlusProperties; + @Bean + public PaginationInterceptor paginationInterceptor() { + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + return paginationInterceptor; + } + + @PostConstruct + public void initMybatisConfig(){ + mybatisPlusProperties.setMapperLocations(new String[]{"classpath*:/mapper/*Mapper.xml"}); + mybatisPlusProperties.setTypeAliasesPackage("com.docus.webservice.entity"); + + MybatisConfiguration configuration = mybatisPlusProperties.getConfiguration(); + if(Objects.isNull(configuration)){ + configuration=new MybatisConfiguration(); + } + configuration.setMapUnderscoreToCamelCase(true); + configuration.setCacheEnabled(true); + configuration.setLogImpl(NoLoggingImpl.class); + mybatisPlusProperties.setConfiguration(configuration); + + var globalConfig = mybatisPlusProperties.getGlobalConfig(); + if(Objects.isNull(globalConfig)){ + globalConfig=new GlobalConfig(); + } + GlobalConfig.DbConfig dbConfig = globalConfig.getDbConfig(); + if(Objects.isNull(dbConfig)){ + dbConfig=new GlobalConfig.DbConfig(); + } + configuration.setCallSettersOnNulls(true); + dbConfig.setIdType(IdType.ASSIGN_ID); + dbConfig.setTableUnderline(true); + dbConfig.setLogicDeleteValue("1"); + dbConfig.setLogicNotDeleteValue("0"); + dbConfig.setLogicDeleteField("def_flag"); + globalConfig.setDbConfig(dbConfig); + globalConfig.setBanner(false); + } +} \ No newline at end of file diff --git a/docus-webservice/src/main/java/com/docus/webservice/config/WebServiceConfig.java b/docus-webservice/src/main/java/com/docus/webservice/config/WebServiceConfig.java new file mode 100644 index 0000000..9d22428 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/config/WebServiceConfig.java @@ -0,0 +1,30 @@ +package com.docus.webservice.config; + +import com.docus.webservice.enums.Codes; +import com.docus.webservice.handler.ITBasicWebService; +import com.docus.webservice.handler.TBasicWebService; +import com.sun.xml.internal.ws.transport.http.server.EndpointImpl; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.xml.ws.Endpoint; + +@Configuration +public class WebServiceConfig { + + //把实现类交给spring管理 + @Bean + public ITBasicWebService tBasicWebService() { + return new TBasicWebService(); + } + + @Bean + public Endpoint endpoint() { + System.out.println("-----------------------web service服务已发布-------------------------"); + String address = "http://localhost:" + Codes.EXTERNAL.getCode()+"/" + Codes.EXTERNAL.getMessage(); + Endpoint publish = Endpoint.publish(address, tBasicWebService()); + System.out.println(" "+address); + return publish; + } + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/dto/SelectColumn.java b/docus-webservice/src/main/java/com/docus/webservice/dto/SelectColumn.java new file mode 100644 index 0000000..9da2363 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/dto/SelectColumn.java @@ -0,0 +1,12 @@ +package com.docus.webservice.dto; + +import lombok.Data; + +@Data +public class SelectColumn { + private String serialNumber; + private String tableName; + private String columnName; + private String qualityColumn; + private Integer byNull; +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/entity/TBasic.java b/docus-webservice/src/main/java/com/docus/webservice/entity/TBasic.java new file mode 100644 index 0000000..6201523 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/entity/TBasic.java @@ -0,0 +1,155 @@ +package com.docus.webservice.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案基本信息 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="TBasic对象", description="病案基本信息") +public class TBasic implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "病案主键") + @TableId(value = "patient_id", type = IdType.ASSIGN_ID) + private String patientId; + + @ApiModelProperty(value = "住院次数") + private Integer admissTimes; + + @ApiModelProperty(value = "病案号") + private String inpatientNo; + + @ApiModelProperty(value = "住院ID号") + private String admissId; + + @ApiModelProperty(value = "患者姓名") + private String name; + + @ApiModelProperty(value = "盘号") + private String ph; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "年龄_岁") + private Integer age; + + @ApiModelProperty(value = "年龄_月") + private Integer ageMonth; + + @ApiModelProperty(value = "年龄_天") + private Integer ageDay; + + @ApiModelProperty(value = "身份证") + private String idCard; + + @ApiModelProperty(value = "手机号码") + private String telphone; + + @ApiModelProperty(value = "住院日期") + private Date admissDate; + + @ApiModelProperty(value = "住院科室") + private String admissDept; + + @ApiModelProperty(value = "住院科室名称") + private String admissDeptName; + + @ApiModelProperty(value = "出院日期") + private Date disDate; + + @ApiModelProperty(value = "出院科室") + private String disDept; + + @ApiModelProperty(value = "出院科室名称") + private String disDeptName; + + @ApiModelProperty(value = "实际住院天数") + private Integer admissDays; + + @ApiModelProperty(value = "主管医生") + private String attending; + + @ApiModelProperty(value = "主管医生名称") + private String attendingName; + + @ApiModelProperty(value = "主要诊断编码") + private String mainDiagCode; + + @ApiModelProperty(value = "主要诊断名称") + private String mainDiagName; + + @ApiModelProperty(value = "主要手术编码") + private String mainOperateCode; + + @ApiModelProperty(value = "主要手术名称") + private String mainOperateName; + + @ApiModelProperty(value = "是否死亡") + private Integer isDead; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "是否归档 1:已归档,0:未归档") + private Integer isArchive; + + @ApiModelProperty(value = "归档时间") + private Date archiveTime; + + @ApiModelProperty(value = "文件来源 1:af_archive_detail,2:t_scan_assort") + private Integer fileSource; + + @ApiModelProperty(value = "完整性描述") + private String integrityDesc; + + private String bColumn1; + + private String bColumn2; + + private String bColumn3; + + private String bColumn4; + + private String bColumn5; + + private Integer bColumn6; + + private Integer bColumn7; + + private Integer bColumn8; + + private Integer bColumn9; + + private Integer bColumn10; + + @ApiModelProperty(value = "姓名缩写(内部构成)") + private String nameSpell; + + @ApiModelProperty(value = "性别名称") + private String sexName; + + @ApiModelProperty(value = "记账号") + private String jzh; + + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/entity/TBasicSub.java b/docus-webservice/src/main/java/com/docus/webservice/entity/TBasicSub.java new file mode 100644 index 0000000..3f2cb9c --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/entity/TBasicSub.java @@ -0,0 +1,419 @@ +package com.docus.webservice.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 病案子表 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="TBasicSub对象", description="病案子表") +public class TBasicSub implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "病案主键") + @TableId(value = "patient_id", type = IdType.ASSIGN_ID) + private String patientId; + + @ApiModelProperty(value = "医疗付费方式") + private String payType; + + @ApiModelProperty(value = "健康卡号") + private String healthyCard; + + @ApiModelProperty(value = "出生日期") + private Date birthday; + + @ApiModelProperty(value = "国籍") + private String country; + + @ApiModelProperty(value = "民族") + private String nation; + + @ApiModelProperty(value = "新生儿出生体重") + private BigDecimal avoirdupois; + + @ApiModelProperty(value = "新生儿入院体重") + private BigDecimal birthbabyWeight; + + @ApiModelProperty(value = "出生地") + private String birthAddr; + + @ApiModelProperty(value = "籍贯") + private String nativePlace; + + @ApiModelProperty(value = "职业") + private String job; + + @ApiModelProperty(value = "婚况") + private String marriage; + + @ApiModelProperty(value = "现住邮编") + private String zip; + + @ApiModelProperty(value = "户口地址") + private String homeAddr; + + @ApiModelProperty(value = "家庭电话") + private String homeTel; + + @ApiModelProperty(value = "家庭邮编") + private String homeZip; + + @ApiModelProperty(value = "病人来源") + private String patientsSource; + + @ApiModelProperty(value = "工作单位及地址") + private String workAddr; + + @ApiModelProperty(value = "工作单位电话") + private String workTel; + + @ApiModelProperty(value = "工作单位住址邮编") + private String workZip; + + @ApiModelProperty(value = "联系人姓名") + private String linkman; + + @ApiModelProperty(value = "联系人关系") + private String relation; + + @ApiModelProperty(value = "关系人住址") + private String relAddr; + + @ApiModelProperty(value = "关系人电话") + private String relTel; + + @ApiModelProperty(value = "入院途径") + private String admissType; + + @ApiModelProperty(value = "入院病房") + private String admissWard; + + @ApiModelProperty(value = "出院病房") + private String disWard; + + @ApiModelProperty(value = "门(急)诊诊断") + private String clinicName; + + @ApiModelProperty(value = "门(急)诊诊断编码") + private String clinicDiag; + + @ApiModelProperty(value = "门(急)诊医生") + private String clinicDoctor; + + @ApiModelProperty(value = "病历分型") + private String caseType; + + @ApiModelProperty(value = "是否有临床路径病历") + private String isMedicalRecordPath; + + @ApiModelProperty(value = "抢救次数") + private String saveTimes; + + @ApiModelProperty(value = "抢救成功次数") + private String saveSuccessTimes; + + @ApiModelProperty(value = "损伤、中毒的外部原因") + private String injuryPoisoningCauses; + + @ApiModelProperty(value = "损伤、中毒的外部原因编码") + private String injuryPoisoningCausesDate; + + @ApiModelProperty(value = "病理诊断") + private String pathologyDiagName; + + @ApiModelProperty(value = "病理号") + private String pathologyDiagNum; + + @ApiModelProperty(value = "病理编码") + private String pathologyDiagCode; + + @ApiModelProperty(value = "是否药物过敏") + private String isMedicine; + + @ApiModelProperty(value = "药物过敏") + private String medicine; + + @ApiModelProperty(value = "是否死亡患者尸检") + private String emitPathology; + + @ApiModelProperty(value = "血型") + private String bloodType; + + @ApiModelProperty(value = "Rh") + @TableField("RH") + private String rh; + + @ApiModelProperty(value = "科主任") + private String deptDirector; + + @ApiModelProperty(value = "主任(副主任)医师") + private String director; + + @ApiModelProperty(value = "住院医师") + private String admissDoctor; + + @ApiModelProperty(value = "责任护士") + private String responsibleNurse; + + @ApiModelProperty(value = "进修医师") + private String refresher; + + @ApiModelProperty(value = "实习医师") + private String praxis; + + @ApiModelProperty(value = "编码员") + private String coding; + + @ApiModelProperty(value = "病案质量") + private String quality; + + @ApiModelProperty(value = "质控医师") + private String control; + + @ApiModelProperty(value = "质控护士") + private String nurses; + + @ApiModelProperty(value = "质控日期") + private Date qualityDate; + + @ApiModelProperty(value = "离院方式") + private String disType; + + @ApiModelProperty(value = "是否有出院31天内再住院计划") + private String isHospitalization; + + @ApiModelProperty(value = "出院31天内再住院目的") + private String hospitalizationObjective; + + @ApiModelProperty(value = "颅脑损伤患者昏迷时间入院前时间") + private String craniocerebralStarttime; + + @ApiModelProperty(value = "颅脑损伤患者昏迷时间入院后时间") + private String craniocerebralEndtime; + + @ApiModelProperty(value = "肿瘤分期类型") + private String tumorStagingType; + + @ApiModelProperty(value = "方式(放疗)") + private String radiotherapyType; + + @ApiModelProperty(value = "程式(放疗)") + private String radiotherapyProgram; + + @ApiModelProperty(value = "装置(放疗)") + private String radiotherapyDevice; + + @ApiModelProperty(value = "肿瘤诊断类型") + private String tumorDiagType; + + @ApiModelProperty(value = "放疗服药期间天数") + private Integer primaryTumorDay; + + @ApiModelProperty(value = "放疗服药期间每天次数") + private Integer primaryTumorTimes; + + @ApiModelProperty(value = "放疗服药期间每次剂量") + private Integer primaryTumorDose; + + @ApiModelProperty(value = "放疗服药起始日期") + private String primaryTumorStarttime; + + @ApiModelProperty(value = "放疗服药终止日期") + private String primaryTumorEndtime; + + @ApiModelProperty(value = "化疗方式") + private String chemotherapyType; + + @ApiModelProperty(value = "化疗方法") + private String chemotherapyMethod; + + @ApiModelProperty(value = "主要入院病情") + private String mainAdmissThing; + + @ApiModelProperty(value = "主要手术日期") + private Date mainOperateDate; + + @ApiModelProperty(value = "主要手术麻醉方式") + private String mainAnaesthesiaType; + + @ApiModelProperty(value = "主要手术级别") + private String mainOperateClass; + + @ApiModelProperty(value = "主要手术术者") + private String mainOperator; + + @ApiModelProperty(value = "院内感染病名") + private String taintName; + + @ApiModelProperty(value = "其他诊断") + private String otherDiagName; + + @ApiModelProperty(value = "终审时间") + private String finalJudgmentName; + + @ApiModelProperty(value = "是否已扫描") + private String isScan; + + @ApiModelProperty(value = "光点号") + private String gdh; + + private String bsColumn1; + + private String bsColumn2; + + private String bsColumn3; + + private String bsColumn4; + + private String bsColumn5; + + private Integer bsColumn6; + + private Integer bsColumn7; + + private Integer bsColumn8; + + private Integer bsColumn9; + + private Integer bsColumn10; + + @ApiModelProperty(value = "医疗付费方式名称") + private String payTypeName; + + @ApiModelProperty(value = "国籍名称") + private String countryName; + + @ApiModelProperty(value = "民族名称") + private String nationName; + + @ApiModelProperty(value = "籍贯名称") + private String nativePlaceName; + + @ApiModelProperty(value = "职业名称") + private String jobName; + + @ApiModelProperty(value = "婚况名称") + private String marriageName; + + @ApiModelProperty(value = "联系人关系名称") + private String relationName; + + @ApiModelProperty(value = "入院途径名称") + private String admissTypeName; + + @ApiModelProperty(value = "入院病房名称") + private String admissWardName; + + @ApiModelProperty(value = "出院病房名称") + private String disWardName; + + @ApiModelProperty(value = "门(急)诊医生名称") + private String clinicDoctorName; + + @ApiModelProperty(value = "病历分型名称") + private String caseTypeName; + + @ApiModelProperty(value = "科主任名称") + private String deptDirectorName; + + @ApiModelProperty(value = "主任(副主任)医师名称") + private String directorName; + + @ApiModelProperty(value = "住院医师名称") + private String admissDoctorName; + + @ApiModelProperty(value = "责任护士名称") + private String responsibleNurseName; + + @ApiModelProperty(value = "进修医师名称") + private String refresherName; + + @ApiModelProperty(value = "实习医师名称") + private String praxisName; + + @ApiModelProperty(value = "编码员名称") + private String codingName; + + @ApiModelProperty(value = "病案质量名称") + private String qualityName; + + @ApiModelProperty(value = "质控医师名称") + private String controlName; + + @ApiModelProperty(value = "质控护士名称") + private String nursesName; + + @ApiModelProperty(value = "离院方式名称") + private String disTypeName; + + @ApiModelProperty(value = "是否有出院31天内再住院计划名称") + private String isHospitalizationName; + + @ApiModelProperty(value = "肿瘤分期类型名称") + private String tumorStagingTypeName; + + @ApiModelProperty(value = "方式(放疗)名称") + private String radiotherapyTypeName; + + @ApiModelProperty(value = "程式(放疗)名称") + private String radiotherapyProgramName; + + @ApiModelProperty(value = "装置(放疗)名称") + private String radiotherapyDeviceName; + + @ApiModelProperty(value = "化疗方式名称") + private String chemotherapyTypeName; + + @ApiModelProperty(value = "化疗方法名称") + private String chemotherapyMethodName; + + @ApiModelProperty(value = "主要入院病情名称") + private String mainAdmissThingName; + + @ApiModelProperty(value = "主要手术麻醉方式名称") + private String mainAnaesthesiaTypeName; + + @ApiModelProperty(value = "主要手术级别名称") + private String mainOperateClassName; + + @ApiModelProperty(value = "主要手术术者名称") + private String mainOperatorName; + + + @ApiModelProperty(value = "其他诊断编码") + private String otherDiagCode; + + @ApiModelProperty(value = "rh名称") + private String rhName; + @ApiModelProperty(value = "血型名称") + private String bloodTypeName; + @ApiModelProperty(value = "是否药物过敏名称") + private String isMedicineName; + @ApiModelProperty(value = "是否死亡患者尸检名称") + private String emitPathologyName; + @ApiModelProperty(value = "是否有临床路径病历名称") + private String isMedicalRecordPathName; + @ApiModelProperty(value = "肿瘤诊断类型名称") + private String tumorDiagTypeName; + + + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/entity/Codes.java b/docus-webservice/src/main/java/com/docus/webservice/enums/Codes.java similarity index 70% rename from docus-webservice/src/main/java/com/docus/webservice/entity/Codes.java rename to docus-webservice/src/main/java/com/docus/webservice/enums/Codes.java index fb29ce4..17df7f1 100644 --- a/docus-webservice/src/main/java/com/docus/webservice/entity/Codes.java +++ b/docus-webservice/src/main/java/com/docus/webservice/enums/Codes.java @@ -1,4 +1,4 @@ -package com.docus.webservice.entity; +package com.docus.webservice.enums; /** * 代码库 @@ -9,7 +9,9 @@ public enum Codes { RESPONSE("100","Response"), RET_INFO("101","RetInfo"), RET_CODE("102","RetCode"), - RET_CON("103","RetCon"); + RET_CON("103","RetCon"), + EXTERNAL("9999","201_P_WS_JYBGTS"), + JSON_ADDRESS("999",System.getProperty("user.dir")+"\\docus-webservice\\dataConfig\\homeQualitySet.json"); //代码 private String code; //描述 diff --git a/docus-webservice/src/main/java/com/docus/webservice/handler/ITBasicWebService.java b/docus-webservice/src/main/java/com/docus/webservice/handler/ITBasicWebService.java new file mode 100644 index 0000000..920afb3 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/handler/ITBasicWebService.java @@ -0,0 +1,16 @@ +package com.docus.webservice.handler; + +import javax.jws.WebMethod; +import javax.jws.WebService; + +@WebService +public interface ITBasicWebService { + + /** + * 检验报告推送 + * @param tbasic + * @return + */ + @WebMethod + String savaAndSub(String tbasic); +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/handler/TBasicWebService.java b/docus-webservice/src/main/java/com/docus/webservice/handler/TBasicWebService.java new file mode 100644 index 0000000..ec7585a --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/handler/TBasicWebService.java @@ -0,0 +1,95 @@ +package com.docus.webservice.handler; + + +import com.alibaba.fastjson.JSON; +import com.docus.webservice.dto.SelectColumn; +import com.docus.webservice.enums.Codes; +import com.docus.webservice.entity.TBasic; +import com.docus.webservice.entity.TBasicSub; +import com.docus.webservice.mapper.TBasicMapper; +import com.docus.webservice.mapper.TBasicSubMapper; +import com.docus.webservice.utils.JsonUtils; +import com.docus.webservice.utils.ResultUtils; +import com.docus.webservice.utils.XmlUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.jws.WebService; +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +@WebService +public class TBasicWebService implements ITBasicWebService { + + @Autowired + private TBasicMapper tBasicMapper; + + @Autowired + private TBasicSubMapper tBasicSubMapper; + + + @Override + public String savaAndSub(String tbasic) { + XmlUtils xmlUtils = null; + String resXml; + try { + //解析xml + xmlUtils = new XmlUtils(new ByteArrayInputStream(tbasic.getBytes("UTF-8"))); + //解析json映射文件 + String json = JsonUtils.readJsonFile(Codes.JSON_ADDRESS.getMessage()); + Map jsonMap = JSON.parseObject(json, Map.class); + HashMap tBasicMap = new HashMap<>(); + HashMap tBasicSubMap = new HashMap<>(); + List selectColumns = JSON.parseArray(String.valueOf(jsonMap.get("selectColumns")), SelectColumn.class); + String value; + for (SelectColumn selectColumn : selectColumns) { + try { + value = String.valueOf(xmlUtils.getElementText(selectColumn.getQualityColumn())); + }catch (RuntimeException e){ + String message = e.getMessage(); + System.out.println(message); + return ResultUtils.fail(message); + } + if (StringUtils.isBlank(value)) { + if (selectColumn.getByNull() == 0) { + return ResultUtils.fail(selectColumn.getQualityColumn() + " 字段不能为空值"); + } else { + continue; + } + } else { + if (selectColumn.getTableName().equals("t_basic")) { + tBasicMap.put(selectColumn.getColumnName(), value); + } + if (selectColumn.getTableName().equals("t_basic_sub")) { + tBasicSubMap.put(selectColumn.getColumnName(), value); + } + } + } + //处理业务 + TBasic tBasic = new TBasic(); + + int insert; + if (tBasicMap != null && tBasicMap.size() > 0) { + tBasic=JsonUtils.map2bean(tBasicMap,TBasic.class); +// insert = tBasicMapper.insert(tBasic); +// if (insert <= 0) { +// return ResultUtils.fail("数据库执行出错,请重试"); +// } + TBasicSub tBasicSub = new TBasicSub(); +// BeanUtils.copyProperties(tBasicSubMap, tBasicSub); + tBasicSub=JsonUtils.map2bean(tBasicSubMap,TBasicSub.class); + tBasicSub.setPatientId(tBasic.getPatientId()); +// insert = tBasicSubMapper.insert(tBasicSub); +// if (insert <= 0) { +// return ResultUtils.fail("数据库执行出错,请重试"); +// } + } + } catch (Exception e) { + e.printStackTrace(); + return ResultUtils.fail(); + } + return ResultUtils.success().asXML(); + } +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/mapper/TBasicMapper.java b/docus-webservice/src/main/java/com/docus/webservice/mapper/TBasicMapper.java new file mode 100644 index 0000000..d7c4dca --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/mapper/TBasicMapper.java @@ -0,0 +1,17 @@ +package com.docus.webservice.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.webservice.entity.TBasic; + +/** + *

+ * 病案基本信息 Mapper 接口 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +public interface TBasicMapper extends BaseMapper { + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/mapper/TBasicSubMapper.java b/docus-webservice/src/main/java/com/docus/webservice/mapper/TBasicSubMapper.java new file mode 100644 index 0000000..a48152d --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/mapper/TBasicSubMapper.java @@ -0,0 +1,17 @@ +package com.docus.webservice.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.webservice.entity.TBasicSub; + +/** + *

+ * 病案子表 Mapper 接口 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +public interface TBasicSubMapper extends BaseMapper { + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/run/RunServer.java b/docus-webservice/src/main/java/com/docus/webservice/run/RunServer.java new file mode 100644 index 0000000..03dc0d8 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/run/RunServer.java @@ -0,0 +1,21 @@ +package com.docus.webservice.run; + +import com.docus.webservice.enums.Codes; +import com.docus.webservice.handler.TBasicWebService; +import org.springframework.stereotype.Component; + +import javax.xml.ws.Endpoint; + +/** + * 启动服务 + */ +public class RunServer { + + public void run() { + String address = "http://localhost:" + Codes.EXTERNAL.getCode()+"/" + Codes.EXTERNAL.getMessage(); + Endpoint.publish(address, new TBasicWebService()); + System.out.println("publish success..."); + System.out.println(address); + } + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/utils/JsonUtils.java b/docus-webservice/src/main/java/com/docus/webservice/utils/JsonUtils.java new file mode 100644 index 0000000..f091170 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/utils/JsonUtils.java @@ -0,0 +1,101 @@ +package com.docus.webservice.utils; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; + +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.io.*; +import java.util.Date; +import java.util.Map; + +/** + * json工具类 + */ +public class JsonUtils { + + /** + * 读取json文件方法 + * @param fileName:json文件存在的本地地址 + * @return + */ + public static String readJsonFile(String fileName) { + String jsonStr = ""; + Reader reader=null; + FileReader fileReader=null; + try { + File jsonFile = new File(fileName); + fileReader = new FileReader(jsonFile); + reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8"); + int ch = 0; + StringBuffer sb = new StringBuffer(); + while ((ch = reader.read()) != -1) { + sb.append((char) ch); + } + fileReader.close(); + reader.close(); + jsonStr = sb.toString(); + return jsonStr; + } catch (IOException e) { + e.printStackTrace(); + return null; + }finally { + try { + reader.close(); + fileReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + private final static String STRINGCLASS = ""; + private final static Long LONGCLASS = new Long(0); + private final static Date DATECLASS = new Date(); + + /** + * 将Map集合中的数据封装到JavaBean对象中 + * map的key为全小写 + * bean属性驼峰 + * @param map 集合 + * @param classType 封装javabean对象 + * @return + * @throws Exception + */ + public static T map2bean(Map map, Class classType) throws Exception { + // 1 采用反射动态创建对象 + T obj = classType.newInstance(); + + // 2 获取对象字节码信息,不要Object的属性 + BeanInfo beanInfo = Introspector.getBeanInfo(classType,Object.class); + + // 3 获取bean对象中的所有属性 + PropertyDescriptor[] list = beanInfo.getPropertyDescriptors(); + for (PropertyDescriptor pd : list) { + // 3.1 获取属性名 + String key = pd.getName(); + + // 3.2 获取属性值:属性值在map中全部存的小写 + Object value = map.get(key.toLowerCase()); + + // 3.3 转换数据类型 + if (value != null && StringUtils.isNotBlank(value.toString())) { + Class propertyType = pd.getPropertyType(); + if (propertyType.isInstance(STRINGCLASS)) { // 转换成String类型 + value = (String) value; + } + if (propertyType.isInstance(LONGCLASS)) { // 转换成Long类型 + value = Long.parseLong((String) value); + } + if (propertyType.isInstance(DATECLASS)) {// 转换成日期类型 + value = DateUtils.parseDate((String) value); + } + + pd.getWriteMethod().invoke(obj, propertyType.cast(value)); //调用属性setter()方法,设置到javabean对象当中 + } + } + return obj; + } + +} diff --git a/docus-webservice/src/main/java/com/docus/webservice/entity/ResultUtils.java b/docus-webservice/src/main/java/com/docus/webservice/utils/ResultUtils.java similarity index 60% rename from docus-webservice/src/main/java/com/docus/webservice/entity/ResultUtils.java rename to docus-webservice/src/main/java/com/docus/webservice/utils/ResultUtils.java index 7b6c067..aa1da7e 100644 --- a/docus-webservice/src/main/java/com/docus/webservice/entity/ResultUtils.java +++ b/docus-webservice/src/main/java/com/docus/webservice/utils/ResultUtils.java @@ -1,5 +1,7 @@ -package com.docus.webservice.entity; +package com.docus.webservice.utils; +import com.docus.webservice.enums.Codes; +import org.apache.commons.lang3.StringUtils; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; @@ -11,11 +13,10 @@ public class ResultUtils { /** * 通过document对象返回节点对象 * @param response - * @param name * @return */ - public static Element getElement(Element response,String name){ - Element element = response.elementByID(name); + public static Element getElement(Document response){ + Element element = response.getRootElement(); return element; } @@ -43,7 +44,7 @@ public class ResultUtils { * 失败返回 * @return */ - public static Document fail(){ + public static String fail(){ // 1、创建document对象 Document document= DocumentHelper.createDocument(); //2.创建根节点 @@ -56,7 +57,27 @@ public class ResultUtils { //赋值 resCode.setText(String.valueOf(Codes.ERROR.getCode())); retCon.setText(Codes.ERROR.getMessage()); - return document; + return document.asXML(); + } + + /** + * 失败返回 + * @return + */ + public static String fail(String message){ + // 1、创建document对象 + Document document= DocumentHelper.createDocument(); + //2.创建根节点 + Element response=document.addElement(Codes.RESPONSE.getMessage()); + // 3、生成子节点及子节点内容 + Element RetInfo = response.addElement(Codes.RET_INFO.getMessage()); + //4.生成代码和描述节点 + Element resCode = RetInfo.addElement(Codes.RET_CODE.getMessage()); + Element retCon = RetInfo.addElement(Codes.RET_CON.getMessage()); + //赋值 + resCode.setText(String.valueOf(Codes.ERROR.getCode())); + retCon.setText(StringUtils.isNotBlank(message)?message:Codes.ERROR.getMessage()); + return document.asXML(); } } diff --git a/docus-webservice/src/main/java/com/docus/webservice/utils/XmlUtils.java b/docus-webservice/src/main/java/com/docus/webservice/utils/XmlUtils.java new file mode 100644 index 0000000..3d88356 --- /dev/null +++ b/docus-webservice/src/main/java/com/docus/webservice/utils/XmlUtils.java @@ -0,0 +1,65 @@ +package com.docus.webservice.utils; + +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; + +import java.io.InputStream; + +public class XmlUtils { + //定义解析器和文档对象 + private SAXReader saxReader; + private Document document; + + public XmlUtils(String path) { + //获取解析器 + saxReader = new SAXReader(); + try { + //获取文档对象 + document = saxReader.read(path); + } catch (DocumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public XmlUtils(InputStream path) { + //获取解析器 + saxReader = new SAXReader(); + try { + //获取文档对象 + document = saxReader.read(path); + } catch (DocumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 根据节点名称获取内容 + * + * @param name 节点名称 + * @return 节点内容 + */ + public String getElementText(String name) { + //定位根节点 + Element root = document.getRootElement(); + //根据名称定位节点 + Element msg = root.element("Msg"); + if(msg==null){ + throw new RuntimeException("没有Msg节点"); + } + Element patInfo = msg.element("PatInfo"); + if(patInfo==null){ + throw new RuntimeException("没有PatInfo节点"); + } + Element element = patInfo.element(name); + if(element==null){ + return null; + } + //返回节点内容 + return element.getText(); + } + +} diff --git a/docus-webservice/src/main/resources/application.yml b/docus-webservice/src/main/resources/application.yml new file mode 100644 index 0000000..66920af --- /dev/null +++ b/docus-webservice/src/main/resources/application.yml @@ -0,0 +1,19 @@ +server: + port: 9696 + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + field-strategy: NOT_EMPTY + db-type: MYSQL + +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: docus + password: docus702 + url: jdbc:mysql://db.docus.cn:3306/docus_medicalrecord?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true \ No newline at end of file diff --git a/docus-webservice/src/main/resources/mapper/TBasicMapper.xml b/docus-webservice/src/main/resources/mapper/TBasicMapper.xml new file mode 100644 index 0000000..1a8abd2 --- /dev/null +++ b/docus-webservice/src/main/resources/mapper/TBasicMapper.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/docus-webservice/src/main/resources/mapper/TBasicSubMapper.xml b/docus-webservice/src/main/resources/mapper/TBasicSubMapper.xml new file mode 100644 index 0000000..733b064 --- /dev/null +++ b/docus-webservice/src/main/resources/mapper/TBasicSubMapper.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file