Ejemplo n.º 1
0
        /// <summary>
        /// Removes the contact.
        /// </summary>
        /// <param name="patientContact">The patient contact.</param>
        public virtual void RemoveContact(PatientContact patientContact)
        {
            var factory = IoC.CurrentContainer.Resolve <IPatientContactFactory>();

            factory.DestroyPatientContact(patientContact);
            NotifyItemRemoved(() => Contacts, patientContact);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates the patient contact.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="firstName">The first name.</param>
        /// <param name="lastName">The last name.</param>
        /// <returns>
        /// A PatientContact.
        /// </returns>
        public PatientContact CreatePatientContact(Patient patient, string firstName, string lastName)
        {
            var            newPatientContact     = new PatientContact(patient, firstName, lastName);
            PatientContact createdPatientContact = null;

            DomainRuleEngine.CreateRuleEngine(newPatientContact, "CreatePatientContactRuleSet").Execute(
                () =>
            {
                createdPatientContact = newPatientContact;

                _patientContactRepository.MakePersistent(newPatientContact);
            });

            return(createdPatientContact);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates the patient contact.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="firstName">The first name.</param>
        /// <param name="lastName">The last name.</param>
        /// <returns>
        /// A PatientContact.
        /// </returns>
        public PatientContact CreatePatientContact( Patient patient, string firstName, string lastName )
        {
            var newPatientContact = new PatientContact ( patient, firstName, lastName );
            PatientContact createdPatientContact = null;

            DomainRuleEngine.CreateRuleEngine ( newPatientContact, "CreatePatientContactRuleSet" ).Execute (
                () =>
                    {
                        createdPatientContact = newPatientContact;

                        _patientContactRepository.MakePersistent ( newPatientContact );
                    } );

            return createdPatientContact;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientIdentifier"/> class.
        /// </summary>
        /// <param name="patientIdentifierType">Type of the patient identifier.</param>
        /// <param name="identifier">The identifier.</param>
        /// <param name="description">The description.</param>
        /// <param name="effectiveDateRange">The effective date range.</param>
        /// <param name="activeIndicator">The active indicator.</param>
        /// <param name="patientContact">The patient contact.</param>
        public PatientIdentifier(
            PatientIdentifierType patientIdentifierType,
            string identifier,
            string description,
            DateRange effectiveDateRange,
            bool? activeIndicator,
            PatientContact patientContact )
        {
            Check.IsNotNull ( patientIdentifierType, "Patient identifier type is required." );
            Check.IsNotNullOrWhitespace ( identifier, "Identifier is required." );

            _patientIdentifierType = patientIdentifierType;
            _identifier = identifier;
            _description = description;
            _effectiveDateRange = effectiveDateRange;
            _activeIndicator = activeIndicator;
            _patientContact = patientContact;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientIdentifier"/> class.
        /// </summary>
        /// <param name="patientIdentifierType">Type of the patient identifier.</param>
        /// <param name="identifier">The identifier.</param>
        /// <param name="description">The description.</param>
        /// <param name="effectiveDateRange">The effective date range.</param>
        /// <param name="activeIndicator">The active indicator.</param>
        /// <param name="patientContact">The patient contact.</param>
        public PatientIdentifier(
            PatientIdentifierType patientIdentifierType,
            string identifier,
            string description,
            DateRange effectiveDateRange,
            bool?activeIndicator,
            PatientContact patientContact)
        {
            Check.IsNotNull(patientIdentifierType, "Patient identifier type is required.");
            Check.IsNotNullOrWhitespace(identifier, "Identifier is required.");

            _patientIdentifierType = patientIdentifierType;
            _identifier            = identifier;
            _description           = description;
            _effectiveDateRange    = effectiveDateRange;
            _activeIndicator       = activeIndicator;
            _patientContact        = patientContact;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Destroys the patient contact.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 public void DestroyPatientContact(PatientContact patientContact)
 {
     Check.IsNotNull(patientContact, "Patient contact is required.");
     _patientContactRepository.MakeTransient(patientContact);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientContactAggregateNodeBase"/> class.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 protected PatientContactAggregateNodeBase(PatientContact patientContact)
 {
     _patientContact = patientContact;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientContactContactType"/> class.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 /// <param name="contactType">Type of the contact.</param>
 protected internal PatientContactContactType( PatientContact patientContact, PatientContactType contactType )
     : base(patientContact)
 {
     PatientContactType = contactType;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientContactContactType"/> class.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 /// <param name="contactType">Type of the contact.</param>
 protected internal PatientContactContactType(PatientContact patientContact, PatientContactType contactType) : base(patientContact)
 {
     PatientContactType = contactType;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Removes the contact.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 public virtual void RemoveContact(PatientContact patientContact)
 {
     var factory = IoC.CurrentContainer.Resolve<IPatientContactFactory>();
     factory.DestroyPatientContact(patientContact);
     NotifyItemRemoved(() => Contacts, patientContact);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Assigns the patient contact.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 /// <returns>A PatientIdentifierBuilder.</returns>
 public PatientIdentifierBuilder WithPatientContact( PatientContact patientContact )
 {
     _patientContact = patientContact;
     return this;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Assigns the patient contact.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 /// <returns>A PatientIdentifierBuilder.</returns>
 public PatientIdentifierBuilder WithPatientContact(PatientContact patientContact)
 {
     _patientContact = patientContact;
     return(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PatientContactAggregateNodeBase"/> class.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 protected PatientContactAggregateNodeBase(PatientContact patientContact)
 {
     _patientContact = patientContact;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Destroys the patient contact.
 /// </summary>
 /// <param name="patientContact">The patient contact.</param>
 public void DestroyPatientContact( PatientContact patientContact )
 {
     Check.IsNotNull ( patientContact, "Patient contact is required." );
     _patientContactRepository.MakeTransient ( patientContact );
 }