|
@ -4055,23 +4055,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public net.sf.json.JSONObject setRecord(String json,String type)throws Exception{
|
|
|
net.sf.json.JSONObject rs = new JSONObject();
|
|
|
ArchiveVO archiveVO = objectMapper.readValue(json,ArchiveVO.class);
|
|
|
if(archiveVO!=null){
|
|
|
if(StringUtils.isNotBlank(archiveVO.getBrnl00())){
|
|
|
if(StringUtils.isBlank(archiveVO.getBrnl00())){
|
|
|
archiveVO.setBrnl00(IdCardUtil.getAgeForIdcard(archiveVO.getSfzhao())+"");
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(archiveVO.getCsrq00())){
|
|
|
archiveVO.setCsrq00(DateUtil.dateToStr(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()),"yyyyMMddHHmmss"));
|
|
|
if(StringUtils.isBlank(archiveVO.getCsrq00())){
|
|
|
archiveVO.setCsrq00(DateUtil.dateToStr(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()),"yyyyMMdd"));
|
|
|
}
|
|
|
//保存互联网医院居民账户
|
|
|
savePatient(archiveVO);
|
|
|
//1为需要同步建档
|
|
|
if("1".equals(type)){
|
|
|
return entranceService.BS16018(archiveVO,demoFlag);
|
|
|
|
|
|
rs = entranceService.BS16018(archiveVO,demoFlag);
|
|
|
}
|
|
|
//保存互联网医院居民账户
|
|
|
BasePatientDO patientDO = savePatient(archiveVO);
|
|
|
rs.put("patient",patientDO.getId());
|
|
|
}
|
|
|
return null;
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -4079,7 +4080,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param archiveVO
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean savePatient(ArchiveVO archiveVO)throws Exception{
|
|
|
public BasePatientDO savePatient(ArchiveVO archiveVO)throws Exception{
|
|
|
BasePatientDO patientDO = basePatientDao.findByIdcardAndDel(archiveVO.getSfzhao(),"1");
|
|
|
if(patientDO == null) {
|
|
|
BasePatientDO patient = new BasePatientDO();
|
|
@ -4100,9 +4101,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
patient.setUpdateTime(new Date());
|
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()));
|
|
|
|
|
|
basePatientDao.save(patient);
|
|
|
return basePatientDao.save(patient);
|
|
|
}
|
|
|
return true;
|
|
|
return patientDO;
|
|
|
}
|
|
|
|
|
|
/**
|