|
@ -4054,14 +4054,57 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public net.sf.json.JSONObject setRecord(String json)throws Exception{
|
|
|
public net.sf.json.JSONObject setRecord(String json,String type)throws Exception{
|
|
|
ArchiveVO archiveVO = objectMapper.readValue(json,ArchiveVO.class);
|
|
|
if(archiveVO!=null){
|
|
|
return entranceService.BS16018(archiveVO,demoFlag);
|
|
|
if(StringUtils.isNotBlank(archiveVO.getBrnl00())){
|
|
|
archiveVO.setBrnl00(IdCardUtil.getAgeForIdcard(archiveVO.getSfzhao())+"");
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(archiveVO.getCsrq00())){
|
|
|
archiveVO.setCsrq00(DateUtil.dateToStr(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()),"yyyyMMddHHmmss"));
|
|
|
}
|
|
|
//保存互联网医院居民账户
|
|
|
savePatient(archiveVO);
|
|
|
//1为需要同步建档
|
|
|
if("1".equals(type)){
|
|
|
return entranceService.BS16018(archiveVO,demoFlag);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 存储居民
|
|
|
* @param archiveVO
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean savePatient(ArchiveVO archiveVO)throws Exception{
|
|
|
BasePatientDO patientDO = basePatientDao.findByIdcardAndDel(archiveVO.getSfzhao(),"1");
|
|
|
if(patientDO == null) {
|
|
|
BasePatientDO patient = new BasePatientDO();
|
|
|
|
|
|
String salt = UUID.randomUUID().toString().substring(0, 5);
|
|
|
String mobile = archiveVO.getYytel0();
|
|
|
String pw = mobile.substring(mobile.length() - 6);
|
|
|
|
|
|
patient.setIdcard(archiveVO.getSfzhao());
|
|
|
patient.setName(archiveVO.getXming0());
|
|
|
patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
|
|
|
patient.setSalt(salt);
|
|
|
patient.setMobile(mobile);
|
|
|
patient.setDel("1");
|
|
|
patient.setEnabled(1);
|
|
|
patient.setLocked(0);
|
|
|
patient.setCreateTime(new Date());
|
|
|
patient.setUpdateTime(new Date());
|
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()));
|
|
|
|
|
|
basePatientDao.save(patient);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取HIIS居民档案信息
|
|
|
* @param idcard
|