/// <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; }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }