|
|
@@ -21,6 +21,7 @@ import com.fs.his.service.IFsPrescribeDrugService;
|
|
|
import com.fs.his.service.IFsPrescribeService;
|
|
|
import com.fs.his.service.IFsStoreOrderService;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
+import com.fs.his.utils.IdCardUtil;
|
|
|
import com.fs.his.utils.qrcode.QRCodeUtils;
|
|
|
import com.fs.his.vo.*;
|
|
|
import com.fs.im.dto.MsgCustomDTO;
|
|
|
@@ -517,7 +518,12 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
return null;
|
|
|
}
|
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
|
- long ageInMillis = currentTimeMillis - patJson.getBirthday();
|
|
|
+ Long birthday = patJson.getBirthday();
|
|
|
+ if (birthday == null) {
|
|
|
+ birthday = IdCardUtil.getBirthdayFromIdCard(patJson.getIdCard());
|
|
|
+ patJson.setBirthday(birthday);
|
|
|
+ }
|
|
|
+ long ageInMillis = currentTimeMillis - birthday;
|
|
|
long ageInSeconds = ageInMillis / 1000;
|
|
|
long ageInYears = ageInSeconds / (365 * 24 * 3600);
|
|
|
fsPrescribe.setPatientAge(ageInYears+"");
|
|
|
@@ -525,7 +531,7 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
fsPrescribe.setPatientName(patJson.getPatientName());
|
|
|
fsPrescribe.setPatientTel(patJson.getMobile());
|
|
|
fsPrescribe.setPatientGender(patJson.getSex().toString());
|
|
|
- fsPrescribe.setPatientBirthday(new SimpleDateFormat("yyyy-MM-dd").format(new Date(patJson.getBirthday())));
|
|
|
+ fsPrescribe.setPatientBirthday(new SimpleDateFormat("yyyy-MM-dd").format(new Date(birthday)));
|
|
|
fsPrescribe.setDoctorId(packageOrder.getDoctorId());
|
|
|
FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(packageOrder.getDoctorId());
|
|
|
if (fsDoctor==null){
|