diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirth.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirth.java
index d4aaa3e..65926d0 100644
--- a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirth.java
+++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirth.java
@@ -1,7 +1,5 @@
package com.lyms.platform.permission.model;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
import java.math.BigDecimal;
/**
@@ -191,8 +189,19 @@ public class BabyPatientExtendEarBirth {
/**
* 所属建档的id
*/
- @JsonIgnore
private String babyPatientId;
+ /***
+ * 儿童听力建档ID
+ */
+ private String babyEarId;
+
+ public String getBabyEarId() {
+ return babyEarId;
+ }
+
+ public void setBabyEarId(String babyEarId) {
+ this.babyEarId = babyEarId;
+ }
public String getId() {
return id;
diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirthQuery.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirthQuery.java
index 99e43b2..6ea2f32 100644
--- a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirthQuery.java
+++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBirthQuery.java
@@ -191,6 +191,18 @@ public class BabyPatientExtendEarBirthQuery extends BaseQuery
* 所属建档的id
*/
private String babyPatientId;
+ /**
+ * 所属建档的id
+ */
+ private String babyEarId;
+
+ public String getBabyEarId() {
+ return babyEarId;
+ }
+
+ public void setBabyEarId(String babyEarId) {
+ this.babyEarId = babyEarId;
+ }
public String getId() {
return id;
diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamily.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamily.java
index 653a624..f45e990 100644
--- a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamily.java
+++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamily.java
@@ -36,6 +36,18 @@ public class BabyPatientExtendEarFamily {
* 儿童建档的主键
*/
private String babyPatientId;
+ /**
+ * 儿童听力建档的主键
+ */
+ private String babyEarId;
+
+ public String getBabyEarId() {
+ return babyEarId;
+ }
+
+ public void setBabyEarId(String babyEarId) {
+ this.babyEarId = babyEarId;
+ }
public String getId() {
return id;
diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamilyQuery.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamilyQuery.java
index 23524a9..0c2e734 100644
--- a/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamilyQuery.java
+++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFamilyQuery.java
@@ -38,6 +38,19 @@ public class BabyPatientExtendEarFamilyQuery extends BaseQuery
*/
private String babyPatientId;
+ /**
+ * 儿童建档的主键
+ */
+ private String babyEarId;
+
+ public String getBabyEarId() {
+ return babyEarId;
+ }
+
+ public void setBabyEarId(String babyEarId) {
+ this.babyEarId = babyEarId;
+ }
+
public String getId()
{
return id;
diff --git a/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBirth.xml b/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBirth.xml
index 4cdd8cb..e5f38f7 100644
--- a/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBirth.xml
+++ b/platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBirth.xml
@@ -31,7 +31,7 @@
-
+
@@ -41,12 +41,13 @@
+
-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})
+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})
@@ -133,7 +134,7 @@ insert into baby_patient_extend_ear_birth (id,fetu_number,product_number,birth_w
ear_poison_type = #{earPoisonType,jdbcType=INTEGER},
- ear_poison_name = #{earPoisonMap,jdbcType=VARCHAR},
+ ear_poison_map = #{earPoisonMap,jdbcType=VARCHAR},
tympanitis_type = #{tympanitisType,jdbcType=INTEGER},
@@ -162,6 +163,9 @@ insert into baby_patient_extend_ear_birth (id,fetu_number,product_number,birth_w
baby_patient_id = #{babyPatientId,jdbcType=VARCHAR},
+
+ baby_ear_id = #{babyEarId,jdbcType=VARCHAR},
+
where id = #{id,jdbcType=VARCHAR}
@@ -174,7 +178,7 @@ delete from baby_patient_extend_ear_birth where id = #{id,jdbcType=VARCHAR}
@@ -274,7 +278,7 @@ select id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_
and ear_poison_type = #{earPoisonType,jdbcType=INTEGER}
- and ear_poison_name = #{earPoisonMap,jdbcType=VARCHAR}
+ and ear_poison_map = #{earPoisonMap,jdbcType=VARCHAR}
and tympanitis_type = #{tympanitisType,jdbcType=INTEGER}
@@ -303,6 +307,9 @@ select id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_
and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
+
+ and baby_ear_id = #{babyEarId,jdbcType=VARCHAR}
+
@@ -310,7 +317,7 @@ select id,fetu_number,product_number,birth_weight,parturition_type,birth_defect_
+
+ baby_ear_id = #{babyEarId,jdbcType=VARCHAR},
+
where id = #{id,jdbcType=VARCHAR}
-delete from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
-
+ delete from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
+
+ select id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_relationship,baby_patient_id,baby_ear_id
+ from baby_patient_extend_ear_family where id = #{id,jdbcType=VARCHAR}
+
@@ -93,6 +97,9 @@ select id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_
and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR}
+
+ and baby_ear_id = #{babyEarId,jdbcType=VARCHAR}
+
@@ -100,7 +107,7 @@ select id,bad_life_history,deaf_type,deat_relationship,proximity_type,proximity_
-
-
\ No newline at end of file
diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
index 6a1a781..0123909 100644
--- a/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
+++ b/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
@@ -2,11 +2,11 @@ package com.lyms.platform.common.utils;
import org.joda.time.DateTime;
-import java.sql.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Calendar;
import java.util.Date;
+import java.util.GregorianCalendar;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -547,6 +547,9 @@ public class DateUtil {
*/
public static String getBabyMonthAge(Date birth, Date checkDate)
{
+ if(birth == null){
+ return "";
+ }
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(checkDate);
rightNow.add(Calendar.MONTH,-1);
diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
index 1f3d816..e8a7024 100644
--- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
+++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
@@ -114,37 +114,38 @@ public class BabyEarFacade {
return personService.addPerson(babyPerson);
}
- private ChildrenPerson fillChildren(BabyModel baby) {
- ChildrenPerson childrenPerson = new ChildrenPerson();
- childrenPerson.setId(UUID.randomUUID().toString().replace("-", ""));
- childrenPerson.setAddressCity(baby.getCityId());
- childrenPerson.setAddressArea(baby.getAreaId());
- childrenPerson.setAddressDetail(baby.getAddress());
- childrenPerson.setAddressProvince(baby.getProvinceId());
- childrenPerson.setAddressStreet(baby.getStreetId());
- childrenPerson.setBasePapersNumber(baby.getMcertNo());
- childrenPerson.setBaseWomanBirth(baby.getMbirth());
- //母亲证件类型
- childrenPerson.setBasePapersType(baby.getMcertTypeId());
- childrenPerson.setBirthday(baby.getBirth());
- childrenPerson.setContactWomanWay(baby.getMphone());
- childrenPerson.setCreateTime(baby.getCreated());
- //母亲文化成都
- childrenPerson.setDegree(baby.getmLevelId());
- childrenPerson.setDoctorId(baby.getBuildDoctor());
- childrenPerson.setGender(baby.getSex());
- childrenPerson.setMotherId(baby.getParentId());
- childrenPerson.setName(baby.getName());
- childrenPerson.setPapersNum(baby.getCardNo());
- childrenPerson.setOccupation(baby.getFproTypeId());
- return childrenPerson;
- }
-
- private void addMysqlBabyRecord(BabyEarBase babyarBaseb) {
- BabyModel baby = babyarBaseb.convertToDataModel();
+ // private ChildrenPerson fillChildren(BabyModel baby) {
+ // ChildrenPerson childrenPerson = new ChildrenPerson();
+ // childrenPerson.setId(baby.getId());
+ // childrenPerson.setAddressCity(baby.getCityId());
+ // childrenPerson.setAddressArea(baby.getAreaId());
+ // childrenPerson.setAddressDetail(baby.getAddress());
+ // childrenPerson.setAddressProvince(baby.getProvinceId());
+ // childrenPerson.setAddressStreet(baby.getStreetId());
+ // childrenPerson.setBasePapersNumber(baby.getMcertNo());
+ // childrenPerson.setBaseWomanBirth(baby.getMbirth());
+ // //母亲证件类型
+ // childrenPerson.setBasePapersType(baby.getMcertTypeId());
+ // childrenPerson.setBirthday(baby.getBirth());
+ // childrenPerson.setContactWomanWay(baby.getMphone());
+ // childrenPerson.setCreateTime(baby.getCreated());
+ // //母亲文化成都
+ // childrenPerson.setDegree(baby.getmLevelId());
+ // childrenPerson.setDoctorId(baby.getBuildDoctor());
+ // childrenPerson.setGender(baby.getSex());
+ // childrenPerson.setMotherId(baby.getParentId());
+ // childrenPerson.setName(baby.getName());
+ // childrenPerson.setPapersNum(baby.getCardNo());
+ // childrenPerson.setOccupation(baby.getFproTypeId());
+ // return childrenPerson;
+ // }
+
+ /*
+ private void addMysqlBabyRecord(BabyModel baby) {
ChildrenPerson childrenPerson = fillChildren(baby);
//同时写mysql表
childrenPersonService.addChildrenPerson(childrenPerson);
+
String mysqlBabyId = childrenPerson.getId();
ChildrenFather childrenFather = new ChildrenFather();
@@ -158,19 +159,19 @@ public class BabyEarFacade {
childrenFather.setChildId(mysqlBabyId);
childrenFatherService.addChildrenFather(childrenFather);
- ChildrenRecord childrenRecord = new ChildrenRecord();
- childrenRecord.setId(UUID.randomUUID().toString().replace("-", ""));
- childrenRecord.setChildId(mysqlBabyId);
- childrenRecord.setCreateTime(baby.getCreated());
- childrenRecord.setBirthHospital(baby.getHospitalId());
- childrenRecord.setRemark(baby.getMremark());
- if (baby.getBabyHeight() != null) {
- childrenRecord.setHeight(Float.valueOf(baby.getBabyHeight()));
- }
+ // ChildrenRecord childrenRecord = new ChildrenRecord();
+ // childrenRecord.setId(UUID.randomUUID().toString().replace("-", ""));
+ // childrenRecord.setChildId(mysqlBabyId);
+ // childrenRecord.setCreateTime(baby.getCreated());
+ // childrenRecord.setBirthHospital(baby.getHospitalId());
+ // childrenRecord.setRemark(baby.getMremark());
+ // if (baby.getBabyHeight() != null) {
+ // childrenRecord.setHeight(Float.valueOf(baby.getBabyHeight()));
+ // }
// childrenRecord.setBirthNum(baby.get);
// childrenRecord.setChildbirthType(baby.get);
- childrenRecordService.addChildrenRecord(childrenRecord);
- }
+// childrenRecordService.addChildrenRecord(childrenRecord);
+ }*/
/**
@@ -180,6 +181,8 @@ public class BabyEarFacade {
* @return 操作是否成功
*/
public BaseResponse addOrUpdateBabyEar(BabyEarAddRequest babyEarAddRequest, Integer userId) {
+ BabyEarAddResult babyEarAddResult = new BabyEarAddResult();
+
BabyEarBase babyEarBase = babyEarAddRequest.getBase();
//获取儿童信息
IBasicRequestConvert convert = babyEarBase;
@@ -202,29 +205,27 @@ public class BabyEarFacade {
if (null != baby) {
//处理儿童person信息
String pid = handBabyPerson(baby).getId();
- //儿童基本信息id
- String id = babyEarAddRequest.getBase().getId();
- //babyId 不存在新增
- String babyPatientId = baby.getId();
- if (StringUtils.isEmpty(baby.getId())) {
+ babyEarAddResult.setpId(pid);
+ String babyPatientId = "";
+
+ BabyModelQuery babyQuery = new BabyModelQuery();
+ babyQuery.setPid(pid);
+ babyQuery.setHospitalId(hId);
+ List babyModels = babyService.queryBabyWithQuery(babyQuery);
+
+ if (CollectionUtils.isNotEmpty(babyModels)) {//修改
+ BabyModel babyModel = babyModels.get(0);
+ baby.setId(babyModel.getId());
+ babyService.updateOneBaby(baby, babyModel.getId());
+ babyPatientId = babyModel.getId();
+ } else {//新增
baby.setPid(pid);
baby.setHospitalId(hId);
baby.setYn(1);
baby.setCreated(new Date());
- BabyModelQuery babyQuery = new BabyModelQuery();
- babyQuery.setPid(pid);
- babyQuery.setHospitalId(hId);
- List babyModels = babyService.queryBabyWithQuery(babyQuery);
- if (CollectionUtils.isNotEmpty(babyModels)) {//修改
- BabyModel babyModel = babyModels.get(0);
- baby.setId(babyModel.getId());
- babyService.updateOneBaby(baby, babyModel.getId());
- babyPatientId = babyModel.getId();
- } else {//新增
- //babyId
- babyPatientId = babyService.addOneBaby(baby).getId();
- }
+ babyPatientId = babyService.addOneBaby(baby).getId();
}
+ babyEarAddResult.setBabyId(babyPatientId);
//数据转换
BabyPatientExtendEar babyPatientExtendEar = new BabyPatientExtendEar();
@@ -258,13 +259,17 @@ public class BabyEarFacade {
babyPatientExtendEarService.addBabyPatientExtendEar(babyPatientExtendEar);
}
- if (null != babyPatientExtendEarBirth)
+ if (null != babyPatientExtendEarBirth) {
babyPatientExtendEarBirth.setBabyPatientId(babyPatientId);
+ babyPatientExtendEarBirth.setBabyEarId(babyPatientExtendEar.getId());
+ }
if (null != babyPatientExtendEarFamily) {
babyPatientExtendEarFamily.setBabyPatientId(babyPatientId);
+ babyPatientExtendEarFamily.setBabyEarId(babyPatientExtendEar.getId());
}
if (null != babyPatientExtendEarMother) {
babyPatientExtendEarMother.setBabyPatientId(babyPatientId);
+ babyPatientExtendEarMother.setBabyEarId(babyPatientExtendEar.getId());
}
BabyPatientExtendEarBirthQuery birthQuery = new BabyPatientExtendEarBirthQuery();
@@ -302,7 +307,8 @@ public class BabyEarFacade {
babyPatientExtendEarMotherService.addBabyPatientExtendEarMother(babyPatientExtendEarMother);
}
}
- return RespBuilder.buildSuccess(baby.getId());
+ babyEarAddResult.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
+ return babyEarAddResult;
}
/**
@@ -326,7 +332,7 @@ public class BabyEarFacade {
babyEarBase.setAdmissNo(babyPatientExtendEar.getAdmissNo());
babyEarBase.setBarCode(babyPatientExtendEar.getBarCode());
babyEarBase.setCreateUserId(babyPatientExtendEar.getCreateUserId());
- if(StringUtils.isNotEmpty(babyPatientExtendEar.getmHighRiskFactorId())){
+ if (StringUtils.isNotEmpty(babyPatientExtendEar.getmHighRiskFactorId())) {
String[] dischargeDiagnosis = babyPatientExtendEar.getmHighRiskFactorId().split(",");
List temp = Arrays.asList(dischargeDiagnosis);
babyEarBase.setDischargeDiagnosisList(examinationFacade.queryRisk(temp, false).getHighRisk());
@@ -388,7 +394,6 @@ public class BabyEarFacade {
return objectResponse;
}
-
/**
* 查看页面儿童听筛建档
*
@@ -409,6 +414,7 @@ public class BabyEarFacade {
if (CollectionUtils.isNotEmpty(babyPatientExtendEars)) {
BabyPatientExtendEar babyPatientExtendEar = babyPatientExtendEars.get(0);
babyEarBaseView.setAdmissNo(babyPatientExtendEar.getAdmissNo());
+ babyEarBaseView.setId(babyPatientExtendEar.getId());
babyEarBaseView.setDischargeDiagnosis(babyPatientExtendEar.getDischargeDiagnosis());
babyEarBaseView.setBarCode(babyPatientExtendEar.getBarCode());
babyEarBaseView.setBarCode(babyPatientExtendEar.getBarCode());
@@ -419,9 +425,6 @@ public class BabyEarFacade {
babyEarBaseView.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getName());
}
babyEarBaseView.setServiceType(ServiceTypeEnums.getTitleById(babyModel.getServiceType()));
-
-
-
/* 诊断指导 */
String diagnosis = "";
if (org.apache.commons.lang.StringUtils.isNotEmpty(babyPatientExtendEar.getDischargeDiagnosis())) {
@@ -507,7 +510,7 @@ public class BabyEarFacade {
babyEarResult.setBase(babyEarBaseView);
objectResponse.setData(babyEarResult);
objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
- }else {
+ } else {
objectResponse.setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("没有对应的儿童");
}
return objectResponse;
@@ -532,9 +535,9 @@ public class BabyEarFacade {
String type = historyJson.getString("type");
if ("yinJiu".equals(type)) {
historyStr.append("饮酒、");
- } else if("xiYan".equals(type)){
+ } else if ("xiYan".equals(type)) {
historyStr.append("吸烟、");
- }else if("xiDu".equals(type)){
+ } else if ("xiDu".equals(type)) {
historyStr.append("吸毒");
}
}
@@ -737,7 +740,7 @@ public class BabyEarFacade {
if (historyJson.containsKey("abortionType")) {
String abortionType = historyJson.getString("abortionType");
- historyJson.put("abortionType",AbortionEnums.getName(abortionType));
+ historyJson.put("abortionType", AbortionEnums.getName(abortionType));
}
babyEarMotherView.setAbortionHistoryType(historyJson.toJSONString());
}
@@ -771,9 +774,9 @@ public class BabyEarFacade {
String type = historyJson.getString("type");
if ("yinJiu".equals(type)) {
historyStr.append("饮酒、");
- } else if("xiYan".equals(type)){
+ } else if ("xiYan".equals(type)) {
historyStr.append("吸烟、");
- }else if("xiDu".equals(type)){
+ } else if ("xiDu".equals(type)) {
historyStr.append("吸毒");
}
}
@@ -876,19 +879,19 @@ public class BabyEarFacade {
*/
public BabyEarBirthView convertToBabyEarBirthView(BabyPatientExtendEarBirth babyPatientExtendEarBirth) {
BabyEarBirthView babyEarBirthView = new BabyEarBirthView();
- babyEarBirthView.setFetuNumber(babyPatientExtendEarBirth.getFetuNumber() + "");
- babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() + "");
+ babyEarBirthView.setFetuNumber(babyPatientExtendEarBirth.getFetuNumber() == null ? "" : babyPatientExtendEarBirth.getFetuNumber() + "");
+ babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() == null ? "" : babyPatientExtendEarBirth.getProductNumber() + "");
babyEarBirthView.setBirthWeight(babyPatientExtendEarBirth.getBirthWeight());
- babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() + "");
+ babyEarBirthView.setProductNumber(babyPatientExtendEarBirth.getProductNumber() == null ? "" : babyPatientExtendEarBirth.getProductNumber() + "");
babyEarBirthView.setBirthWeight(babyPatientExtendEarBirth.getBirthWeight());
- if(babyPatientExtendEarBirth.getParturitionType()!=null){
+ if (babyPatientExtendEarBirth.getParturitionType() != null) {
String parturitionType = CZFmTypeEnums.getTitle(babyPatientExtendEarBirth.getParturitionType());
babyEarBirthView.setParturitionType(parturitionType);
}
babyEarBirthView.setTireNumber(babyPatientExtendEarBirth.getTireNumber());
babyEarBirthView.setBirthDefectDesc(babyPatientExtendEarBirth.getBirthDefectDesc());
babyEarBirthView.setBirthInjuryPosition(babyPatientExtendEarBirth.getBirthInjuryPosition());
- babyEarBirthView.setAmnioticFluid(babyPatientExtendEarBirth.getAmnioticFluidType() + "");
+ babyEarBirthView.setAmnioticFluid(babyPatientExtendEarBirth.getAmnioticFluidType() == null ? "" : babyPatientExtendEarBirth.getAmnioticFluidType() + "");
String parturitType = "无";
if (babyPatientExtendEarBirth.getAbnormalParturitionType() != null) {
if (babyPatientExtendEarBirth.getAbnormalParturitionType() == 1) {//有
@@ -913,7 +916,8 @@ public class BabyEarFacade {
}
babyEarBirthView.setFetuEmbarras(fetuStr);
- String apgarScore = babyPatientExtendEarBirth.getApgarScoreOne() + "-" + babyPatientExtendEarBirth.getApgarScoreFive() + "-" + babyPatientExtendEarBirth.getApgarScoreTen();
+ String apgarScore = (babyPatientExtendEarBirth.getApgarScoreOne() == null ? "" : babyPatientExtendEarBirth.getApgarScoreOne()) + "-" + (babyPatientExtendEarBirth.getApgarScoreFive() == null ? "" : babyPatientExtendEarBirth.getApgarScoreFive()) + "-" + (babyPatientExtendEarBirth.getApgarScoreTen() == null ? "" : babyPatientExtendEarBirth.getApgarScoreTen());
+
if (babyPatientExtendEarBirth.getFetuEmbarras() != null && babyPatientExtendEarBirth.getFetuEmbarras() == 1) {
apgarScore += "不详";
}
@@ -1021,7 +1025,7 @@ public class BabyEarFacade {
Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId));
if (users != null) {
babyEarBaseView.setCreateUser(users.getName() == null ? "-" : users.getName());
- }else{
+ } else {
babyEarBaseView.setCreateUser(docotorId);
}
} else {
@@ -1075,12 +1079,28 @@ public class BabyEarFacade {
* @return
*/
public BaseResponse deleteBabyEar(String babyEarId) {
- BabyPatientExtendEarQuery babyPatientExtendEarQuery = new BabyPatientExtendEarQuery();
- babyPatientExtendEarQuery.setId(babyEarId);
- babyPatientExtendEarQuery.setStatus(YnEnums.YES.getId());
- List allPatientEar = babyPatientExtendEarService.queryBabyPatientExtendEar(babyPatientExtendEarQuery);
- if (CollectionUtils.isNotEmpty(allPatientEar)) {
- BabyPatientExtendEar babyPatientExtendEar = new BabyPatientExtendEar();
+ if(StringUtils.isNotEmpty(babyEarId)){
+ return new BaseResponse().setErrormsg("请传入请求参数").setErrorcode(ErrorCodeConstants.SUCCESS);
+ }
+
+ BabyPatientExtendEar babyPatientExtendEar = babyPatientExtendEarService.getBabyPatientExtendEar(babyEarId);
+ if(babyPatientExtendEar!=null){
+ BabyModel babyModels = babyService.getOneBabyById(babyPatientExtendEar.getBabyPatientId());
+ if(babyModels!=null){
+ babyModels.setYn(YnEnums.NO.getId());
+ babyModels.setModified(new Date());
+ babyService.updateOneBaby(babyModels,babyPatientExtendEar.getBabyPatientId());
+ }
+ PersonModelQuery personModelQuery = new PersonModelQuery();
+ personModelQuery.setId(babyPatientExtendEar.getPersonId());
+ List personModels = personService.queryPersons(personModelQuery);
+ if(CollectionUtils.isNotEmpty(personModels)){
+ PersonModel personModel = personModels.get(0);
+ personModel.setModified(new Date());
+ personModel.setYn(YnEnums.NO.getId());
+ personService.updatePerson(personModel,babyPatientExtendEar.getPersonId());
+ }
+
babyPatientExtendEar.setStatus(YnEnums.NO.getId());
babyPatientExtendEar.setId(babyEarId);
babyPatientExtendEarService.updateBabyPatientExtendEar(babyPatientExtendEar);
@@ -1201,7 +1221,7 @@ public class BabyEarFacade {
data.put("processOptionDesc", babyPatientExtendEarScreen.getProcessOptionDesc());
data.put("guidOpinion", babyPatientExtendEarScreen.getGuidOpinion());
data.put("checkDoctorId", babyPatientExtendEarScreen.getCheckDoctorId());
- if(StringUtils.isNotEmpty(babyPatientExtendEarScreen.getCheckDoctorId())){
+ if (StringUtils.isNotEmpty(babyPatientExtendEarScreen.getCheckDoctorId())) {
data.put("checkDoctor", usersService.getUsers(Integer.valueOf(babyPatientExtendEarScreen.getCheckDoctorId())).getName());
}
data.put("referralDate", DateUtil.getYyyyMmDd(babyPatientExtendEarScreen.getReferralDate()));
@@ -1222,6 +1242,7 @@ public class BabyEarFacade {
if (StringUtils.isEmpty(id)) {
return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("id不能为空");
}
+
BabyPatientExtendEarScreen babyPatientExtendEarScreen = new BabyPatientExtendEarScreen();
babyPatientExtendEarScreen.setId(id);
babyPatientExtendEarScreen.setStatus(1);
@@ -1368,7 +1389,7 @@ public class BabyEarFacade {
screenResult.setSrcResult(srcResult);
screenResult.setBabyId(earScreen.getBabyId());
screenResult.setSrcType(earScreen.getScreenType() == 1 ? "初筛" : "复筛");
- if(StringUtils.isNotEmpty(earScreen.getCheckDoctorId())){
+ if (StringUtils.isNotEmpty(earScreen.getCheckDoctorId())) {
screenResult.setSrcDoctor(usersService.getUsers(Integer.valueOf(earScreen.getCheckDoctorId())).getName());
}
screenResult.setSrcTime(DateUtil.getyyyy_MM_dd(earScreen.getScreenDate()));
diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyPatientExtendEarMotherRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyPatientExtendEarMotherRequest.java
index 60b1ec4..7c842b3 100644
--- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyPatientExtendEarMotherRequest.java
+++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyPatientExtendEarMotherRequest.java
@@ -4,14 +4,13 @@ import com.lyms.platform.common.base.IBasicRequestConvert;
import com.lyms.platform.common.utils.JsonUtil;
import com.lyms.platform.permission.model.BabyPatientExtendEarMother;
-import java.util.List;
import java.util.Map;
/**
* 儿童听力建档-妊娠信息
*/
public class BabyPatientExtendEarMotherRequest implements IBasicRequestConvert {
-
+ private String id;
/**
* 妊娠年龄
*/
@@ -66,11 +65,19 @@ public class BabyPatientExtendEarMotherRequest implements IBasicRequestConvert