Beispiel #1
0
        /// <summary>
        /// Creates the provenance.
        /// </summary>
        /// <param name="taggedDataElement">The tagged data element.</param>
        /// <param name="signedTimestamp">The signed timestamp.</param>
        /// <returns>
        /// A provenance.
        /// </returns>
        public Provenance CreateProvenance(TaggedDataElement taggedDataElement, DateTimeOffset signedTimestamp)
        {
            var provenance = new Provenance(taggedDataElement, signedTimestamp);

            _provenanceRepository.MakePersistent(provenance);
            return(provenance);
        }
Beispiel #2
0
        /// <summary>
        /// Creates the medication.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="medicationCodeCodedConcept">The medication code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        /// <returns>A Medication.</returns>
        public Medication CreateMedication(Patient patient, CodedConcept medicationCodeCodedConcept,  Provenance provenance)
        {
            var medication = new Medication(patient, medicationCodeCodedConcept, provenance);

            _medicationRepository.MakePersistent(medication);

            return medication;
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Medication"/> class.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="medicationCodeCodedConcept">The medication code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        protected internal Medication(Patient patient, CodedConcept medicationCodeCodedConcept, Provenance provenance)
        {
            Check.IsNotNull(patient, "Patient is required.");
            Check.IsNotNull(medicationCodeCodedConcept, () => MedicationCodeCodedConcept);
            Check.IsNotNull(provenance, () => Provenance);

            _patient = patient;
            _medicationCodeCodedConcept = medicationCodeCodedConcept;
            _provenance = provenance;
        }
Beispiel #4
0
 /// <summary>
 /// Creates the provenance.
 /// </summary>
 /// <param name="taggedDataElement">The tagged data element.</param>
 /// <param name="signedTimestamp">The signed timestamp.</param>
 /// <returns>
 /// A provenance.
 /// </returns>
 public Provenance CreateProvenance(TaggedDataElement taggedDataElement, DateTimeOffset signedTimestamp )
 {
     var provenance = new Provenance ( taggedDataElement, signedTimestamp );
     _provenanceRepository.MakePersistent ( provenance );
     return provenance;
 }
Beispiel #5
0
 /// <summary>
 /// Creates the activity.
 /// </summary>
 /// <param name="clinicalCase">The clinical case.</param>
 /// <param name="provenance">The provenance.</param>
 /// <param name="activityDateTimeRange">The activity date time range.</param>
 /// <returns>An Activity.</returns>
 public Activity CreateActivity(ClinicalCase clinicalCase, Provenance provenance, DateTimeRange activityDateTimeRange)
 {
     return CreateImmunization(clinicalCase, provenance, activityDateTimeRange);
 }
Beispiel #6
0
 internal Allergy(Patient patient, AllergyStatus allergyStatus, CodedConcept allergenCodedConcept, Provenance provenance)
     : this(patient, allergyStatus, allergenCodedConcept)
 {
     Check.IsNotNull(provenance, () => Provenance);
     _provenance = provenance;
 }
Beispiel #7
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);
        }
Beispiel #8
0
        /// <summary>
        /// Creates the immunization.
        /// </summary>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="provenance">The provenance.</param>
        /// <param name="activityDateTimeRange">The activity date time range.</param>
        /// <returns>An immunization.</returns>
        public Immunization CreateImmunization(ClinicalCase clinicalCase, Provenance provenance, DateTimeRange activityDateTimeRange)
        {
            var activityType = _lookupValueRepository.GetLookupByWellKnownName<ActivityType>(WellKnownNames.VisitModule.ActivityType.Immunization);
            var immunization = new Immunization(clinicalCase, activityType, provenance, activityDateTimeRange);

            _immunizationRepository.MakePersistent(immunization);

            return immunization;
        }
Beispiel #9
0
 /// <summary>
 /// Creates the activity.
 /// </summary>
 /// <param name="clinicalCase">The clinical case.</param>
 /// <param name="provenance">The provenance.</param>
 /// <param name="activityDateTimeRange">The activity date time range.</param>
 /// <returns>
 /// An Activity.
 /// </returns>
 public Activity CreateActivity( ClinicalCase clinicalCase, Provenance provenance, DateTimeRange activityDateTimeRange )
 {
     return CreateVitalSign ( clinicalCase, provenance, activityDateTimeRange );
 }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LabSpecimen"/> class.
 /// </summary>
 /// <param name="clinicalCase">The clinical case.</param>
 /// <param name="activityType">Type of the activity.</param>
 /// <param name="provenance">The provenance.</param>
 /// <param name="activityDateTimeRange">The activity date time range.</param>
 protected internal LabSpecimen(ClinicalCase clinicalCase, ActivityType activityType, Provenance provenance, DateTimeRange activityDateTimeRange)
     : base(clinicalCase, activityType, provenance, activityDateTimeRange)
 {
     _labTests = new List<LabTest>();
 }
