Example #1
0
        /// <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);
        }
Example #2
0
        /// <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);
        }
Example #3
0
 /// <summary>
 /// Destroys the allergy.
 /// </summary>
 /// <param name="allergy">The allergy.</param>
 public void DestroyAllergy( Allergy allergy )
 {
     _allergyRepository.MakeTransient ( allergy );
 }
Example #4
0
 /// <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;
 }
Example #5
0
 private static PatientAllergyFreeformType BuildPatientAllergyFreeformType( Allergy drugAllergy )
 {
     var da = new PatientAllergyFreeformType
         {
             AllergyName = NcScriptHelper.RemoveUnwantedPartsFromDrugName ( drugAllergy.AllergenCodedConcept.DisplayName ),
             AllergySeverityTypeID =
                 NcScriptHelper.TransformRemAllergySeverityTypeToNewCropAllergySeverityType (
                     drugAllergy.AllergySeverityType ),
         };
     return da;
 }
Example #6
0
        /// <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;
 }
Example #8
0
 /// <summary>
 /// Destroys the allergy.
 /// </summary>
 /// <param name="allergy">The allergy.</param>
 public void DestroyAllergy(Allergy allergy)
 {
     _allergyRepository.MakeTransient(allergy);
 }