diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/PcerteTypeIdEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/PcerteTypeIdEnums.java new file mode 100644 index 0000000..b61af1a --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/PcerteTypeIdEnums.java @@ -0,0 +1,65 @@ +package com.lyms.platform.common.enums; + +import com.lyms.platform.common.utils.StringUtils; + +/** + * 卫生信息数据-附件2 + * 民族STD_PERSON_ID_TYPE + */ +public enum PcerteTypeIdEnums { + Nation01("01", "身份证/居民身份证"), + Nation02("02", "居民户口簿"), + Nation03("03", "护照"), + Nation04("04", "军官证"), + Nation05("05", "驾驶证"), + Nation06("06", "港澳居民来往内地通行证"), + Nation07("07", "台湾居民来往内地通行证"), + Nation08("99", "其他法定有效证件"); + + + PcerteTypeIdEnums(String id, String name) { + this.id = id; + this.name = name; + } + + + public static String getName(String id) { + if(StringUtils.isEmpty(id)) return "身份证"; + PcerteTypeIdEnums[] values = PcerteTypeIdEnums.values(); + for (PcerteTypeIdEnums value : values) { + if (value.getId().equals(id)) { + return value.getName(); + } + } + return "身份证"; + } + public static String getId(String name) { + if(StringUtils.isEmpty(name)) return "01";//(传空的话默认01) + PcerteTypeIdEnums[] values = PcerteTypeIdEnums.values(); + for (PcerteTypeIdEnums value : values) { + if (value.getName().contains(name)) { + return value.getId(); + } + } + return "01"; + } + private String id; + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/PcountryEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/PcountryEnums.java new file mode 100644 index 0000000..b954206 --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/PcountryEnums.java @@ -0,0 +1,58 @@ +package com.lyms.platform.common.enums; + +import com.lyms.platform.common.utils.StringUtils; + +/** + * 卫生信息数据-附件2 + * 国籍STD_COUNTRY + */ +public enum PcountryEnums { + Career1("156", "中国"), + Career2("004", "阿富汗"); + + PcountryEnums(String id, String name) { + this.id = id; + this.name = name; + } + + + public static String getName(String id) { + if(StringUtils.isEmpty(id)) return "中国"; + PcountryEnums[] values = PcountryEnums.values(); + for (PcountryEnums value : values) { + if (value.getId().equals(id)) { + return value.getName(); + } + } + return "中国"; + } + public static String getId(String name) { + if(StringUtils.isEmpty(name)) return "156"; + PcountryEnums[] values = PcountryEnums.values(); + for (PcountryEnums value : values) { + if (value.getName().contains(name)) { + return value.getId(); + } + } + return "156";//没有匹配到,默认中国 + } + private String id; + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/platform-common/src/main/java/com/lyms/platform/common/enums/PprofessionTypeEnums.java b/platform-common/src/main/java/com/lyms/platform/common/enums/PprofessionTypeEnums.java new file mode 100644 index 0000000..b5fd7c8 --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/enums/PprofessionTypeEnums.java @@ -0,0 +1,88 @@ +package com.lyms.platform.common.enums; + +import com.lyms.platform.common.utils.StringUtils; + +/** + * 卫生信息数据-附件2 + * 职业类别STD_OCCUPATION + */ +public enum PprofessionTypeEnums { + Career1("0", "国家机关人员"), + Career2("0-3", "党群组织负责人"), + Career3("0-4", "事业单位负责人"), + Career4("1-9", "医生"), + Career5("2-4", "教师"), + Career6("1-98", "护士"), + Career7("3-1", "办公文员"), + Career8("4-9", "商业、服务业人员"), + Career9("5-9", "农、林、牧、渔、水利业生产人员"), + Career10("9-9", "司机"), + Career11("X", "军人"), + Career12("2-31", "法官"), + Career13("2-33", "律师"), + Career14("2-32", "检察官"), + Career15("3-21", "警察"), + Career16("2-2", "金融从业人员"), + Career17("0-41", "校长"), + Career18("1-9", "卫生单位负责人"), + Career19("0-5", "企业经理"), + Career20("4", "经济业务人员"), + Career21("2-6", "运动员"), + Career22("1-1", "科学研究人员"), + Career23("1-5", "工程技术人员"), + Career24("2-5", "设计师"), + Career25("1-41", "航天员"), + Career26("Y", "其他"), + Career27("2-4", "教师/公务员/职员"), + Career28("5-9", "农民"), + Career29("8-8", "工人"), + Career30("4-9", "服务业"), + Career31("4-9", "经商"), + Career32("Y", "家务"); + + PprofessionTypeEnums(String id, String name) { + this.id = id; + this.name = name; + } + + + public static String getName(String id) { + if(StringUtils.isEmpty(id)) return "不便分类的其他从业人员"; + PprofessionTypeEnums[] values = PprofessionTypeEnums.values(); + for (PprofessionTypeEnums value : values) { + if (value.getId().equals(id)) { + return value.getName(); + } + } + return "不便分类的其他从业人员"; + } + public static String getId(String name) { + if(StringUtils.isEmpty(name)) return "Y"; + PprofessionTypeEnums[] values = PprofessionTypeEnums.values(); + for (PprofessionTypeEnums value : values) { + if (value.getName().contains(name)) { + return value.getId(); + } + } + return "Y";//没有匹配到,不便分类的其他从业人员 + } + private String id; + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdGwInterface.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdGwInterface.java index ddf8d2b..97cbd26 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdGwInterface.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdGwInterface.java @@ -3,8 +3,7 @@ package com.lyms.hospitalapi.cdfy; import com.alibaba.fastjson.JSONObject; import com.lyms.platform.biz.service.*; import com.lyms.platform.common.constants.ErrorCodeConstants; -import com.lyms.platform.common.enums.RenShenJieJuEnums; -import com.lyms.platform.common.enums.YnEnums; +import com.lyms.platform.common.enums.*; import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.common.result.BaseResponse; import com.lyms.platform.common.utils.*; @@ -202,7 +201,7 @@ public class CdGwInterface { ps.setString(5,patient.getUsername()); ps.setString(6,"2"); ps.setDate(7, new Date(patient.getBirth().getTime())); - ps.setString(8,"01"); + ps.setString(8,getPcerteType(patient.getPcerteTypeId())); ps.setString(9,patient.getCardNo()); ps.setString(10,patient.getPworkUnit()); ps.setString(11,patient.getPhone()); @@ -211,8 +210,8 @@ public class CdGwInterface { ps.setString(14,maternalInfo.getNationalityCode()); ps.setString(15,"5"); ps.setString(16,"4"); - ps.setString(17,null); - ps.setString(18,patient.getPprofessionTypeId()); + ps.setString(17,"90"); + ps.setString(18,getPprofessionTypeName(patient.getPprofessionTypeId())); ps.setString(19,"20"); ps.setString(20,"0"); ps.setString(21,"0"); @@ -224,7 +223,11 @@ public class CdGwInterface { ps.setString(27,null); //ps.setString(28,"0"); // ps.setDate(28, new Date(patient.getModified().getTime())); - ps.setString(28, patient.getYn().toString()); + if(null!=patient.getYn()){ + ps.setString(28, patient.getYn()==1?"0":"1"); + }else { + ps.setString(28,"1"); + } int inResult = ps.executeUpdate(); if (inResult > 0) { @@ -236,12 +239,16 @@ public class CdGwInterface { ps.setString(5,hjShi); ps.setString(6,hjXian); ps.setString(7,hjXiang); - ps.setString(8,patient.getAddress()); + ps.setString(8,"");//村没有。不能拆分 ps.setString(9,patient.getAddress()); ps.setString(10,null); //ps.setString(11,"0"); // ps.setDate(11, new Date(patient.getModified().getTime())); - ps.setString(11, patient.getYn().toString()); + if(null!=patient.getYn()){ + ps.setString(11, patient.getYn()==1?"0":"1"); + }else { + ps.setString(11,"1"); + } int adress01 = ps.executeUpdate(); if (adress01 > 0) { @@ -253,12 +260,16 @@ public class CdGwInterface { ps.setString(5,jzShi); ps.setString(6,jzXian); ps.setString(7,jzXiang); - ps.setString(8,patient.getAddressRegister()); + ps.setString(8,"");//村没有。不能拆分 ps.setString(9,patient.getAddressRegister()); ps.setString(10,null); //ps.setString(11,"0"); // ps.setDate(11, new Date(patient.getModified().getTime())); - ps.setString(11, patient.getYn().toString()); + if(null!=patient.getYn()){ + ps.setString(11, patient.getYn()==1?"0":"1"); + }else { + ps.setString(11,"1"); + } int adress03 = ps.executeUpdate(); if (adress03 > 0) { @@ -270,12 +281,16 @@ public class CdGwInterface { ps.setString(5,chShi); ps.setString(6,chXian); ps.setString(7,chXiang); - ps.setString(8,patient.getAddressPostRest()); + ps.setString(8,"");//村没有。不能拆分 ps.setString(9,patient.getAddressPostRest()); ps.setString(10,null); //ps.setString(11,"0"); // ps.setDate(11, new Date(patient.getModified().getTime())); - ps.setString(11, patient.getYn().toString()); + if(null!=patient.getYn()){ + ps.setString(11, patient.getYn()==1?"0":"1"); + }else { + ps.setString(11,"1"); + } int adress07 = ps.executeUpdate(); if (adress07 > 0) { br.setErrorcode(ErrorCodeConstants.SUCCESS); @@ -598,63 +613,69 @@ public class CdGwInterface { return br; } + //户籍地址 + String hjSheng = CommonsHelper.getName1(patients.getProvinceId(), basicConfigService); + String hjShi = CommonsHelper.getName1(patients.getCityId(), basicConfigService); + String hjXian = CommonsHelper.getName1(patients.getAreaId(), basicConfigService); + String hjXiang = CommonsHelper.getName1(patients.getStreetId(), basicConfigService); + + //居住地址 + String jzSheng = CommonsHelper.getName1(patients.getProvinceRegisterId(), basicConfigService); + String jzShi = CommonsHelper.getName1(patients.getCityRegisterId(), basicConfigService); + String jzXian = CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService); + String jzXiang = CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService); //冠鑫孕产登记(智业WOMAN_PREGNANCY_DIAG) String inSqlDiag = "insert into WOMAN_PREGNANCY_DIAG(LAST_UPDATE_DTIME,ORG_CODE,PATIENT_ID,ORG_FORM_NO," + - "NAME,PRESENT_VILLAGE,TEL_NO,EMPLOYER_NAME,WEIGHT,MENSES_LAST_DATE,EXPECTED_TIEM,GRAVIDITY," + - "PARITY,SPONTANEOUS_ABORTION,INDUCED_ABORTION,HUSBAND_NAME,DIAGNOSIS_DATE,CREATE_DATE) " + - "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + "NAME,AGE,BIRTH_DATE,ID_TYPE_CODE,ID_NO,HOUSEHOLD_ADDRESS,HOUSEHOLD_PROVINCE,HOUSEHOLD_CITY,HOUSEHOLD_COUNTY, " + + "HOUSEHOLD_TOWN,HOUSEHOLD_VILLAGE,PRESENT_ADDRESS,PRESENT_PROVINCE,PRESENT_CITY,PRESENT_COUNTY,PRESENT_TOWN, " + + "ADDRESS_HOUSE_NO,POSTAL_CODE,TEL_NO,COUNTRY_CODE,NATIONALITY_CODE,EDUCATION_CODE,OCCUPATION_CODE,EMPLOYER_NAME," + + "WEIGHT,MENSES_LAST_DATE,EXPECTED_TIEM,GRAVIDITY,PARITY,ECTOPIC_PREGNANCY,ACEPHALOCYSTIS_RACEMOSA, " + + "SPONTANEOUS_ABORTION,INDUCED_ABORTION,LABOUR_INDUCTION_MEDIUM,PRETERM_BIRTH_NUMBER,BIRTH_DIFFICULTY, " + + "BIRTH_OPERATION,BIRTH_DEFECT_COUNT,DEATH_NUMBER,ABO_CODE,HUSBAND_NAME,HUSBAND_AGE,HUSBAND_COUNTRY, " + + "HUSBAND_NATION_CODE,HUSBAND_EDUCATION,HUSBAND_OCCUPATION,HUSBAND_ID_TYPE,HUSBAND_ID_NO,HUSBAND_HOUSEHOLD_ADDRESS, " + + "HUSBAND_TEL_NO,DIAGNOSIS_DATE,DIAGNOSIS_PREGNANCY_WEEK,DIAGNOSIS_PREGNANCY_DAY,DIAGNOSIS_ITEM,DIAGNOSIS_WAY_CODE, " + + "DIAG_RESULT_CODE,DIAGNOSE_FLAG,DIAGNOSIS_GUIDE,DIAGNOSIS_DOCTOR_NAME,DIAGNOSIS_ORG_NAME,CREATE_DATE) " + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; ps = conn.prepareStatement(inSqlDiag); ps.setDate(1, new Date(antExChuModel.getModified().getTime())); ps.setString(2, code); ps.setString(3, id); ps.setString(4, antExChuModel.getId()); ps.setString(5, patients.getUsername()); - ps.setString(6, liveAddress); - ps.setString(7, patients.getPhone()); - ps.setString(8, patients.getPworkUnit()); - if(antExChuModel.getWeight() != null){ - ps.setDouble(9, Double.parseDouble(antExChuModel.getWeight())); - }else{ - ps.setNull(9, Types.DOUBLE); - } - ps.setDate(10,new Date(antExChuModel.getLastMenses().getTime())); - ps.setDate(11, new Date(patients.getDueDate().getTime())); - if(antExChuModel.getPregnancyTimes() != null){ - ps.setInt(12, antExChuModel.getPregnancyTimes()); - }else{ - ps.setNull(12,Types.INTEGER); - } - if(antExChuModel.getProdTime() != null){ - ps.setInt(13, antExChuModel.getProdTime()); - }else{ - ps.setNull(13,Types.INTEGER); - } - if(antExChuModel.getAbortionZR() != null){ - ps.setInt(14, antExChuModel.getAbortionZR()); - }else{ - ps.setNull(14,Types.INTEGER); - } - if(antExChuModel.getAbortionRG() != null){ - ps.setInt(15, antExChuModel.getAbortionRG()); + if(null!=patients.getAge()){ + ps.setInt(6, patients.getAge()); }else{ - ps.setNull(15,Types.INTEGER); - } - ps.setString(16, patients.getHusbandName()); - if(antExChuModel.getCheckTime() != null){ - ps.setDate(17, new Date(antExChuModel.getCheckTime().getTime())); - }else{ - ps.setNull(17,Types.DATE); + ps.setNull(6,Types.INTEGER); } - if(patients.getBookbuildingDate() != null){ - ps.setDate(18,new Date(patients.getBookbuildingDate().getTime())); + if(null!=patients.getBirth()){ + ps.setDate(7, new Date(patients.getBirth().getTime())); }else{ - ps.setNull(18,Types.DATE); - } -// ps.setString(19,createOrgId); -// ps.setString(20,orgName); -// ps.setString(21,creator); -// ps.setString(22,creatorId); + ps.setNull(7,Types.DATE); + } + ps.setString(8,getPcerteType(patients.getPcerteTypeId())); + ps.setString(9,patients.getCardNo()); + ps.setString(10,patients.getAddress()); + ps.setString(11,hjSheng); + ps.setString(12,hjShi); + ps.setString(13,hjXian); + ps.setString(14,hjXiang); + ps.setString(15,"");//村没有。不能拆分 + ps.setString(16,patients.getAddressRegister()); + ps.setString(17,jzSheng); + ps.setString(18,jzShi); + ps.setString(19,jzXian); + ps.setString(20,jzXiang); + ps.setString(21,"");//村没有。不能拆分 + ps.setString(22,patients.getAddressRegister()); + ps.setString(23,""); + ps.setString(24,patients.getPhone()); + ps.setString(25,getPcountry(patients.getPcountryId())); + +// ps.setString(20,createOrgId); +// ps.setString(21,orgName); +// ps.setString(22,creator); +// ps.setString(23,creatorId); ps.executeUpdate(); @@ -4217,5 +4238,29 @@ public class CdGwInterface { } } + //国籍 + private String getPcountry(String id) { + if (StringUtils.isEmpty(id)) { + return "156"; + } + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); + return PcountryEnums.getId(basicConfig.getName()); + } + //职业类别 + private String getPprofessionTypeName(String id) { + if (StringUtils.isEmpty(id)) { + return "Y"; + } + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); + return PprofessionTypeEnums.getId(basicConfig.getName()); + } + //证件类型 + private String getPcerteType(String id) { + if (StringUtils.isEmpty(id)) { + return "01"; + } + String name = CommonsHelper.getName1(id, basicConfigService); + return PcerteTypeIdEnums.getId(name); + } } diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyUploadingProvince.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyUploadingProvince.java index 28d6047..360cd3e 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyUploadingProvince.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyUploadingProvince.java @@ -6,6 +6,7 @@ import com.lyms.hospitalapi.lhxfy.model.General; import com.lyms.hospitalapi.lhxfy.model.UploadResult; import com.lyms.hospitalapi.lhxfy.model.enums.*; import com.lyms.hospitalapi.lhxfy.model.*; +import com.lyms.platform.biz.service.BasicConfigService; import com.lyms.platform.common.utils.DateUtil; import com.lyms.platform.common.utils.JsonUtil; import com.lyms.platform.common.utils.StringUtils; @@ -14,6 +15,7 @@ import com.lyms.platform.operate.web.facade.AutoMatchFacade; import com.lyms.platform.operate.web.facade.BasicConfigFacade; import com.lyms.platform.operate.web.result.BasicConfigResult; import com.lyms.platform.operate.web.utils.CollectionUtils; +import com.lyms.platform.operate.web.utils.CommonsHelper; import com.lyms.platform.permission.model.Users; import com.lyms.platform.permission.service.UsersService; import com.lyms.platform.operate.web.utils.CollectionUtils; @@ -45,6 +47,8 @@ public class LhxfyUploadingProvince { private OrganizationService organizationService; @Autowired private LhxfyService lhxfyService; + @Autowired + private BasicConfigService basicConfigService; //上传孕前档案基本信息4.1 public String uploadingProvinceArchives(PreEugenicsBaseModel baseModel,String key,String documentId){ @@ -177,7 +181,8 @@ public class LhxfyUploadingProvince { archives.setHusbandOccupationCode(CareerEnums.getId(husbandCareer));// 丈夫职业 archives.setHusbandOccupationCodeContent(null);//丈夫职业07的时候需要存入信息(系统没有具体选项) //丈夫证件类型(传空的话默认01)01:居民身份证02:护照 03: 港澳居民身份证04:军官证 05: 其他有效证件 - archives.setHusbandCertificatesCode(CardTypeEnums.getId(baseModel.getHusbandCardType())); + String name = CommonsHelper.getName1(baseModel.getHusbandCardType(), basicConfigService); + archives.setHusbandCertificatesCode(CardTypeEnums.getId(name)); archives.setHusband_village(lhxfyService.getPreeugenicsAddr(baseModel.getHusbandAccountStreet()));// 丈夫户口村级区划 archives.setZipCode(StringUtils.isNotEmpty(baseModel.getWifeZipCode())?baseModel.getWifeZipCode():"000000");// 妻子邮编