diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java index e4acbdf..2237d83 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java @@ -17,6 +17,7 @@ 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.dao.master.CouponMapper; +import com.lyms.platform.permission.model.Organization; import com.lyms.platform.permission.model.Users; import com.lyms.platform.permission.service.OrganizationService; import com.lyms.platform.permission.service.UsersService; @@ -84,11 +85,11 @@ public class LivelihoodProjectsFacade { try { Map map = new HashMap<>(); //id - map.put("id",model.getId()); + map.put("id",StringUtils.isNotEmpty(model.getId())?model.getId():"/"); //档案编号 - map.put("file_number","/"); + map.put("file_number",null); //纸质档案编号 - map.put("file_number_paper","/"); + map.put("file_number_paper",null); //证件类型(lyms_basicconfig表中查"parentId": "c914bb2e-1825-4036-8a41-fe617c90d405") String credentials_type_code="99"; if(StringUtils.isNotEmpty(model.getCertificateTypeId())){ @@ -109,7 +110,7 @@ public class LivelihoodProjectsFacade { } map.put("credentials_type_code",credentials_type_code); //其他身份证件名称 - map.put("other_credentials_type","/"); + map.put("other_credentials_type",null); //证件号码 map.put("credentials_number",StringUtils.isNotEmpty(model.getCertificateNum())?model.getCertificateNum():"/"); //出生日期 @@ -129,26 +130,26 @@ public class LivelihoodProjectsFacade { //姓名 map.put("name",StringUtils.isNotEmpty(model.getUsername())?model.getUsername():"/"); //姓名简拼 - map.put("en_name","/"); + map.put("en_name",null); //所属民族 String nation_code= CdGwNationEnums.getId(getBasicConfig(model.getNationId())); map.put("nation_code",StringUtils.isNotEmpty(nation_code)?nation_code:"99"); //性别 map.put("gender_code","2"); //工作单位 - map.put("work_unit",StringUtils.isNotEmpty(model.getWorkUnit())?model.getWorkUnit():"/"); + map.put("work_unit",StringUtils.isNotEmpty(model.getWorkUnit())?model.getWorkUnit():null); //固定电话 - map.put("tel","/"); + map.put("tel",null); //手机号 map.put("phone",StringUtils.isNotEmpty(model.getPhone())?model.getPhone():"/"); //联系人姓名 - map.put("contact_name","/"); + map.put("contact_name",null); //联系人电话 - map.put("contact_phone","/"); + map.put("contact_phone",null); //是否常驻 - map.put("is_permanent_code","/"); + map.put("is_permanent_code",null); //流动情况 - map.put("permanent_type_code","/"); + map.put("permanent_type_code",null); //户籍类型(lyms_basicconfig表中查"parentId": "57624ba30cf23d4631523e9d") String address_type_code="2"; @@ -166,15 +167,15 @@ public class LivelihoodProjectsFacade { } map.put("census_register_type_code",address_type_code); //居住类型 - map.put("address_type_code","/"); + map.put("address_type_code",null); //户籍区划编码 - map.put("residence_district_id","/"); + map.put("residence_district_id",null); //户籍地址区划详情 - map.put("residence_district_detail","/"); + map.put("residence_district_detail",null); //户籍地址 - map.put("residence_address","/"); + map.put("residence_address",null); //身份证住址 - map.put("id_card_address","/"); + map.put("id_card_address",null); //年龄 Integer age=model.getAge(); if(null==model.getAge()){ @@ -187,9 +188,9 @@ public class LivelihoodProjectsFacade { //身高(cm)系统中不能获取 没有就传最小取值 map.put("height",20); //血型 - map.put("blood_type_code","/"); + map.put("blood_type_code",null); //RH阴性 - map.put("blood_type_rh_code","/"); + map.put("blood_type_rh_code",null); //文化程度(lyms_basicconfig表中查"parentId": "8046934b-ebe8-4037-98b6-a9ec47996700") String edu_attainment_code="10"; if(StringUtils.isNotEmpty(model.getLevelTypeId())){ @@ -242,7 +243,7 @@ public class LivelihoodProjectsFacade { } map.put("edu_attainment_code",edu_attainment_code); //职业 - map.put("profession_code","/"); + map.put("profession_code",null); //婚姻状况(lyms_basicconfig表中查"parentId": "0ab3e86b-dfdb-47eb-a58b-a2f2d978b69f") String marital_status_code="5"; if(StringUtils.isNotEmpty(model.getMarriageId())){ @@ -259,7 +260,7 @@ public class LivelihoodProjectsFacade { } map.put("marital_status_code",marital_status_code); //责任医生 - map.put("doctor_name","/"); + map.put("doctor_name",null); //建档人 String create_doctor="/"; if(StringUtils.isNotEmpty(model.getBuildDoctor())) { @@ -272,11 +273,11 @@ public class LivelihoodProjectsFacade { //建档日期 map.put("this_date",null!=model.getBuildDay()?DateUtil.getyyyy_MM_dd_hms(model.getBuildDay()):DateUtil.getyyyy_MM_dd_hms(new Date())); //出生人口编码 - map.put("childbirth_code","/"); + map.put("childbirth_code",null); //是否孕妇 - map.put("is_gravida","/"); + map.put("is_gravida",null); //是否产妇 - map.put("is_puerpera","/"); + map.put("is_puerpera",null); //系统录入时间 map.put("entering_time",null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date())); //所属机构编码 @@ -293,7 +294,7 @@ public class LivelihoodProjectsFacade { } map.put("district_nation_code", organizationService.getAreaCode(areaName)); //母亲姓名简拼 - map.put("mother_en_name","/"); + map.put("mother_en_name",null); //数据上传时间 // map.put("import_time",null); //修改时间 @@ -342,15 +343,15 @@ public class LivelihoodProjectsFacade { try { Map map=new HashMap<>(); //id - map.put("id",model.getId()); + map.put("id",StringUtils.isNotEmpty(model.getId())?model.getId():"/"); //档案编号 - map.put("babyModels", "/"); + map.put("babyModels", null); //纸质档案编号 - map.put("file_number_paper", "/"); + map.put("file_number_paper", null); //证件类型 - map.put("credentials_type_code", "/"); + map.put("credentials_type_code", null); //其他证件名称 - map.put("other_credentials_type", "/"); + map.put("other_credentials_type", null); //证件号码 map.put("credentials_number", StringUtils.isNotEmpty(model.getCardNo())?model.getCardNo():"/"); //出生日期 @@ -370,7 +371,7 @@ public class LivelihoodProjectsFacade { //姓名 map.put("name", StringUtils.isNotEmpty(model.getName())?model.getName():"/"); //姓名简拼 - map.put("en_name", "/"); + map.put("en_name", null); //所属民族 String nation_code= CdGwNationEnums.getId(getBasicConfig(model.getBnationId())); map.put("nation_code",StringUtils.isNotEmpty(nation_code)?nation_code:"99"); @@ -386,9 +387,9 @@ public class LivelihoodProjectsFacade { } map.put("gender_code", gender_code); //接种条码 - map.put("vaccination_code", "/"); + map.put("vaccination_code", null); //固话 - map.put("tel", "/"); + map.put("tel", null); //手机号 String phone="/"; if(StringUtils.isNotEmpty(model.getMphone())){ @@ -399,21 +400,21 @@ public class LivelihoodProjectsFacade { } map.put("phone", phone); //是否常住 - map.put("is_permanent_code", "/"); + map.put("is_permanent_code", null); //流动情况 - map.put("permanent_type_code", "/"); + map.put("permanent_type_code", null); //户籍类型 系统中不能获取,默认2 map.put("census_register_type_code", "2"); //居住类型 - map.put("address_type_code", "/"); + map.put("address_type_code", null); //户籍地址区划Id - map.put("residence_district_id", "/"); + map.put("residence_district_id", null); //户籍地址区划详情 - map.put("residence_district_detail", "/"); + map.put("residence_district_detail", null); //户籍地址 - map.put("residence_address", "/"); + map.put("residence_address", null); //身份证住址 - map.put("id_card_address", "/"); + map.put("id_card_address", null); //年龄 Integer age=0; if(null!=model.getBirth()){ @@ -438,9 +439,9 @@ public class LivelihoodProjectsFacade { } map.put("weight", babyWeight); //血型 - map.put("blood_type_code", "/"); + map.put("blood_type_code", null); //RH阴性 - map.put("blood_type_rh_code", "/"); + map.put("blood_type_rh_code", null); //责任医生 String create_doctor="/"; if(StringUtils.isNotEmpty(model.getBuildDoctor())) { @@ -480,11 +481,11 @@ public class LivelihoodProjectsFacade { } map.put("mother_credentials_type_code", mother_credentials_type_code); //母亲其他证件名称 - map.put("mother_other_credentials_type", "/"); + map.put("mother_other_credentials_type", null); //母亲证件号码 map.put("mother_credentials_number", StringUtils.isNotEmpty(model.getMcertNo())?model.getMcertNo():"/"); //出生人口编码 - map.put("childbirth_code", "/"); + map.put("childbirth_code", null); //录入系统时间 map.put("entering_time", null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date())); //所属机构编码 @@ -501,7 +502,7 @@ public class LivelihoodProjectsFacade { } map.put("district_nation_code", organizationService.getAreaCode(areaName)); //母亲姓名简拼 - map.put("mother_en_name", "/"); + map.put("mother_en_name", null); //导入时间(存入数据) // map.put("import_time", null); //修改时间 @@ -540,7 +541,7 @@ public class LivelihoodProjectsFacade { try { Map map = new HashMap<>(); //id - map.put("id",patients.getId()); + map.put("id",StringUtils.isNotEmpty(patients.getId())?patients.getId():"/"); //档案状态 map.put("file_status_code", null!=patients.getType()?(patients.getType()==1?"1":"2"):"/"); //末次月经 @@ -565,11 +566,11 @@ public class LivelihoodProjectsFacade { //结案时间 map.put("close_date", null); //结案原因 - map.put("close_reason_code", "/"); + map.put("close_reason_code", null); //结案原因-其它 - map.put("close_reason_detailed", "/"); + map.put("close_reason_detailed", null); //母子保健卡号 - map.put("health_card_number", "/"); + map.put("health_card_number", null); //姓名 map.put("mother_name", StringUtils.isNotEmpty(patients.getUsername())?patients.getUsername():"/"); //年龄 @@ -595,8 +596,14 @@ public class LivelihoodProjectsFacade { areaRegisterName=CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService); } map.put("mother_now_address_id", organizationService.getAreaCode(areaRegisterName)); - //母亲现住址详情 - map.put("mother_now_address", CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getVillageRegister()+patients.getAddressRegister(), basicConfigService)); + //母亲现住址详情(非必填) + String mother_now_address=null; + if(StringUtils.isNotEmpty(patients.getProvinceRegisterId()) && StringUtils.isNotEmpty(patients.getCityRegisterId()) && + StringUtils.isNotEmpty(patients.getAreaRegisterId()) && StringUtils.isNotEmpty(patients.getStreetRegisterId()) && + StringUtils.isNotEmpty(patients.getVillageRegister()) && StringUtils.isNotEmpty(patients.getAddressRegister())){ + mother_now_address= CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getVillageRegister()+patients.getAddressRegister(), basicConfigService); + } + map.put("mother_now_address", mother_now_address); //母亲户籍地址标识,母亲户籍地址区划编码(居委会/村)取 县/区 级的编码 String areaName=""; if(StringUtils.isNotEmpty(patients.getAreaId())){ @@ -604,7 +611,7 @@ public class LivelihoodProjectsFacade { } map.put("mother_address_id", organizationService.getAreaCode(areaName)); //母亲户籍地址--详情部分 - map.put("mother_address_detail", patients.getAddress()); + map.put("mother_address_detail", StringUtils.isNotEmpty(patients.getAddress())?patients.getAddress():"/"); //母亲地址(出生证明母亲地址) 获取母亲 户籍地址,没有 就/ String mother_address="/"; if(StringUtils.isNotEmpty(patients.getProvinceId()) && StringUtils.isNotEmpty(patients.getCityId()) && @@ -633,7 +640,7 @@ public class LivelihoodProjectsFacade { } map.put("mother_credentials_type_code", mother_credentials_type_code); //其他证件名称 - map.put("mother_other_credentials_type", "/"); + map.put("mother_other_credentials_type", null); //有效身份证件号码 map.put("mother_credentials_number", StringUtils.isNotEmpty(patients.getCardNo())?patients.getCardNo():"/"); //丈夫姓名 @@ -662,7 +669,13 @@ public class LivelihoodProjectsFacade { } map.put("father_now_address_id", organizationService.getAreaCode(hareaName)); //丈夫现住址详情 - map.put("father_now_address", CommonsHelper.getResidence(patients.getHprovinceId(), patients.getHcityId(), patients.getHareaId(), patients.getHstreetId(), patients.getHvillage()+patients.getHaddress(), basicConfigService)); + String father_now_address=null; + if(StringUtils.isNotEmpty(patients.getHprovinceId()) && StringUtils.isNotEmpty(patients.getHcityId()) && + StringUtils.isNotEmpty(patients.getHareaId()) && StringUtils.isNotEmpty(patients.getHstreetId()) && + StringUtils.isNotEmpty(patients.getHvillage()) && StringUtils.isNotEmpty(patients.getHaddress())){ + father_now_address= CommonsHelper.getResidence(patients.getHprovinceId(), patients.getHcityId(), patients.getHareaId(), patients.getHstreetId(), patients.getHvillage()+patients.getHaddress(), basicConfigService); + } + map.put("father_now_address", father_now_address); //丈夫户籍地址标识,丈夫户籍地址区划编码(区县)取 县/区 级的编码 String hareaRegisterName=""; if(StringUtils.isNotEmpty(patients.getHareaRegisterId())){ @@ -699,23 +712,23 @@ public class LivelihoodProjectsFacade { } map.put("father_credentials_type_code", father_credentials_type_code); //丈夫其他证件名称 - map.put("father_other_credentials_type", "/"); + map.put("father_other_credentials_type", null); //丈夫有效身份证件号码 map.put("father_credentials_number", StringUtils.isNotEmpty(patients.getHcertificateNum())?patients.getHcertificateNum():"/"); //手机号码 map.put("phone", StringUtils.isNotEmpty(patients.getHusbandPhone())?patients.getHusbandPhone():"/"); //是否高危 - map.put("is_high_risk", "/"); + map.put("is_high_risk", null); //是否早孕建档 - map.put("is_early_pregnancy", "/"); + map.put("is_early_pregnancy", null); //是否已打印出生证明 - map.put("is_birth_certificate", "/"); + map.put("is_birth_certificate", null); //录入系统时间 map.put("entering_time", null!=patients.getCreated()?DateUtil.getyyyy_MM_dd_hms(patients.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date())); //是否未提供男方信息(建档时是否未提供男方信息) map.put("not_provided_father_info", null!=patients.getReqHusband()?(patients.getReqHusband()?false:true):false); //丈夫电话 - map.put("father_phone", "/"); + map.put("father_phone", null); //建档日期 map.put("this_date",null!=patients.getBookbuildingDate()?DateUtil.getyyyy_MM_dd_hms(patients.getBookbuildingDate()):DateUtil.getyyyy_MM_dd_hms(new Date())); //所属机构编码 @@ -851,15 +864,15 @@ public class LivelihoodProjectsFacade { //总出血量 map.put("bleeding_amount_total", null); //会阴情况 - map.put("perineal_condition_code", "/"); + map.put("perineal_condition_code",null); //撕裂Ⅰ° - map.put("perineal_tearing_one", "/"); + map.put("perineal_tearing_one",null); //撕裂Ⅱ° - map.put("perineal_tearing_two", "/"); + map.put("perineal_tearing_two", null); //撕裂Ⅲ° - map.put("perineal_tearing_three", "/"); + map.put("perineal_tearing_three", null); //撕裂缝线 - map.put("perineal_tearing_suture", "/"); + map.put("perineal_tearing_suture", null); //新生儿情况 String neonatal_condition_code="/"; if (null!=model.getTireNumber()) { @@ -876,9 +889,9 @@ public class LivelihoodProjectsFacade { } map.put("neonatal_condition_code", neonatal_condition_code); //畸形详细 - map.put("malformation_detailed", "/"); + map.put("malformation_detailed", null); //新生儿情况其它 - map.put("neonatal_condition_other", "/"); + map.put("neonatal_condition_other", null); //出院时间 map.put("out_time", null); //分娩医院名称 @@ -897,9 +910,9 @@ public class LivelihoodProjectsFacade { String maternal_state_code=model.getMaternalInfo(); map.put("maternal_state_code", StringUtils.isNotEmpty(maternal_state_code)?maternal_state_code:"/"); //产时并发症 - map.put("obstetric_morbidity_code", "/"); + map.put("obstetric_morbidity_code", null); //产时并发症--详述 - map.put("obstetric_morbidity_contents", "/"); + map.put("obstetric_morbidity_contents", null); //开奶时间 map.put("milk_open_time", null); //分娩机构(分娩医疗机构统一社会信用代码) @@ -970,6 +983,12 @@ public class LivelihoodProjectsFacade { Map map=new HashMap(); //id map.put("id", StringUtils.isNotEmpty(baby.getId())?baby.getId():"/"); + //出生时间 + String birth_date=baby.getDueTime(); + if(StringUtils.isEmpty(birth_date)){ + + } + map.put("birth_date", birth_date); //性别 String gender_code="0"; if(StringUtils.isNotEmpty(baby.getBabyGender())){ @@ -1022,60 +1041,133 @@ public class LivelihoodProjectsFacade { } } map.put("mid_wife", mid_wife); - //出生地点分类 - map.put("birth_place_code", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); - // - map.put("", "/"); + //出生地点分类(参考前端分娩页面 分娩地点类型字段) + String birth_place_code="99"; + if(StringUtils.isNotEmpty(model.getFmddlx())){ + switch (model.getFmddlx()){ + case "1": + birth_place_code="2"; + break; + case "2": + birth_place_code="2"; + break; + case "3": + birth_place_code="1"; + break; + case "4": + birth_place_code="2"; + break; + case "5": + birth_place_code="2"; + break; + case "6": + birth_place_code="1"; + break; + case "7": + birth_place_code="99"; + break; + case "8": + birth_place_code="3"; + break; + case "9": + birth_place_code="4"; + break; + case "10": + birth_place_code="99"; + break; + } + } + map.put("birth_place_code", birth_place_code); + //出生地点区划Id(出生地点区划Id(区县)) + String birth_district_id="/"; + if (StringUtils.isNotEmpty(model.getFmHospital())) { + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getFmHospital())); + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { + String hospitalArea=CommonsHelper.getName1(organization.getAreaId(), basicConfigService); + birth_district_id=organizationService.getAreaCode(hospitalArea); + } + } + map.put("birth_district_id", birth_district_id); + //分娩结局 + String birth_condition_code="/"; + if(StringUtils.isNotEmpty(baby.getPregnancyOut())) { + switch (baby.getPregnancyOut()) { + case "0": + birth_condition_code="1"; + break; + case "1": + birth_condition_code="2"; + break; + case "2": + birth_condition_code="2"; + break; + case "3": + birth_condition_code="3"; + break; + case "4": + birth_condition_code="4"; + break; + } + } + map.put("birth_condition_code", birth_condition_code); + //Apgar1分钟(必填) + Integer apgar1=0; + if (StringUtils.isNotEmpty(baby.getApgarScore())) { + Map m = JsonUtil.str2Obj(baby.getApgarScore(), Map.class); + if (null!=m) { + Object b = m.get("pf1"); + if (null!=b && StringUtils.isNotEmpty(b.toString())) { + apgar1 = Integer.parseInt(b.toString()); + } + } + } + map.put("apgar1", apgar1); + //Apgar3分钟 + map.put("apgar3", null); + //Apgar5分钟 + map.put("apgar5", null); + //Apgar10分钟 + map.put("apgar10", null); + //出生次序 + map.put("birth_order", StringUtils.isNotEmpty(baby.getCftc())?baby.getCftc():"/"); + //健康状态(系统没有字段 默认1良好) + map.put("health_state_code", "1"); + //出生缺陷 + map.put("birth_defect_code", null); + //出生缺陷详述 + map.put("birth_defect_contents", null); + //出生头围(cm) + map.put("head_circumference", null); + //出生胸围(cm) + map.put("bust", null); + //抢救 + map.put("rescue", null); + //新生儿并发症 + map.put("baby_complication", null); + //新生儿并发症描述 + map.put("baby_complication_contents", null); + //死亡原因 + map.put("death_cause", null); + //死亡时间 + map.put("death_time", null); + //新生儿指导记录 + map.put("guidance_record", null); + //关联分娩记录Id + map.put("master_id", StringUtils.isNotEmpty(model.getId())?model.getId():"/"); + //录入系统时间 + map.put("entering_time", null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date())); + //所属机构编码(所属医疗机构统一社会信用代码) + String hospital_name = couponMapper.findHospitalNameById(model.getHospitalId()); + String organ_id=organizationService.getPlatHosNewCode(hospital_name); + map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/"); + //导入时间 +// map.put("import_time", null); + //修改时间 + map.put("last_modified_time", null); + //删除状态 + map.put("is_deleted", 0); + //删除时间 + map.put("deleted_time", null); data.add(map); } catch (Exception e) {