private static ExternalPractitionerDetail LoadPractitionerDetail(EntityRef practitionerRef) { ExternalPractitionerDetail detail = null; if (practitionerRef != null) { Platform.GetService( delegate(IExternalPractitionerAdminService service) { var request = new LoadExternalPractitionerForEditRequest(practitionerRef); var response = service.LoadExternalPractitionerForEdit(request); detail = response.PractitionerDetail; }); } return(detail); }
public void Apply() { try { var item = (ExternalPractitionerSummary)this.Context.Selection.Item; Platform.GetService( delegate(IExternalPractitionerAdminService service) { var editRequest = new LoadExternalPractitionerForEditRequest(item.PractitionerRef); var editResponse = service.LoadExternalPractitionerForEdit(editRequest); var updateRequest = new UpdateExternalPractitionerRequest(editResponse.PractitionerDetail, true); service.UpdateExternalPractitioner(updateRequest); }); DocumentManager.InvalidateFolder(typeof(UnverifiedFolder)); DocumentManager.InvalidateFolder(typeof(VerifiedTodayFolder)); } catch (Exception e) { ExceptionHandler.Report(e, this.Context.DesktopWindow); } }
//[PrincipalPermission(SecurityAction.Demand, Role = ClearCanvas.Ris.Application.Common.AuthorityTokens.ExternalPractitionerAdmin)] public LoadExternalPractitionerForEditResponse LoadExternalPractitionerForEdit(LoadExternalPractitionerForEditRequest request) { // note that the version of the ExternalPractitionerRef is intentionally ignored here (default behaviour of ReadOperation) var practitioner = PersistenceContext.Load <ExternalPractitioner>(request.PractitionerRef); var assembler = new ExternalPractitionerAssembler(); var response = new LoadExternalPractitionerForEditResponse { PractitionerDetail = assembler.CreateExternalPractitionerDetail(practitioner, this.PersistenceContext) }; if (request.IncludeAlerts) { var alerts = new List <AlertNotification>(); alerts.AddRange(AlertHelper.Instance.Test(practitioner, this.PersistenceContext)); var alertAssembler = new AlertAssembler(); response.Alerts = CollectionUtils.Map <AlertNotification, AlertNotificationDetail>(alerts, alertAssembler.CreateAlertNotification); } return(response); }