Commit 7e3d9a5008495c1a236b8ae9d89c466a7a0cb52b

Authored by yangfei
1 parent 306a02e849

听力诊断模块

Showing 11 changed files with 250 additions and 108 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirth.java View file @ 7e3d9a5
1 1 package com.lyms.platform.permission.model;
2 2  
3   -import org.codehaus.jackson.annotate.JsonIgnore;
4   -
5 3 import java.math.BigDecimal;
6 4  
7 5 /**
8 6  
... ... @@ -191,8 +189,19 @@
191 189 /**
192 190 * 所属建档的id
193 191 */
194   - @JsonIgnore
195 192 private String babyPatientId;
  193 + /***
  194 + * 儿童听力建档ID
  195 + */
  196 + private String babyEarId;
  197 +
  198 + public String getBabyEarId() {
  199 + return babyEarId;
  200 + }
  201 +
  202 + public void setBabyEarId(String babyEarId) {
  203 + this.babyEarId = babyEarId;
  204 + }
196 205  
197 206 public String getId() {
198 207 return id;
platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirthQuery.java View file @ 7e3d9a5
... ... @@ -191,6 +191,18 @@
191 191 * 所属建档的id
192 192 */
193 193 private String babyPatientId;
  194 + /**
  195 + * 所属建档的id
  196 + */
  197 + private String babyEarId;
  198 +
  199 + public String getBabyEarId() {
  200 + return babyEarId;
  201 + }
  202 +
  203 + public void setBabyEarId(String babyEarId) {
  204 + this.babyEarId = babyEarId;
  205 + }
194 206  
195 207 public String getId() {
196 208 return id;
platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamily.java View file @ 7e3d9a5
... ... @@ -36,6 +36,18 @@
36 36 * 儿童建档的主键
37 37 */
38 38 private String babyPatientId;
  39 + /**
  40 + * 儿童听力建档的主键
  41 + */
  42 + private String babyEarId;
  43 +
  44 + public String getBabyEarId() {
  45 + return babyEarId;
  46 + }
  47 +
  48 + public void setBabyEarId(String babyEarId) {
  49 + this.babyEarId = babyEarId;
  50 + }
39 51  
40 52 public String getId() {
41 53 return id;
platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamilyQuery.java View file @ 7e3d9a5
... ... @@ -38,6 +38,19 @@
38 38 */
39 39 private String babyPatientId;
40 40  
  41 + /**
  42 + * 儿童建档的主键
  43 + */
  44 + private String babyEarId;
  45 +
  46 + public String getBabyEarId() {
  47 + return babyEarId;
  48 + }
  49 +
  50 + public void setBabyEarId(String babyEarId) {
  51 + this.babyEarId = babyEarId;
  52 + }
  53 +
41 54 public String getId()
42 55 {
43 56 return id;
platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBirth.xml View file @ 7e3d9a5
... ... @@ -31,7 +31,7 @@
31 31 <result column="head_trauma_history" property="headTraumaHistory" jdbcType="INTEGER"/>
32 32 <result column="head_trauma_desc" property="headTraumaDesc" jdbcType="VARCHAR"/>
33 33 <result column="ear_poison_type" property="earPoisonType" jdbcType="INTEGER"/>
34   - <result column="ear_poison_name" property="earPoisonMap" jdbcType="VARCHAR"/>
  34 + <result column="ear_poison_map" property="earPoisonMap" jdbcType="VARCHAR"/>
35 35 <result column="tympanitis_type" property="tympanitisType" jdbcType="INTEGER"/>
36 36 <result column="tympanitis_desc" property="tympanitisDesc" jdbcType="VARCHAR"/>
37 37 <result column="nicu_type" property="nicuType" jdbcType="INTEGER"/>
38 38  
... ... @@ -41,12 +41,13 @@
41 41 <result column="respirator_continued_date" property="respiratorContinuedDate" jdbcType="VARCHAR"/>
42 42 <result column="outside_response" property="outsideResponse" jdbcType="INTEGER"/>
43 43 <result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR"/>
  44 + <result column="baby_ear_id" property="babyEarId" jdbcType="VARCHAR" />
44 45 </resultMap>
45 46  
46 47  
47 48 <insert id="addBabyPatientExtendEarBirth"
48 49 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirth">
49   -insert into baby_patient_extend_ear_birth (id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_name,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id) values (#{id},#{fetuNumber},#{productNumber},#{birthWeight},#{parturitionType},#{birthDefectType},#{birthDefectDesc},#{fetuEmbarrasType},#{apgarScoreOne},#{apgarScoreFive},#{apgarScoreTen},#{birthInjuryType},#{birthInjuryPosition},#{amnioticFluidType},#{abnormalParturitionType},#{abnormalParturitionPosition},#{deformityType},#{deformityPosition},#{birthInfectionType},#{birthInfectionCause},#{birthCourseDisease},#{birthIllType},#{birthIllCause},#{birthIllDisease},#{headTraumaHistory},#{headTraumaDesc},#{earPoisonType},#{earPoisonMap},#{tympanitisType},#{tympanitisDesc},#{nicuType},#{nicuCause},#{nicuContinuedDate},#{respiratorType},#{respiratorContinuedDate},#{outsideResponse},#{babyPatientId})
  50 +insert into baby_patient_extend_ear_birth (id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_map,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id,baby_ear_id) values (#{id},#{fetuNumber},#{productNumber},#{birthWeight},#{parturitionType},#{birthDefectType},#{birthDefectDesc},#{fetuEmbarrasType},#{apgarScoreOne},#{apgarScoreFive},#{apgarScoreTen},#{birthInjuryType},#{birthInjuryPosition},#{amnioticFluidType},#{abnormalParturitionType},#{abnormalParturitionPosition},#{deformityType},#{deformityPosition},#{birthInfectionType},#{birthInfectionCause},#{birthCourseDisease},#{birthIllType},#{birthIllCause},#{birthIllDisease},#{headTraumaHistory},#{headTraumaDesc},#{earPoisonType},#{earPoisonMap},#{tympanitisType},#{tympanitisDesc},#{nicuType},#{nicuCause},#{nicuContinuedDate},#{respiratorType},#{respiratorContinuedDate},#{outsideResponse},#{babyPatientId},#{babyEarId})
50 51 </insert>
51 52  
52 53  
... ... @@ -133,7 +134,7 @@
133 134 ear_poison_type = #{earPoisonType,jdbcType=INTEGER},
134 135 </if>
135 136 <if test="earPoisonMap != null and earPoisonMap != ''">
136   - ear_poison_name = #{earPoisonMap,jdbcType=VARCHAR},
  137 + ear_poison_map = #{earPoisonMap,jdbcType=VARCHAR},
137 138 </if>
138 139 <if test="tympanitisType != null and tympanitisType >= 0">
139 140 tympanitis_type = #{tympanitisType,jdbcType=INTEGER},
... ... @@ -162,6 +163,9 @@
162 163 <if test="babyPatientId != null and babyPatientId != ''">
163 164 baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
164 165 </if>
  166 + <if test="babyEarId != null and babyEarId != ''">
  167 + baby_ear_id = #{babyEarId,jdbcType=VARCHAR},
  168 + </if>
165 169 </set>
166 170 where id = #{id,jdbcType=VARCHAR}
167 171 </update>
... ... @@ -174,7 +178,7 @@
174 178  
175 179 <select id="getBabyPatientExtendEarBirth" resultMap="BabyPatientExtendEarBirthResultMap"
176 180 parameterType="java.lang.String">
177   -select id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_name,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id
  181 +select id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_map,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id,baby_ear_id
178 182 from baby_patient_extend_ear_birth where id = #{id,jdbcType=VARCHAR}
179 183 </select>
180 184  
... ... @@ -274,7 +278,7 @@
274 278 and ear_poison_type = #{earPoisonType,jdbcType=INTEGER}
275 279 </if>
276 280 <if test="earPoisonMap != null and earPoisonMap != ''">
277   - and ear_poison_name = #{earPoisonMap,jdbcType=VARCHAR}
  281 + and ear_poison_map = #{earPoisonMap,jdbcType=VARCHAR}
278 282 </if>
279 283 <if test="tympanitisType != null and tympanitisType >= 0">
280 284 and tympanitis_type = #{tympanitisType,jdbcType=INTEGER}
... ... @@ -303,6 +307,9 @@
303 307 <if test="babyPatientId != null and babyPatientId != ''">
304 308 and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
305 309 </if>
  310 + <if test="babyEarId != null and babyEarId != ''">
  311 + and baby_ear_id = #{babyEarId,jdbcType=VARCHAR}
  312 + </if>
306 313 </where>
307 314 </sql>
308 315  
... ... @@ -310,7 +317,7 @@
310 317 <select id="queryBabyPatientExtendEarBirth" resultMap="BabyPatientExtendEarBirthResultMap"
311 318 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarBirthQuery">
312 319 select
313   - id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_name,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id
  320 + id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_type,birth_defect_desc,fetu_embarras_type,apgar_score_one,apgar_score_five,apgar_score_ten,birth_injury_type,birth_injury_position,amniotic_fluid_type,abnormal_parturition_type,abnormal_parturition_position,deformity_type,deformity_position,birth_infection_type,birth_infection_cause,birth_course_disease,birth_ill_type,birth_ill_cause,birth_ill_disease,head_trauma_history,head_trauma_desc,ear_poison_type,ear_poison_map,tympanitis_type,tympanitis_desc,nicu_type,nicu_cause,nicu_continued_date,respirator_type,respirator_continued_date,outside_response,baby_patient_id,baby_ear_id
314 321 from baby_patient_extend_ear_birth
315 322 <include refid="BabyPatientExtendEarBirthCondition"/>
316 323 <include refid="orderAndLimit"/>
platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFamily.xml View file @ 7e3d9a5
... ... @@ -11,13 +11,14 @@
11 11 <result column="proximity_type" property="proximityType" jdbcType="INTEGER"/>
12 12 <result column="proximity_relationship" property="proximityRelationship" jdbcType="VARCHAR"/>
13 13 <result column="baby_patient_id" property="babyPatientId" jdbcType="VARCHAR"/>
  14 + <result column="baby_ear_id" property="babyEarId" jdbcType="VARCHAR"/>
14 15 </resultMap>
15 16  
16 17  
17 18 <insert id="addBabyPatientExtendEarFamily"
18 19 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFamily">
19   -insert into baby_patient_extend_ear_family (id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id) values (#{id},#{badLifeHistory},#{deafType},#{deatRelationship},#{proximityType},#{proximityRelationship},#{babyPatientId})
20   -</insert>
  20 + insert into baby_patient_extend_ear_family (id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id,baby_ear_id) values (#{id},#{badLifeHistory},#{deafType},#{deatRelationship},#{proximityType},#{proximityRelationship},#{babyPatientId},#{babyEarId})
  21 + </insert>
21 22  
22 23  
23 24 <update id="updateBabyPatientExtendEarFamily"
24 25  
25 26  
... ... @@ -42,21 +43,24 @@
42 43 <if test="babyPatientId != null and babyPatientId != ''">
43 44 baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
44 45 </if>
  46 + <if test="babyEarId != null and babyEarId != ''">
  47 + baby_ear_id = #{babyEarId,jdbcType=VARCHAR},
  48 + </if>
45 49 </set>
46 50 where id = #{id,jdbcType=VARCHAR}
47 51 </update>
48 52  
49 53  
50 54 <delete id="deleteBabyPatientExtendEarFamily" parameterType="java.lang.String">
51   -delete from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
52   -</delete>
  55 + delete from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
  56 + </delete>
53 57  
54 58  
55 59 <select id="getBabyPatientExtendEarFamily" resultMap="BabyPatientExtendEarFamilyResultMap"
56 60 parameterType="java.lang.String">
57   -select id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id
58   - from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
59   -</select>
  61 + select id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id,baby_ear_id
  62 + from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
  63 + </select>
60 64  
61 65  
62 66 <sql id="orderAndLimit">
... ... @@ -93,6 +97,9 @@
93 97 <if test="babyPatientId != null and babyPatientId != ''">
94 98 and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
95 99 </if>
  100 + <if test="babyEarId != null and babyEarId != ''">
  101 + and baby_ear_id = #{babyEarId,jdbcType=VARCHAR}
  102 + </if>
96 103 </where>
97 104 </sql>
98 105  
... ... @@ -100,7 +107,7 @@
100 107 <select id="queryBabyPatientExtendEarFamily" resultMap="BabyPatientExtendEarFamilyResultMap"
101 108 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFamilyQuery">
102 109 select
103   - id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id
  110 + id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id,baby_ear_id
104 111 from baby_patient_extend_ear_family
105 112 <include refid="BabyPatientExtendEarFamilyCondition"/>
106 113 <include refid="orderAndLimit"/>
... ... @@ -112,7 +119,5 @@
112 119 select count(1) from baby_patient_extend_ear_family
113 120 <include refid="BabyPatientExtendEarFamilyCondition"/>
114 121 </select>
115   -
116   -
117 122 </mapper>
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 7e3d9a5
... ... @@ -2,11 +2,11 @@
2 2  
3 3 import org.joda.time.DateTime;
4 4  
5   -import java.sql.*;
6 5 import java.text.ParseException;
7 6 import java.text.SimpleDateFormat;
8   -import java.util.*;
  7 +import java.util.Calendar;
9 8 import java.util.Date;
  9 +import java.util.GregorianCalendar;
10 10 import java.util.concurrent.locks.Lock;
11 11 import java.util.concurrent.locks.ReentrantLock;
12 12  
... ... @@ -547,6 +547,9 @@
547 547 */
548 548 public static String getBabyMonthAge(Date birth, Date checkDate)
549 549 {
  550 + if(birth == null){
  551 + return "";
  552 + }
550 553 Calendar rightNow = Calendar.getInstance();
551 554 rightNow.setTime(checkDate);
552 555 rightNow.add(Calendar.MONTH,-1);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java View file @ 7e3d9a5
... ... @@ -114,37 +114,38 @@
114 114 return personService.addPerson(babyPerson);
115 115 }
116 116  
117   - private ChildrenPerson fillChildren(BabyModel baby) {
118   - ChildrenPerson childrenPerson = new ChildrenPerson();
119   - childrenPerson.setId(UUID.randomUUID().toString().replace("-", ""));
120   - childrenPerson.setAddressCity(baby.getCityId());
121   - childrenPerson.setAddressArea(baby.getAreaId());
122   - childrenPerson.setAddressDetail(baby.getAddress());
123   - childrenPerson.setAddressProvince(baby.getProvinceId());
124   - childrenPerson.setAddressStreet(baby.getStreetId());
125   - childrenPerson.setBasePapersNumber(baby.getMcertNo());
126   - childrenPerson.setBaseWomanBirth(baby.getMbirth());
127   - //母亲证件类型
128   - childrenPerson.setBasePapersType(baby.getMcertTypeId());
129   - childrenPerson.setBirthday(baby.getBirth());
130   - childrenPerson.setContactWomanWay(baby.getMphone());
131   - childrenPerson.setCreateTime(baby.getCreated());
132   - //母亲文化成都
133   - childrenPerson.setDegree(baby.getmLevelId());
134   - childrenPerson.setDoctorId(baby.getBuildDoctor());
135   - childrenPerson.setGender(baby.getSex());
136   - childrenPerson.setMotherId(baby.getParentId());
137   - childrenPerson.setName(baby.getName());
138   - childrenPerson.setPapersNum(baby.getCardNo());
139   - childrenPerson.setOccupation(baby.getFproTypeId());
140   - return childrenPerson;
141   - }
  117 + // private ChildrenPerson fillChildren(BabyModel baby) {
  118 + // ChildrenPerson childrenPerson = new ChildrenPerson();
  119 + // childrenPerson.setId(baby.getId());
  120 + // childrenPerson.setAddressCity(baby.getCityId());
  121 + // childrenPerson.setAddressArea(baby.getAreaId());
  122 + // childrenPerson.setAddressDetail(baby.getAddress());
  123 + // childrenPerson.setAddressProvince(baby.getProvinceId());
  124 + // childrenPerson.setAddressStreet(baby.getStreetId());
  125 + // childrenPerson.setBasePapersNumber(baby.getMcertNo());
  126 + // childrenPerson.setBaseWomanBirth(baby.getMbirth());
  127 + // //母亲证件类型
  128 + // childrenPerson.setBasePapersType(baby.getMcertTypeId());
  129 + // childrenPerson.setBirthday(baby.getBirth());
  130 + // childrenPerson.setContactWomanWay(baby.getMphone());
  131 + // childrenPerson.setCreateTime(baby.getCreated());
  132 + // //母亲文化成都
  133 + // childrenPerson.setDegree(baby.getmLevelId());
  134 + // childrenPerson.setDoctorId(baby.getBuildDoctor());
  135 + // childrenPerson.setGender(baby.getSex());
  136 + // childrenPerson.setMotherId(baby.getParentId());
  137 + // childrenPerson.setName(baby.getName());
  138 + // childrenPerson.setPapersNum(baby.getCardNo());
  139 + // childrenPerson.setOccupation(baby.getFproTypeId());
  140 + // return childrenPerson;
  141 + // }
142 142  
143   - private void addMysqlBabyRecord(BabyEarBase babyarBaseb) {
144   - BabyModel baby = babyarBaseb.convertToDataModel();
  143 + /*
  144 + private void addMysqlBabyRecord(BabyModel baby) {
145 145 ChildrenPerson childrenPerson = fillChildren(baby);
146 146 //同时写mysql表
147 147 childrenPersonService.addChildrenPerson(childrenPerson);
  148 +
148 149 String mysqlBabyId = childrenPerson.getId();
149 150  
150 151 ChildrenFather childrenFather = new ChildrenFather();
151 152  
... ... @@ -158,19 +159,19 @@
158 159 childrenFather.setChildId(mysqlBabyId);
159 160 childrenFatherService.addChildrenFather(childrenFather);
160 161  
161   - ChildrenRecord childrenRecord = new ChildrenRecord();
162   - childrenRecord.setId(UUID.randomUUID().toString().replace("-", ""));
163   - childrenRecord.setChildId(mysqlBabyId);
164   - childrenRecord.setCreateTime(baby.getCreated());
165   - childrenRecord.setBirthHospital(baby.getHospitalId());
166   - childrenRecord.setRemark(baby.getMremark());
167   - if (baby.getBabyHeight() != null) {
168   - childrenRecord.setHeight(Float.valueOf(baby.getBabyHeight()));
169   - }
  162 + // ChildrenRecord childrenRecord = new ChildrenRecord();
  163 + // childrenRecord.setId(UUID.randomUUID().toString().replace("-", ""));
  164 + // childrenRecord.setChildId(mysqlBabyId);
  165 + // childrenRecord.setCreateTime(baby.getCreated());
  166 + // childrenRecord.setBirthHospital(baby.getHospitalId());
  167 + // childrenRecord.setRemark(baby.getMremark());
  168 + // if (baby.getBabyHeight() != null) {
  169 + // childrenRecord.setHeight(Float.valueOf(baby.getBabyHeight()));
  170 + // }
170 171 // childrenRecord.setBirthNum(baby.get);
171 172 // childrenRecord.setChildbirthType(baby.get);
172   - childrenRecordService.addChildrenRecord(childrenRecord);
173   - }
  173 +// childrenRecordService.addChildrenRecord(childrenRecord);
  174 + }*/
174 175  
175 176  
176 177 /**
... ... @@ -180,6 +181,8 @@
180 181 * @return 操作是否成功
181 182 */
182 183 public BaseResponse addOrUpdateBabyEar(BabyEarAddRequest babyEarAddRequest, Integer userId) {
  184 + BabyEarAddResult babyEarAddResult = new BabyEarAddResult();
  185 +
183 186 BabyEarBase babyEarBase = babyEarAddRequest.getBase();
184 187 //获取儿童信息
185 188 IBasicRequestConvert<BabyModel> convert = babyEarBase;
186 189  
187 190  
... ... @@ -202,29 +205,27 @@
202 205 if (null != baby) {
203 206 //处理儿童person信息
204 207 String pid = handBabyPerson(baby).getId();
205   - //儿童基本信息id
206   - String id = babyEarAddRequest.getBase().getId();
207   - //babyId 不存在新增
208   - String babyPatientId = baby.getId();
209   - if (StringUtils.isEmpty(baby.getId())) {
  208 + babyEarAddResult.setpId(pid);
  209 + String babyPatientId = "";
  210 +
  211 + BabyModelQuery babyQuery = new BabyModelQuery();
  212 + babyQuery.setPid(pid);
  213 + babyQuery.setHospitalId(hId);
  214 + List<BabyModel> babyModels = babyService.queryBabyWithQuery(babyQuery);
  215 +
  216 + if (CollectionUtils.isNotEmpty(babyModels)) {//修改
  217 + BabyModel babyModel = babyModels.get(0);
  218 + baby.setId(babyModel.getId());
  219 + babyService.updateOneBaby(baby, babyModel.getId());
  220 + babyPatientId = babyModel.getId();
  221 + } else {//新增
210 222 baby.setPid(pid);
211 223 baby.setHospitalId(hId);
212 224 baby.setYn(1);
213 225 baby.setCreated(new Date());
214   - BabyModelQuery babyQuery = new BabyModelQuery();
215   - babyQuery.setPid(pid);
216   - babyQuery.setHospitalId(hId);
217   - List<BabyModel> babyModels = babyService.queryBabyWithQuery(babyQuery);
218   - if (CollectionUtils.isNotEmpty(babyModels)) {//修改
219   - BabyModel babyModel = babyModels.get(0);
220   - baby.setId(babyModel.getId());
221   - babyService.updateOneBaby(baby, babyModel.getId());
222   - babyPatientId = babyModel.getId();
223   - } else {//新增
224   - //babyId
225   - babyPatientId = babyService.addOneBaby(baby).getId();
226   - }
  226 + babyPatientId = babyService.addOneBaby(baby).getId();
227 227 }
  228 + babyEarAddResult.setBabyId(babyPatientId);
228 229  
229 230 //数据转换
230 231 BabyPatientExtendEar babyPatientExtendEar = new BabyPatientExtendEar();
231 232  
232 233  
233 234  
... ... @@ -258,13 +259,17 @@
258 259 babyPatientExtendEarService.addBabyPatientExtendEar(babyPatientExtendEar);
259 260 }
260 261  
261   - if (null != babyPatientExtendEarBirth)
  262 + if (null != babyPatientExtendEarBirth) {
262 263 babyPatientExtendEarBirth.setBabyPatientId(babyPatientId);
  264 + babyPatientExtendEarBirth.setBabyEarId(babyPatientExtendEar.getId());
  265 + }
263 266 if (null != babyPatientExtendEarFamily) {
264 267 babyPatientExtendEarFamily.setBabyPatientId(babyPatientId);
  268 + babyPatientExtendEarFamily.setBabyEarId(babyPatientExtendEar.getId());
265 269 }
266 270 if (null != babyPatientExtendEarMother) {
267 271 babyPatientExtendEarMother.setBabyPatientId(babyPatientId);
  272 + babyPatientExtendEarMother.setBabyEarId(babyPatientExtendEar.getId());
268 273 }
269 274  
270 275 BabyPatientExtendEarBirthQuery birthQuery = new BabyPatientExtendEarBirthQuery();
... ... @@ -302,7 +307,8 @@
302 307 babyPatientExtendEarMotherService.addBabyPatientExtendEarMother(babyPatientExtendEarMother);
303 308 }
304 309 }
305   - return RespBuilder.buildSuccess(baby.getId());
  310 + babyEarAddResult.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  311 + return babyEarAddResult;
306 312 }
307 313  
308 314 /**
... ... @@ -326,7 +332,7 @@
326 332 babyEarBase.setAdmissNo(babyPatientExtendEar.getAdmissNo());
327 333 babyEarBase.setBarCode(babyPatientExtendEar.getBarCode());
328 334 babyEarBase.setCreateUserId(babyPatientExtendEar.getCreateUserId());
329   - if(StringUtils.isNotEmpty(babyPatientExtendEar.getmHighRiskFactorId())){
  335 + if (StringUtils.isNotEmpty(babyPatientExtendEar.getmHighRiskFactorId())) {
330 336 String[] dischargeDiagnosis = babyPatientExtendEar.getmHighRiskFactorId().split(",");
331 337 List<String> temp = Arrays.asList(dischargeDiagnosis);
332 338 babyEarBase.setDischargeDiagnosisList(examinationFacade.queryRisk(temp, false).getHighRisk());
... ... @@ -388,7 +394,6 @@
388 394 return objectResponse;
389 395 }
390 396  
391   -
392 397 /**
393 398 * 查看页面儿童听筛建档
394 399 *
... ... @@ -409,6 +414,7 @@
409 414 if (CollectionUtils.isNotEmpty(babyPatientExtendEars)) {
410 415 BabyPatientExtendEar babyPatientExtendEar = babyPatientExtendEars.get(0);
411 416 babyEarBaseView.setAdmissNo(babyPatientExtendEar.getAdmissNo());
  417 + babyEarBaseView.setId(babyPatientExtendEar.getId());
412 418 babyEarBaseView.setDischargeDiagnosis(babyPatientExtendEar.getDischargeDiagnosis());
413 419 babyEarBaseView.setBarCode(babyPatientExtendEar.getBarCode());
414 420 babyEarBaseView.setBarCode(babyPatientExtendEar.getBarCode());
... ... @@ -419,9 +425,6 @@
419 425 babyEarBaseView.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getName());
420 426 }
421 427 babyEarBaseView.setServiceType(ServiceTypeEnums.getTitleById(babyModel.getServiceType()));
422   -
423   -
424   -
425 428 /* 诊断指导 */
426 429 String diagnosis = "";
427 430 if (org.apache.commons.lang.StringUtils.isNotEmpty(babyPatientExtendEar.getDischargeDiagnosis())) {
... ... @@ -507,7 +510,7 @@
507 510 babyEarResult.setBase(babyEarBaseView);
508 511 objectResponse.setData(babyEarResult);
509 512 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
510   - }else {
  513 + } else {
511 514 objectResponse.setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("没有对应的儿童");
512 515 }
513 516 return objectResponse;
514 517  
... ... @@ -532,9 +535,9 @@
532 535 String type = historyJson.getString("type");
533 536 if ("yinJiu".equals(type)) {
534 537 historyStr.append("饮酒、");
535   - } else if("xiYan".equals(type)){
  538 + } else if ("xiYan".equals(type)) {
536 539 historyStr.append("吸烟、");
537   - }else if("xiDu".equals(type)){
  540 + } else if ("xiDu".equals(type)) {
538 541 historyStr.append("吸毒");
539 542 }
540 543 }
... ... @@ -737,7 +740,7 @@
737 740  
738 741 if (historyJson.containsKey("abortionType")) {
739 742 String abortionType = historyJson.getString("abortionType");
740   - historyJson.put("abortionType",AbortionEnums.getName(abortionType));
  743 + historyJson.put("abortionType", AbortionEnums.getName(abortionType));
741 744 }
742 745 babyEarMotherView.setAbortionHistoryType(historyJson.toJSONString());
743 746 }
744 747  
... ... @@ -771,9 +774,9 @@
771 774 String type = historyJson.getString("type");
772 775 if ("yinJiu".equals(type)) {
773 776 historyStr.append("饮酒、");
774   - } else if("xiYan".equals(type)){
  777 + } else if ("xiYan".equals(type)) {
775 778 historyStr.append("吸烟、");
776   - }else if("xiDu".equals(type)){
  779 + } else if ("xiDu".equals(type)) {
777 780 historyStr.append("吸毒");
778 781 }
779 782 }
780 783  
781 784  
782 785  
... ... @@ -876,19 +879,19 @@
876 879 */
877 880 public BabyEarBirthView convertToBabyEarBirthView(BabyPatientExtendEarBirth babyPatientExtendEarBirth) {
878 881 BabyEarBirthView babyEarBirthView = new BabyEarBirthView();
879   - babyEarBirthView.setFetuNumber(babyPatientExtendEarBirth.getFetuNumber() + "");
880   - babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() + "");
  882 + babyEarBirthView.setFetuNumber(babyPatientExtendEarBirth.getFetuNumber() == null ? "" : babyPatientExtendEarBirth.getFetuNumber() + "");
  883 + babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() == null ? "" : babyPatientExtendEarBirth.getProductNumber() + "");
881 884 babyEarBirthView.setBirthWeight(babyPatientExtendEarBirth.getBirthWeight());
882   - babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() + "");
  885 + babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() == null ? "" : babyPatientExtendEarBirth.getProductNumber() + "");
883 886 babyEarBirthView.setBirthWeight(babyPatientExtendEarBirth.getBirthWeight());
884   - if(babyPatientExtendEarBirth.getParturitionType()!=null){
  887 + if (babyPatientExtendEarBirth.getParturitionType() != null) {
885 888 String parturitionType = CZFmTypeEnums.getTitle(babyPatientExtendEarBirth.getParturitionType());
886 889 babyEarBirthView.setParturitionType(parturitionType);
887 890 }
888 891 babyEarBirthView.setTireNumber(babyPatientExtendEarBirth.getTireNumber());
889 892 babyEarBirthView.setBirthDefectDesc(babyPatientExtendEarBirth.getBirthDefectDesc());
890 893 babyEarBirthView.setBirthInjuryPosition(babyPatientExtendEarBirth.getBirthInjuryPosition());
891   - babyEarBirthView.setAmnioticFluid(babyPatientExtendEarBirth.getAmnioticFluidType() + "");
  894 + babyEarBirthView.setAmnioticFluid(babyPatientExtendEarBirth.getAmnioticFluidType() == null ? "" : babyPatientExtendEarBirth.getAmnioticFluidType() + "");
892 895 String parturitType = "无";
893 896 if (babyPatientExtendEarBirth.getAbnormalParturitionType() != null) {
894 897 if (babyPatientExtendEarBirth.getAbnormalParturitionType() == 1) {//有
... ... @@ -913,7 +916,8 @@
913 916 }
914 917 babyEarBirthView.setFetuEmbarras(fetuStr);
915 918  
916   - String apgarScore = babyPatientExtendEarBirth.getApgarScoreOne() + "-" + babyPatientExtendEarBirth.getApgarScoreFive() + "-" + babyPatientExtendEarBirth.getApgarScoreTen();
  919 + String apgarScore = (babyPatientExtendEarBirth.getApgarScoreOne() == null ? "" : babyPatientExtendEarBirth.getApgarScoreOne()) + "-" + (babyPatientExtendEarBirth.getApgarScoreFive() == null ? "" : babyPatientExtendEarBirth.getApgarScoreFive()) + "-" + (babyPatientExtendEarBirth.getApgarScoreTen() == null ? "" : babyPatientExtendEarBirth.getApgarScoreTen());
  920 +
917 921 if (babyPatientExtendEarBirth.getFetuEmbarras() != null && babyPatientExtendEarBirth.getFetuEmbarras() == 1) {
918 922 apgarScore += "不详";
919 923 }
... ... @@ -1021,7 +1025,7 @@
1021 1025 Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId));
1022 1026 if (users != null) {
1023 1027 babyEarBaseView.setCreateUser(users.getName() == null ? "-" : users.getName());
1024   - }else{
  1028 + } else {
1025 1029 babyEarBaseView.setCreateUser(docotorId);
1026 1030 }
1027 1031 } else {
... ... @@ -1075,12 +1079,28 @@
1075 1079 * @return
1076 1080 */
1077 1081 public BaseResponse deleteBabyEar(String babyEarId) {
1078   - BabyPatientExtendEarQuery babyPatientExtendEarQuery = new BabyPatientExtendEarQuery();
1079   - babyPatientExtendEarQuery.setId(babyEarId);
1080   - babyPatientExtendEarQuery.setStatus(YnEnums.YES.getId());
1081   - List<BabyPatientExtendEar> allPatientEar = babyPatientExtendEarService.queryBabyPatientExtendEar(babyPatientExtendEarQuery);
1082   - if (CollectionUtils.isNotEmpty(allPatientEar)) {
1083   - BabyPatientExtendEar babyPatientExtendEar = new BabyPatientExtendEar();
  1082 + if(StringUtils.isNotEmpty(babyEarId)){
  1083 + return new BaseResponse().setErrormsg("请传入请求参数").setErrorcode(ErrorCodeConstants.SUCCESS);
  1084 + }
  1085 +
  1086 + BabyPatientExtendEar babyPatientExtendEar = babyPatientExtendEarService.getBabyPatientExtendEar(babyEarId);
  1087 + if(babyPatientExtendEar!=null){
  1088 + BabyModel babyModels = babyService.getOneBabyById(babyPatientExtendEar.getBabyPatientId());
  1089 + if(babyModels!=null){
  1090 + babyModels.setYn(YnEnums.NO.getId());
  1091 + babyModels.setModified(new Date());
  1092 + babyService.updateOneBaby(babyModels,babyPatientExtendEar.getBabyPatientId());
  1093 + }
  1094 + PersonModelQuery personModelQuery = new PersonModelQuery();
  1095 + personModelQuery.setId(babyPatientExtendEar.getPersonId());
  1096 + List<PersonModel> personModels = personService.queryPersons(personModelQuery);
  1097 + if(CollectionUtils.isNotEmpty(personModels)){
  1098 + PersonModel personModel = personModels.get(0);
  1099 + personModel.setModified(new Date());
  1100 + personModel.setYn(YnEnums.NO.getId());
  1101 + personService.updatePerson(personModel,babyPatientExtendEar.getPersonId());
  1102 + }
  1103 +
1084 1104 babyPatientExtendEar.setStatus(YnEnums.NO.getId());
1085 1105 babyPatientExtendEar.setId(babyEarId);
1086 1106 babyPatientExtendEarService.updateBabyPatientExtendEar(babyPatientExtendEar);
... ... @@ -1201,7 +1221,7 @@
1201 1221 data.put("processOptionDesc", babyPatientExtendEarScreen.getProcessOptionDesc());
1202 1222 data.put("guidOpinion", babyPatientExtendEarScreen.getGuidOpinion());
1203 1223 data.put("checkDoctorId", babyPatientExtendEarScreen.getCheckDoctorId());
1204   - if(StringUtils.isNotEmpty(babyPatientExtendEarScreen.getCheckDoctorId())){
  1224 + if (StringUtils.isNotEmpty(babyPatientExtendEarScreen.getCheckDoctorId())) {
1205 1225 data.put("checkDoctor", usersService.getUsers(Integer.valueOf(babyPatientExtendEarScreen.getCheckDoctorId())).getName());
1206 1226 }
1207 1227 data.put("referralDate", DateUtil.getYyyyMmDd(babyPatientExtendEarScreen.getReferralDate()));
... ... @@ -1222,6 +1242,7 @@
1222 1242 if (StringUtils.isEmpty(id)) {
1223 1243 return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("id不能为空");
1224 1244 }
  1245 +
1225 1246 BabyPatientExtendEarScreen babyPatientExtendEarScreen = new BabyPatientExtendEarScreen();
1226 1247 babyPatientExtendEarScreen.setId(id);
1227 1248 babyPatientExtendEarScreen.setStatus(1);
... ... @@ -1368,7 +1389,7 @@
1368 1389 screenResult.setSrcResult(srcResult);
1369 1390 screenResult.setBabyId(earScreen.getBabyId());
1370 1391 screenResult.setSrcType(earScreen.getScreenType() == 1 ? "初筛" : "复筛");
1371   - if(StringUtils.isNotEmpty(earScreen.getCheckDoctorId())){
  1392 + if (StringUtils.isNotEmpty(earScreen.getCheckDoctorId())) {
1372 1393 screenResult.setSrcDoctor(usersService.getUsers(Integer.valueOf(earScreen.getCheckDoctorId())).getName());
1373 1394 }
1374 1395 screenResult.setSrcTime(DateUtil.getyyyy_MM_dd(earScreen.getScreenDate()));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyPatientExtendEarMotherRequest.java View file @ 7e3d9a5
... ... @@ -4,14 +4,13 @@
4 4 import com.lyms.platform.common.utils.JsonUtil;
5 5 import com.lyms.platform.permission.model.BabyPatientExtendEarMother;
6 6  
7   -import java.util.List;
8 7 import java.util.Map;
9 8  
10 9 /**
11 10 * 儿童听力建档-妊娠信息
12 11 */
13 12 public class BabyPatientExtendEarMotherRequest implements IBasicRequestConvert<BabyPatientExtendEarMother> {
14   -
  13 + private String id;
15 14 /**
16 15 * 妊娠年龄
17 16 */
18 17  
... ... @@ -66,11 +65,19 @@
66 65 * 儿童建档的主键
67 66 */
68 67 private String babyPatientId;
  68 +
  69 + /**
  70 + * 儿童听力档案的主键
  71 + */
  72 + private String babyEarId;
  73 +
  74 +
69 75 @Override
70 76 public BabyPatientExtendEarMother convertToDataModel() {
71 77 BabyPatientExtendEarMother babyPatientExtendEarMother = new BabyPatientExtendEarMother();
72 78 babyPatientExtendEarMother.setGestationAge(gestationAge);
73 79 babyPatientExtendEarMother.setBabyPatientId(babyPatientId);
  80 + babyPatientExtendEarMother.setBabyEarId(babyEarId);
74 81 if(null!=badLifeHistoryType){
75 82 babyPatientExtendEarMother.setBadLifeHistoryType(JsonUtil.obj2JsonString(badLifeHistoryType));
76 83 }
... ... @@ -103,6 +110,14 @@
103 110 return babyPatientExtendEarMother;
104 111 }
105 112  
  113 + public String getBabyEarId() {
  114 + return babyEarId;
  115 + }
  116 +
  117 + public void setBabyEarId(String babyEarId) {
  118 + this.babyEarId = babyEarId;
  119 + }
  120 +
106 121 public Map getRadiationHistoryType() {
107 122 return radiationHistoryType;
108 123 }
... ... @@ -127,6 +142,13 @@
127 142 this.abortionHistoryType = abortionHistoryType;
128 143 }
129 144  
  145 + public String getId() {
  146 + return id;
  147 + }
  148 +
  149 + public void setId(String id) {
  150 + this.id = id;
  151 + }
130 152  
131 153 public Map getViralInfectionHistoryType() {
132 154 return viralInfectionHistoryType;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyEarAddResult.java View file @ 7e3d9a5
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +import com.lyms.platform.common.result.BaseResponse;
  4 +
  5 +/**
  6 + * @auther yangfei
  7 + * @createTime 2017年08月22日 15时14分
  8 + * @discription
  9 + */
  10 +public class BabyEarAddResult extends BaseResponse {
  11 + private String babyId;
  12 + private String pId;
  13 +
  14 + public String getBabyId() {
  15 + return babyId;
  16 + }
  17 +
  18 + public void setBabyId(String babyId) {
  19 + this.babyId = babyId;
  20 + }
  21 +
  22 + public String getpId() {
  23 + return pId;
  24 + }
  25 +
  26 + public void setpId(String pId) {
  27 + this.pId = pId;
  28 + }
  29 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyEarBaseView.java View file @ 7e3d9a5
... ... @@ -8,6 +8,7 @@
8 8 * @discription
9 9 */
10 10 public class BabyEarBaseView {
  11 + private String id;
11 12 private String babyId;
12 13 //儿童名字
13 14 private String name;
... ... @@ -96,6 +97,14 @@
96 97 private String serviceStatus;
97 98 //备注
98 99 private String remark;
  100 +
  101 + public String getId() {
  102 + return id;
  103 + }
  104 +
  105 + public void setId(String id) {
  106 + this.id = id;
  107 + }
99 108  
100 109 public String getBabyId() {
101 110 return babyId;