private void LoadWorklistItem(IProtocollingWorkflowService service) { if (_worklistItem == null) { return; } var protocolRequest = new GetProcedureProtocolRequest(_worklistItem.ProcedureRef); var protocolResponse = service.GetProcedureProtocol(protocolRequest); _protocolDetail = protocolResponse.ProtocolDetail; var sb = new StringBuilder(); foreach (var procedure in _protocolDetail.Procedures) { sb.Append(ProcedureFormat.Format(procedure) + ", "); } _proceduresText = sb.ToString().TrimEnd(", ".ToCharArray()); // Load available protocol groups var request = new ListProtocolGroupsForProcedureRequest(_worklistItem.ProcedureRef); var response = service.ListProtocolGroupsForProcedure(request); _protocolGroupChoices = response.ProtocolGroups; _protocolGroup = GetInitialProtocolGroup(); RefreshAvailableProtocolCodes(_protocolDetail.Codes, service); // fill out selected item codes _selectedProtocolCodes.Items.Clear(); _selectedProtocolCodes.Items.AddRange(_protocolDetail.Codes); if (Thread.CurrentPrincipal.IsInRole(ClearCanvas.Ris.Application.Common.AuthorityTokens.Workflow.Protocol.SubmitForReview) && _protocolDetail.Supervisor == null) { // if this user has a default supervisor, retreive it, otherwise leave supervisor as null if (_rememberSupervisor && !String.IsNullOrEmpty(ProtocollingSettings.Default.SupervisorID)) { _protocolDetail.Supervisor = GetStaffByID(ProtocollingSettings.Default.SupervisorID); } } NotifyPropertyChanged("ProtocolGroupChoices"); NotifyPropertyChanged("ProtocolGroup"); NotifyPropertyChanged("SetDefaultProtocolGroupEnabled"); NotifyPropertyChanged("Urgency"); }
private ProtocolGroupSummary GetInitialProtocolGroup() { ProtocolGroupSummary defaultProtocolGroup = null; // Use the default if one exists for this procedure. // Otherwise, get a suggested initial group and set the default to the suggested value _defaultProtocolGroupName = _defaultProtocolGroupProvider[_worklistItem.ProcedureName] ?? (_defaultProtocolGroupProvider[_worklistItem.ProcedureName] = GetSuggestedDefault()); if (string.IsNullOrEmpty(_defaultProtocolGroupName) == false) { defaultProtocolGroup = CollectionUtils.SelectFirst( _protocolGroupChoices, summary => summary.Name == _defaultProtocolGroupName); } defaultProtocolGroup = defaultProtocolGroup ?? CollectionUtils.FirstElement(_protocolGroupChoices); return(defaultProtocolGroup); }
private void SaveChanges() { _protocolGroupDetail.Codes.Clear(); _protocolGroupDetail.Codes.AddRange(_selectedProtocolCodes.Items); _protocolGroupDetail.ReadingGroups.Clear(); _protocolGroupDetail.ReadingGroups.AddRange(_selectedReadingGroups.Items); Platform.GetService <IProtocolAdminService>(service => { if (_isNew) { var response = service.AddProtocolGroup(new AddProtocolGroupRequest(_protocolGroupDetail)); _protocolGroupRef = response.Summary.ProtocolGroupRef; _protocolGroupSummary = response.Summary; } else { var response = service.UpdateProtocolGroup(new UpdateProtocolGroupRequest(_protocolGroupRef, _protocolGroupDetail)); _protocolGroupRef = response.Summary.ProtocolGroupRef; _protocolGroupSummary = response.Summary; } }); }
public ListProtocolGroupsForProcedureResponse(List <ProtocolGroupSummary> protocolGroups, ProtocolGroupSummary initialProtocolGroup) { ProtocolGroups = protocolGroups; InitialProtocolGroup = initialProtocolGroup; }
public UpdateProtocolGroupResponse(ProtocolGroupSummary summary) { Summary = summary; }
public AddProtocolGroupResponse(ProtocolGroupSummary summary) { Summary = summary; }
public GetProtocolGroupDetailRequest(ProtocolGroupSummary protocolGroup) { ProtocolGroup = protocolGroup; }