/// <summary> /// Select a colleciton of items from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Collection of Item</returns> public override IEnumerable <Vital> SelectCollection(CommandCriteria criteria) { IEnumerable <Vital> result = null; SR.Admittance admittance = this.GetItemCollection(criteria).SingleOrDefault(); if (admittance != null) { result = new VitalMapper().MapCollection(admittance.Vitals); } return(result); }
/// <summary> /// Select a colleciton of items from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Collection of Item</returns> public override IEnumerable <Admittance> SelectCollection(CommandCriteria criteria) { IEnumerable <Admittance> result = null; SR.Patient patient = this.GetItemCollection(criteria).SingleOrDefault(); if (patient != null) { result = new AdmittanceMapper().MapCollection(patient.Admittances); } return(result); }
/// <summary> /// Select a colleciton of items from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Collection of Item</returns> public override IEnumerable <ClinicalNote> SelectCollection(CommandCriteria criteria) { IEnumerable <ClinicalNote> result = null; EF.Admittance admittance = this.GetItemCollection(criteria).SingleOrDefault(); if (admittance != null) { result = new ClinicalNoteMapperEF().MapCollection(admittance.ClinicalNotes); } return(result); }
/// <summary> /// Select a colleciton of items from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Collection of Item</returns> public override IEnumerable <PatientAllergy> SelectCollection(CommandCriteria criteria) { IEnumerable <PatientAllergy> result = null; EF.Patient patient = this.GetItemCollection(criteria).SingleOrDefault(); if (patient != null) { result = new AllergyMapperEF().MapCollection(patient.PatientAllergies); } return(result); }
/// <summary> /// Processor Method for executing a command /// </summary> /// <param name="callback">Callback Method</param> /// <param name="criteria">Criteria for the Command</param> /// <remarks>This method will happen AYSNC when the RunAsync App setting is true.</remarks> public void Execute(Action <T> callback, CommandCriteria criteria) { this.callback = callback; if (this.runsCommandsAsyc) { this.RunAsyncProcess(criteria); } else { this.RunSyncCommand(criteria); } }
/// <summary> /// Select an item from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Retrieved Item</returns> public override Complaint Select(CommandCriteria criteria) { Complaint result = new Complaint(); SR.Admittance admittance = this.GetItem(criteria); if (admittance != null) { if (admittance.Complaints.Count > 0) { result = new ComplaintMapper().Map(admittance.Complaints.First()); } } return(result); }
public override ChatResponse Map(SR.ChatResponses source) { CommandCriteria chatResponseCriteria = new CommandCriteria(); //chatResponseCriteria.Add("AdmittanceId", source.ID.ToString()); return(new ChatResponse() { ID = source.ID, Response = source.Response, ChatRole = new ChatRole() { ID = source.ChatRole.ID, Name = source.ChatRole.Name } }); }
/// <summary> /// Execute the command for retrieving data for the currently selected patient/admittance. /// </summary> /// <remarks>This method checks to see if the admittance was already previously loaded</remarks> private void ExecuteChangePatientCommand() { if (!this.selectedPatient.Admittance.IsDataLoaded) { // Raise Story Board Event if (this.SelectedPatientChanging != null) { this.SelectedPatientChanging(this, EventArgs.Empty); } CommandCriteria criteria = new CommandCriteria(); criteria.Add("Admittance", this.selectedPatient.Admittance); ChangePatientCommand command = new ChangePatientCommand(); command.Execute(PatientChanged, criteria); } else // If data is already loaded make sure to send data binding notification { this.NotifyPatientChanged(); } }
/// <summary> /// Handles mapping a single model item /// </summary> /// <param name="source">Object(s) returned from the data source</param> /// <returns>Mapped Model Object(s)</returns> public override Admittance Map(SR.Admittance source) { CommandCriteria patientCriteria = new CommandCriteria(); patientCriteria.Add("AdmittanceId", source.ID.ToString()); return(new Admittance() { ID = source.ID, Severity = source.Severity, TimestampIn = source.TimestampIn.ConvertToDateTime(), TimestampOut = source.TimestampOut.ConvertToDateTime(), Comments = source.Comments, Diagnosis = source.Diagnosis, Location = source.Location, Disposition = source.Disposition, EDPatient = this.patientMapper.Map(source.Patient), HospitalStaff = this.staffMapper.MapToCollection(source.Staff), Complaints = this.complaintMapper.MapToCollection(source.Complaints), }); }
/// <summary> /// Retrieve the test data for the patient's admittance history /// </summary> /// <param name="admittances">Patient Admittance history</param> /// <param name="patientId">Patient ID</param> /// <returns>Admittance History with test results data</returns> private AdmittanceCollection GetAdmittanceHistoryTests(IRepositoryProvider factory, AdmittanceCollection admittances, string patientId) { AdmittanceCollection admittanceHistory = admittances; // factory.Get<IRepository<Test>>("TestRepository"); IRepository <Test> testRepository = factory.GetRepository <Test>("TestRepository"); IRepository <ClinicalNote> clinicalNoteRepository = factory.GetRepository <ClinicalNote>("ClinicalNoteRepository"); foreach (Admittance admittance in admittanceHistory) { CommandCriteria criteria = new CommandCriteria(); criteria.Add("PatientId", patientId); criteria.Add("AdmittanceId", admittance.ID.ToString()); admittance.Tests = new TestCollection(testRepository.SelectCollection(criteria)); admittance.ClinicalNotes = new ClinicalNotesCollection(clinicalNoteRepository.SelectCollection(criteria)); } return(admittanceHistory); }
public void GetChatResponses() { if (!string.IsNullOrEmpty(this.ChatText)) { string contactRole = string.Empty; if (this.SelectedContact != null && this.SelectedContact.Profession != null) { contactRole = this.SelectedContact.Profession; } else { contactRole = "Default"; } CommandCriteria criteria = new CommandCriteria(); criteria.Add("Role", contactRole); this.chatRole = criteria["Role"].ToString(); GetChatResponseCommand chatResponse = new GetChatResponseCommand(); chatResponse.Execute(ChatResponseCommand_Complete, criteria); } }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <SR.Admittance> GetCollectionQuery(CommandCriteria criteria) { int admittanceId = criteria.GetIntValue("AdmittanceId"); return(this.dataContext.DataSource.Admittance.Expand("Complaints").Where(d => d.ID == admittanceId)); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <EF.Admittance> GetCollectionQuery(CommandCriteria criteria) { int admittanceId = criteria.GetIntValue("AdmittanceId"); return(this.dataContext.DataSource.Admittance.Include("Orders.Med").Where(d => d.ID == admittanceId)); }
public virtual T Select(CommandCriteria criteria) { return(default(T)); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <SR.Patient> GetCollectionQuery(CommandCriteria criteria) { int patientId = criteria.GetIntValue("PatientId"); return(this.dataContext.DataSource.Patient.Expand("PatientAllergies/Allergy").Where(d => d.ID == patientId)); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <EF.Admittance> GetCollectionQuery(CommandCriteria criteria) { int admittanceId = criteria.GetIntValue("AdmittanceId"); return(this.dataContext.DataSource.Admittance.Include("Tests.BodyRegion").Include("Tests.TestType.TestCategory").Where(d => d.ID == admittanceId)); }
/// <summary> /// Logic for the Medications Command /// </summary> /// <param name="criteria">Criteria for the command</param> /// <returns>Result from executing the command</returns> protected override object ProcessCommand(CommandCriteria criteria) { IRepository <Med> repository = DIManager.Current.Get <IRepository <Med> >("MedicationRepository"); return(new MedicationsCollection(repository.SelectCollection(criteria))); }
/// <summary> /// Logic for the Get Admittance Command /// </summary> /// <param name="criteria">Criteria for the command</param> /// <returns>Result from executing the command</returns> protected override object ProcessCommand(CommandCriteria criteria) { IRepository <Admittance> repository = DIManager.Current.Get <IRepository <Admittance> >("AdmittanceRepository"); return(new AdmittanceCollection(repository.SelectCollection(criteria))); }
/// <summary> /// Get the LINQ Query for retrieving a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected virtual IQueryable <TSource> GetCollectionQuery(CommandCriteria criteria) { return(null); }
/// <summary> /// Abstract processing method. Each command overrides and performs its own logic. /// </summary> /// <param name="criteria">Criteria for the command</param> /// <returns>Result from executing the command</returns> protected abstract object ProcessCommand(CommandCriteria criteria);
/// <summary> /// Main processing logic - Executes Asynchronosly /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void worker_DoWork(object sender, DoWorkEventArgs e) { CommandCriteria criteria = e.Argument as CommandCriteria; e.Result = this.ProcessCommand(criteria); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <SR.Med> GetCollectionQuery(CommandCriteria criteria) { return(this.dataContext.DataSource.Med); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <EF.ChatResponses> GetCollectionQuery(CommandCriteria criteria) { return(this.dataContext.DataSource.ChatResponses.Include("ChatRole")); }
/// <summary> /// Select a colleciton of items from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Collection of Item</returns> public override IEnumerable <ChatResponse> SelectCollection(CommandCriteria criteria) { return(new ChatResponseMapperEF().MapCollection(this.GetItemCollection(criteria))); }
/// <summary> /// Main processing logic - Executes Synchronously /// </summary> /// <param name="criteria"></param> private void RunSyncCommand(CommandCriteria criteria) { this.Notify((T)this.ProcessCommand(criteria)); }
/// <summary> /// Select a colleciton of items from the data source /// </summary> /// <param name="criteria">Criteria for querying the data source</param> /// <returns>Collection of Item</returns> public override IEnumerable <Admittance> SelectCollection(CommandCriteria criteria) { return(new AdmittanceMapper().MapCollection(this.GetItemCollection(criteria))); }
public override IEnumerable <Med> SelectCollection(CommandCriteria criteria) { return(new MedicationMapper().MapCollection(this.GetItemCollection(criteria))); }
public virtual IEnumerable <T> SelectCollection(CommandCriteria criteria) { return(null); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <EF.Patient> GetCollectionQuery(CommandCriteria criteria) { int patientId = criteria.GetIntValue("PatientId"); return(this.dataContext.DataSource.Patient.Include("Admittances").Where(d => d.ID == patientId)); }
/// <summary> /// Get the ADO.NET DS Context for getting a collection of items. /// </summary> /// <param name="criteria">Command Criteria</param> /// <returns>Queryable Context for ADO.NET DS</returns> protected override IQueryable <SR.Admittance> GetCollectionQuery(CommandCriteria criteria) { return(this.dataContext.DataSource.Admittance.Expand( "Patient, Complaints, Staff, Tests").Where( d => d.TimestampIn >= new DateTime(2009, 6, 25) && d.TimestampIn < new DateTime(2009, 6, 26))); }