public void Play() { AdjustableAudioClip clip; if (clips.Length == 1) { clip = clips[0]; } else { clip = RandomUtils.ChooseRandom(clips); } AudioManager.PlayClip(clip); }
private static VisitSummary GetActiveVisitForPatient(EntityRef patientRef, EnumValueInfo assigningAuthority) { VisitSummary visit = null; // choose from existing visits Platform.GetService( delegate(IOrderEntryService service) { var request = new ListVisitsForPatientRequest(patientRef); var visitResponse = service.ListVisitsForPatient(request); visit = RandomUtils.ChooseRandom(CollectionUtils.Select(visitResponse.Visits, summary => Equals(summary.VisitNumber.AssigningAuthority, assigningAuthority))); }); return(visit); }
private static PatientProfileSummary GetRandomPatient() { var queryString = string.Format("{0}, {1}", RandomUtils.GetRandomAlphaChar(), RandomUtils.GetRandomAlphaChar()); PatientProfileSummary randomProfile = null; Platform.GetService( delegate(IRegistrationWorkflowService service) { // Get only 10 patients var request = new TextQueryRequest { TextQuery = queryString, Page = new SearchResultPage(0, 10) }; var response = service.PatientProfileTextQuery(request); randomProfile = RandomUtils.ChooseRandom(response.Matches); }); return(randomProfile); }