Beispiel #11
0
        /// <summary>
        /// Creates the problem.
        /// </summary>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="problemCodeCodedConcept">The problem code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        /// <returns>
        /// A Problem.
        /// </returns>
        public Problem CreateProblem(
            ClinicalCase clinicalCase,
            CodedConcept problemCodeCodedConcept,
            Provenance provenance)
        {
            var problem = new Problem(clinicalCase, problemCodeCodedConcept, provenance);
            _problemRepository.MakePersistent(problem);

            return problem;
        }
Beispiel #12
0
        /// <summary>
        /// Adds the allergy.
        /// </summary>
        /// <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 virtual Allergy AddAllergy(AllergyStatus allergyStatus, CodedConcept allergenCodedConcept, Provenance provenance)
        {
            InitializeServices();

            var factory = IoC.CurrentContainer.Resolve<IAllergyFactory>();
            var allergy = factory.CreateAllergy(this, allergyStatus, allergenCodedConcept, provenance);
            _allergies.Add(allergy);

            NotifyItemAdded(() => Allergies, allergy);

            return allergy;
        }
Beispiel #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Activity"/> class.
        /// </summary>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="activityType">Type of the activity.</param>
        /// <param name="provenance">The provenance.</param>
        /// <param name="activityDateTimeRange">The activity date time range.</param>
        protected internal Activity(ClinicalCase clinicalCase, ActivityType activityType, Provenance provenance, DateTimeRange activityDateTimeRange)
        {
            Check.IsNotNull(clinicalCase, "Clinical Case is required.");
            Check.IsNotNull(provenance, "Provenance is required.");
            Check.IsNotNull(activityType, "Activity Type is required.");

            _clinicalCase = clinicalCase;
            _provenance = provenance;
            _activityType = activityType;
            _activityDateTimeRange = activityDateTimeRange;
        }
Beispiel #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Medication"/> class.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="medicationCodeCodedConcept">The medication code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        protected internal Medication(Patient patient, CodedConcept medicationCodeCodedConcept, Provenance provenance)
        {
            Check.IsNotNull(patient, "Patient is required.");
            Check.IsNotNull(medicationCodeCodedConcept, () => MedicationCodeCodedConcept);
            Check.IsNotNull(provenance, () => Provenance);

            _patient = patient;
            _medicationCodeCodedConcept = medicationCodeCodedConcept;
            _provenance = provenance;
        }
Beispiel #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Problem"/> class.
        /// </summary>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="problemCodeCodedConcept">The problem code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        protected internal Problem(
            ClinicalCase clinicalCase,
            CodedConcept problemCodeCodedConcept,
            Provenance provenance)
        {
            Check.IsNotNull(clinicalCase, "Clinical case is required.");
            Check.IsNotNull(problemCodeCodedConcept, "Problem code coded concept is required.");
            Check.IsNotNull ( provenance, () => Provenance );

            _clinicalCase = clinicalCase;
            _problemCodeCodedConcept = problemCodeCodedConcept;
            _provenance = provenance;
        }
Beispiel #16
0
        /// <summary>
        /// Adds the medication.
        /// </summary>
        /// <param name="medicationCodeCodedConcept">The medication code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        /// <returns>A Medication.</returns>
        public virtual Medication AddMedication(CodedConcept medicationCodeCodedConcept, Provenance provenance)
        {
            InitializeServices();

            var factory    = IoC.CurrentContainer.Resolve <IMedicationFactory>();
            var medication = factory.CreateMedication(this, medicationCodeCodedConcept, provenance);

            _medications.Add(medication);

            NotifyItemAdded(() => Medications, medication);

            return(medication);
        }
Beispiel #17
0
        /// <summary>
        /// Adds the allergy.
        /// </summary>
        /// <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 virtual Allergy AddAllergy(AllergyStatus allergyStatus, CodedConcept allergenCodedConcept, Provenance provenance)
        {
            InitializeServices();

            var factory = IoC.CurrentContainer.Resolve <IAllergyFactory>();
            var allergy = factory.CreateAllergy(this, allergyStatus, allergenCodedConcept, provenance);

            _allergies.Add(allergy);

            NotifyItemAdded(() => Allergies, allergy);

            return(allergy);
        }
Beispiel #18
0
 /// <summary>
 /// Destroys the provenance.
 /// </summary>
 /// <param name="provenance">The provenance.</param>
 public void DestroyProvenance(Provenance provenance)
 {
     _provenanceRepository.MakeTransient(provenance);
 }
