コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
        /// <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);
            }
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
        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
                }
            });
        }
コード例 #8
0
        /// <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();
            }
        }
コード例 #9
0
        /// <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),
            });
        }
コード例 #10
0
        /// <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);
        }
コード例 #11
0
        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);
            }
        }
コード例 #12
0
        /// <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));
        }
コード例 #13
0
        /// <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));
        }
コード例 #14
0
 public virtual T Select(CommandCriteria criteria)
 {
     return(default(T));
 }
コード例 #15
0
        /// <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));
        }
コード例 #16
0
        /// <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));
        }
コード例 #17
0
        /// <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)));
        }
コード例 #18
0
        /// <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)));
        }
コード例 #19
0
 /// <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);
 }
コード例 #20
0
 /// <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);
コード例 #21
0
        /// <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);
        }
コード例 #22
0
 /// <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);
 }
コード例 #23
0
 /// <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"));
 }
コード例 #24
0
 /// <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)));
 }
コード例 #25
0
 /// <summary>
 /// Main processing logic - Executes Synchronously
 /// </summary>
 /// <param name="criteria"></param>
 private void RunSyncCommand(CommandCriteria criteria)
 {
     this.Notify((T)this.ProcessCommand(criteria));
 }
コード例 #26
0
 /// <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)));
 }
コード例 #27
0
 public override IEnumerable <Med> SelectCollection(CommandCriteria criteria)
 {
     return(new MedicationMapper().MapCollection(this.GetItemCollection(criteria)));
 }
コード例 #28
0
 public virtual IEnumerable <T> SelectCollection(CommandCriteria criteria)
 {
     return(null);
 }
コード例 #29
0
        /// <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));
        }
コード例 #30
0
 /// <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)));
 }