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;