Beispiel #19
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;
 }
Beispiel #20
0
        /// <summary>
        /// Creates the vital sign.
        /// </summary>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="provenance">The provenance.</param>
        /// <param name="activityDateTimeRange">The activity date time range.</param>
        /// <returns>Vital Sign</returns>
        public VitalSign CreateVitalSign( ClinicalCase clinicalCase, Provenance provenance, DateTimeRange activityDateTimeRange )
        {
            var type = _lookupValueRepository.GetLookupByWellKnownName<ActivityType> ( WellKnownNames.VisitModule.ActivityType.VitalSign );

            var vitalSign = new VitalSign ( clinicalCase, type, provenance, activityDateTimeRange );

            _vitalSignRepository.MakePersistent ( vitalSign );

            return vitalSign;
        }
Beispiel #21
0
        /// <summary>
        /// Creates the lab specimen.
        /// </summary>
        /// <param name="clinicalCase">The clinical case.</param>
        /// <param name="provenance">The provenance.</param>
        /// <param name="activityDateTimeRange">The activity date time range.</param>
        /// <returns>A LabSpecimen.</returns>
        public LabSpecimen CreateLabSpecimen(ClinicalCase clinicalCase, Provenance provenance, DateTimeRange activityDateTimeRange)
        {
            var type = _lookupValueRepository.GetLookupByWellKnownName<VisitModule.ActivityType>(ActivityType.LabSpecimen);

            var labSpecimen = new LabSpecimen(clinicalCase, type, provenance, activityDateTimeRange);

            _labSpecimenRepository.MakePersistent(labSpecimen);

            return labSpecimen;
        }
Beispiel #22
0
        /// <summary>
        /// Creates the medication.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="medicationCodeCodedConcept">The medication code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        /// <returns>A Medication.</returns>
        public Medication CreateMedication(Patient patient, CodedConcept medicationCodeCodedConcept, Provenance provenance)
        {
            var medication = new Medication(patient, medicationCodeCodedConcept, provenance);

            _medicationRepository.MakePersistent(medication);

            return(medication);
        }
Beispiel #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VitalSign"/> class.
 /// </summary>
 /// <param name="clinicalCase">The clinical case.</param>
 /// <param name="activityType">Type of the activity.</param>
 /// <param name="provenance">The provenance.</param>
 /// <param name="activityDateTimeRange">The activity date time range.</param>
 protected internal VitalSign(ClinicalCase clinicalCase, ActivityType activityType, Provenance provenance, DateTimeRange activityDateTimeRange)
     : base(clinicalCase, activityType, provenance, activityDateTimeRange)
 {
     _bloodPressures = new List<BloodPressure> ();
     _heartRates = new List<HeartRate> ();
 }
Beispiel #24
0
        /// <summary>
        /// Adds the medication.
        /// </summary>
        /// <param name="medicationCodeCodedConcept">The medication code coded concept.</param>
        /// <param name="provenance">The provenance.</param>
        /// <returns>A Medication.</returns>
        public virtual Medication AddMedication(CodedConcept medicationCodeCodedConcept, Provenance provenance)
        {
            InitializeServices();

            var factory = IoC.CurrentContainer.Resolve<IMedicationFactory>();
            var medication = factory.CreateMedication(this, medicationCodeCodedConcept, provenance);
            _medications.Add(medication);

            NotifyItemAdded(() => Medications, medication);

            return medication;
        }
Beispiel #25
0
 /// <summary>
 /// Destroys the provenance.
 /// </summary>
 /// <param name="provenance">The provenance.</param>
 public void DestroyProvenance( Provenance provenance )
 {
     _provenanceRepository.MakeTransient ( provenance );
 }
Beispiel #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Immunization"/> class.
 /// </summary>
 /// <param name="clinicalCase">The clinical case.</param>
 /// <param name="activityType">Type of the activity.</param>
 /// <param name="provenance">The provenance.</param>
 /// <param name="activityDateTimeRange">The activity date time range.</param>
 protected internal Immunization(ClinicalCase clinicalCase, ActivityType activityType, Provenance provenance, DateTimeRange activityDateTimeRange)
     : base(clinicalCase, activityType, provenance, activityDateTimeRange)
 {
 }
Beispiel #27
0
 internal Allergy(Patient patient, AllergyStatus allergyStatus, CodedConcept allergenCodedConcept, Provenance provenance)
     : this(patient, allergyStatus, allergenCodedConcept)
 {
     Check.IsNotNull ( provenance, () => Provenance );
     _provenance = provenance;
 }