|
@ -116,10 +116,13 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
String familySex = IdCardUtil.getSexForIdcard(idCard);
|
|
|
if (familySex.equalsIgnoreCase("男")){
|
|
|
familySex= "1";
|
|
|
sex =1 ;
|
|
|
}else if (familySex.equalsIgnoreCase("女")){
|
|
|
familySex = "0";
|
|
|
sex = 2 ;
|
|
|
}else {
|
|
|
familySex = "2";
|
|
|
sex = 3;
|
|
|
}
|
|
|
String familyAge = String.valueOf(IdCardUtil.getAgeForIdcard(idCard));
|
|
|
BasePatientMemberDictDO basePatientMemberDictDO1 = basePatientMemberDictDao.findOne(dictId);
|
|
@ -217,25 +220,29 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
}else {
|
|
|
com.alibaba.fastjson.JSONArray jsonArray1 = xzzxEntranceService.selectPateintCardByIdCard(idCard);
|
|
|
if (null!=jsonArray1&&jsonArray1.size()>0){
|
|
|
for (int i=0;i<jsonArray1.size();i++){
|
|
|
JSONObject jsonObject = jsonArray1.getJSONObject(i);
|
|
|
String xzcardType = jsonObject.getString("CARD_TYPE");
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = wlyyHospitalSysDictDao.findByHospitalAndDictCode("350211A5010",jsonObject.getString("CARD_TYPE"));
|
|
|
if (hospitalSysDictDO!=null){
|
|
|
jsonObject.put("CARD_TYPE",hospitalSysDictDO.getDictValue());
|
|
|
jsonObject.put("CARD_TYPE_HIS",cardType);
|
|
|
}else {
|
|
|
jsonObject.put("CARD_TYPE",null);
|
|
|
jsonObject.put("CARD_TYPE_HIS",cardType);
|
|
|
}
|
|
|
String familySex = IdCardUtil.getSexForIdcard(idCard);
|
|
|
if (familySex.equalsIgnoreCase("男")){
|
|
|
sex =1 ;
|
|
|
}else if (familySex.equalsIgnoreCase("女")){
|
|
|
sex = 2 ;
|
|
|
}else {
|
|
|
sex = 3;
|
|
|
}
|
|
|
}else {
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
}
|
|
|
basePatientDO.setSex(sex);
|
|
|
SimpleDateFormat sf3 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date saveBirth1 = sf3.parse(birth);
|
|
|
System.out.println("====="+saveBirth1);
|
|
|
basePatientDO.setBirthday(saveBirth1);
|
|
|
if ("xm_xzzx_wx".equalsIgnoreCase(wxId)){
|
|
|
basePatientDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
|
|
|
}else {
|
|
|
SimpleDateFormat sf3 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date saveBirth1 = sf3.parse(birth);
|
|
|
System.out.println("====="+saveBirth1);
|
|
|
basePatientDO.setBirthday(saveBirth1);
|
|
|
}
|
|
|
result.setFamilyRelation(dictId);
|
|
|
result.setFamilyRelationName(dictName);
|
|
|
result.setYktFamilyId(yktFamilyId);
|
|
@ -258,13 +265,15 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
}
|
|
|
result.setFamilyMember(patientNewId);
|
|
|
wlyyPatientFamilyMemberDao.save(result);
|
|
|
patientMappingDO.setIdcard(idCard);
|
|
|
patientMappingDO.setSource("1");
|
|
|
patientMappingDO.setPatientName(familyName);
|
|
|
patientMappingDO.setMappingCode(familyId);
|
|
|
patientMappingDO.setPatient(patientNewId);
|
|
|
patientMappingDO.setCreateTime(new Date());
|
|
|
patientMappingDao.save(patientMappingDO);
|
|
|
if (!"xm_xzzx_wx".equalsIgnoreCase(wxId)){
|
|
|
patientMappingDO.setIdcard(idCard);
|
|
|
patientMappingDO.setSource("1");
|
|
|
patientMappingDO.setPatientName(familyName);
|
|
|
patientMappingDO.setMappingCode(familyId);
|
|
|
patientMappingDO.setPatient(patientNewId);
|
|
|
patientMappingDO.setCreateTime(new Date());
|
|
|
patientMappingDao.save(patientMappingDO);
|
|
|
}
|
|
|
resultMap.put("patientId",patientId);
|
|
|
resultMap.put("familyMember",patientNewId);
|
|
|
resultMap.put("idCard",idCard);
|