|
@ -392,7 +392,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
|
|
|
//添加核酸预约关联家属
|
|
|
@Transactional
|
|
|
public MixEnvelop addNatFamily(String patientId, String familyName, String dictId, String cardType, String idCard, String phoneNum,boolean demo,String medicareType,String medicare,String clinicId,String idtype,String idtypeName) throws Exception {
|
|
|
public MixEnvelop addNatFamily(String patientId, String familyName, String dictId, String cardType, String idCard, String phoneNum,boolean demo,String medicareType,String medicare,String clinicId,String idtype,String idtypeName,String sex,String age,String birth) throws Exception {
|
|
|
MixEnvelop mixEnvelop = new MixEnvelop();
|
|
|
try{
|
|
|
List<BaseNatPatientFamilyMemberDO> natPatientFamilyMemberDOList = natPatientFamilyMemberDao.findbyPatientAndFamilyRelationAndNameAndIdcard(patientId,familyName,idCard);
|
|
@ -406,20 +406,39 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
if (null!=basePatientMemberDictDO){
|
|
|
dictName = basePatientMemberDictDO.getRelationName();
|
|
|
}
|
|
|
String birth = IdCardUtil.getBirthdayForIdcardStr2(idCard);
|
|
|
int sex=3;
|
|
|
String familySex = IdCardUtil.getSexForIdcard(idCard);
|
|
|
if (familySex.equalsIgnoreCase("男")){
|
|
|
sex =1 ;
|
|
|
}else if (familySex.equalsIgnoreCase("女")){
|
|
|
sex = 2 ;
|
|
|
if (!StringUtils.isNotBlank(birth)){
|
|
|
birth = IdCardUtil.getBirthdayForIdcardStr2(idCard);
|
|
|
}
|
|
|
if (!StringUtils.isNotBlank(sex)){
|
|
|
sex="3";
|
|
|
String familySex = IdCardUtil.getSexForIdcard(idCard);
|
|
|
if (familySex.equalsIgnoreCase("男")){
|
|
|
sex ="1" ;
|
|
|
}else if (familySex.equalsIgnoreCase("女")){
|
|
|
sex = "2" ;
|
|
|
}
|
|
|
}
|
|
|
String familyAge = String.valueOf(IdCardUtil.getAgeForIdcard(idCard));
|
|
|
/*if (!StringUtils.isNotBlank(age)){
|
|
|
age = String.valueOf(IdCardUtil.getAgeForIdcard(idCard));
|
|
|
}else {*/
|
|
|
int age1 = 0;
|
|
|
int year = Integer.valueOf(birth.substring(0, 4));
|
|
|
int month = Integer.valueOf(birth.substring(4, 6));
|
|
|
int day = Integer.valueOf(birth.substring(6));
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
age1 = cal.get(Calendar.YEAR) - year;
|
|
|
//周岁计算
|
|
|
if (cal.get(Calendar.MONTH) < (month - 1) || (cal.get(Calendar.MONTH) == (month - 1) && cal.get(Calendar.DATE) < day)) {
|
|
|
age1--;
|
|
|
}
|
|
|
age = age1+"";
|
|
|
|
|
|
/* }*/
|
|
|
ArchiveVO archiveVO = new ArchiveVO();
|
|
|
archiveVO.setXming0(familyName);
|
|
|
archiveVO.setSfzhao(idCard);
|
|
|
archiveVO.setXbie00(sex+"");
|
|
|
archiveVO.setBrnl00(familyAge);
|
|
|
archiveVO.setXbie00(sex);
|
|
|
archiveVO.setBrnl00(age);
|
|
|
archiveVO.setYytel0(phoneNum);
|
|
|
archiveVO.setCsrq00(birth);
|
|
|
archiveVO.setCardtype("X");
|
|
@ -454,9 +473,9 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
result.setPatient(patientId);
|
|
|
result.setIdcard(idCard);
|
|
|
result.setMobile(phoneNum);
|
|
|
result.setAge(familyAge);
|
|
|
result.setAge(age);
|
|
|
result.setName(familyName);
|
|
|
result.setSex(sex);
|
|
|
result.setSex(Integer.parseInt(sex));
|
|
|
result.setIdType(idtype);
|
|
|
result.setIdTypeName(idtypeName);
|
|
|
natPatientFamilyMemberDao.save(result);
|