Пример #1
0
        /// <summary>
        /// Creates the alert.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="name">The name.</param>
        /// <param name="note">The note.</param>
        /// <param name="cdsIdentifier">The CDS identifier.</param>
        /// <returns>
        /// A PatientAlert.
        /// </returns>
        public PatientAlert CreateAlert( Patient patient, string name, string note, string cdsIdentifier )
        {
            var patientAlert = new PatientAlert(patient, name, note, cdsIdentifier);
            _patientAlertRepository.MakePersistent(patientAlert);

            return patientAlert;
        }
Пример #2
0
        /// <summary>
        /// Creates the alert.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="name">The name.</param>
        /// <param name="note">The note.</param>
        /// <param name="cdsIdentifier">The CDS identifier.</param>
        /// <returns>
        /// A PatientAlert.
        /// </returns>
        public PatientAlert CreateAlert(Patient patient, string name, string note, string cdsIdentifier)
        {
            var patientAlert = new PatientAlert(patient, name, note, cdsIdentifier);

            _patientAlertRepository.MakePersistent(patientAlert);

            return(patientAlert);
        }
Пример #3
0
        /// <summary>
        /// Removes the alert.
        /// </summary>
        /// <param name="alert">The alert.</param>
        public virtual void RemoveAlert(PatientAlert alert)
        {
            if (_alerts.Contains(alert))
            {
                _alerts.Remove(alert);
            }
            else
            {
                throw new ArgumentException("Alert not found.");
            }

            var factory = IoC.CurrentContainer.Resolve <IPatientAlertFactory>();

            factory.DestroyAlert(alert);

            NotifyItemRemoved(() => Alerts, alert);
        }
Пример #4
0
 /// <summary>
 /// Destroys the alert.
 /// </summary>
 /// <param name="alert">The alert.</param>
 public void DestroyAlert( PatientAlert alert )
 {
     Check.IsNotNull(alert, "Patient alert is required.");
     _patientAlertRepository.MakeTransient(alert);
 }
Пример #5
0
        /// <summary>
        /// Removes the alert.
        /// </summary>
        /// <param name="alert">The alert.</param>
        public virtual void RemoveAlert(PatientAlert alert)
        {
            if (_alerts.Contains(alert))
            {
                _alerts.Remove(alert);
            }
            else
            {
                throw new ArgumentException("Alert not found.");
            }

            var factory = IoC.CurrentContainer.Resolve<IPatientAlertFactory>();
            factory.DestroyAlert(alert);

            NotifyItemRemoved(() => Alerts, alert);
        }
Пример #6
0
 /// <summary>
 /// Destroys the alert.
 /// </summary>
 /// <param name="alert">The alert.</param>
 public void DestroyAlert(PatientAlert alert)
 {
     Check.IsNotNull(alert, "Patient alert is required.");
     _patientAlertRepository.MakeTransient(alert);
 }