*/
private SurgeryPatient convertToLocalPatientSurgery(PatientSurgeryWs patientSurgeryWs, Patient patient) throws ExceptionDAO {
if (patientSurgeryWs == null) {
return null;
}
Surgery surgery = FacadeDB.getInstance().getSurgerySyncBroker().getSurgeryByRemoteId(patientSurgeryWs.getSurgeryId());
if (surgery == null) {
return null;
}
SurgeryPatient surgeryPatient = new SurgeryPatient();
SurgeryPatientId id = new SurgeryPatientId(patient.getId(), surgery.getId());
surgeryPatient.setId(id);
surgeryPatient.setSurgery(surgery);
surgeryPatient.setPatient(patient);
surgeryPatient.setAgeAtSurgery(patientSurgeryWs.getAgeAtSurgery());
return surgeryPatient;