/// <summary> /// Creates the allergy. /// </summary> /// <param name="patient">The patient.</param> /// <param name="allergyStatus">The allergy status.</param> /// <param name="allergenCodedConcept">The allergen coded concept.</param> /// <param name="provenance">The provenance.</param> /// <returns> /// An Allergy. /// </returns> public Allergy CreateAllergy(Patient patient, AllergyStatus allergyStatus, CodedConcept allergenCodedConcept, Provenance provenance) { var allergy = new Allergy(patient, allergyStatus, allergenCodedConcept, provenance); _allergyRepository.MakePersistent(allergy); return(allergy); }
/// <summary> /// Removes the allergy. /// </summary> /// <param name="allergy">The allergy.</param> public virtual void RemoveAllergy(Allergy allergy) { if (_allergies.Contains(allergy)) { _allergies.Remove(allergy); } else { throw new ArgumentException("Allergy not found."); } var factory = IoC.CurrentContainer.Resolve <IAllergyFactory>(); factory.DestroyAllergy(allergy); NotifyItemRemoved(() => Allergies, allergy); }
/// <summary> /// Destroys the allergy. /// </summary> /// <param name="allergy">The allergy.</param> public void DestroyAllergy( Allergy allergy ) { _allergyRepository.MakeTransient ( allergy ); }
/// <summary> /// Creates the allergy. /// </summary> /// <param name="patient">The patient.</param> /// <param name="allergyStatus">The allergy status.</param> /// <param name="allergenCodedConcept">The allergen coded concept.</param> /// <param name="provenance">The provenance.</param> /// <returns> /// An Allergy. /// </returns> public Allergy CreateAllergy(Patient patient, AllergyStatus allergyStatus, CodedConcept allergenCodedConcept, Provenance provenance) { var allergy = new Allergy(patient, allergyStatus, allergenCodedConcept, provenance); _allergyRepository.MakePersistent(allergy); return allergy; }
private static PatientAllergyFreeformType BuildPatientAllergyFreeformType( Allergy drugAllergy ) { var da = new PatientAllergyFreeformType { AllergyName = NcScriptHelper.RemoveUnwantedPartsFromDrugName ( drugAllergy.AllergenCodedConcept.DisplayName ), AllergySeverityTypeID = NcScriptHelper.TransformRemAllergySeverityTypeToNewCropAllergySeverityType ( drugAllergy.AllergySeverityType ), }; return da; }
/// <summary> /// Removes the allergy. /// </summary> /// <param name="allergy">The allergy.</param> public virtual void RemoveAllergy(Allergy allergy) { if (_allergies.Contains(allergy)) { _allergies.Remove(allergy); } else { throw new ArgumentException("Allergy not found."); } var factory = IoC.CurrentContainer.Resolve<IAllergyFactory>(); factory.DestroyAllergy(allergy); NotifyItemRemoved(() => Allergies, allergy); }
private Allergy BuildAllergy( Patient patient, AllergyStatus allergyStatus, CodedConcept allergen ) { var allergy = new Allergy ( patient, allergyStatus, allergen ); Session.SaveOrUpdate ( allergy ); return allergy; }
/// <summary> /// Destroys the allergy. /// </summary> /// <param name="allergy">The allergy.</param> public void DestroyAllergy(Allergy allergy) { _allergyRepository.MakeTransient(allergy); }