private void UpdateHelper(PatientProfile profile, PatientProfileDetail detail, bool updatePatient, bool updateProfile, bool updateMrn) { if (updatePatient) { var patient = profile.Patient; var noteAssembler = new PatientNoteAssembler(); noteAssembler.Synchronize(patient, detail.Notes, CurrentUserStaff, PersistenceContext); var attachmentAssembler = new PatientAttachmentAssembler(); attachmentAssembler.Synchronize(patient.Attachments, detail.Attachments, this.CurrentUserStaff, PersistenceContext); var allergyAssembler = new PatientAllergyAssembler(); allergyAssembler.Synchronize(patient.Allergies, detail.Allergies, PersistenceContext); } if (updateProfile) { var assembler = new PatientProfileAssembler(); assembler.UpdatePatientProfile(profile, detail, updateMrn, PersistenceContext); } }