コード例 #1
0
ファイル: MedicationFactory.cs プロジェクト: divyang4481/REM
        /// <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;
        }
コード例 #2
0
ファイル: MedicationFactory.cs プロジェクト: divyang4481/REM
 /// <summary>
 /// Destroys the medication.
 /// </summary>
 /// <param name="medication">The medication.</param>
 public void DestroyMedication( Medication medication )
 {
     _medicationRepository.MakeTransient ( medication );
 }
コード例 #3
0
ファイル: MedicationFactory.cs プロジェクト: girish66/REM
 /// <summary>
 /// Destroys the medication.
 /// </summary>
 /// <param name="medication">The medication.</param>
 public void DestroyMedication(Medication medication)
 {
     _medicationRepository.MakeTransient(medication);
 }
コード例 #4
0
ファイル: NCSCriptBuilder.cs プロジェクト: divyang4481/REM
        // TODO: Based on some business rule
        private OutsidePrescriptionType TransformRemMedicationIntoOutsidePrescriptionAsMappedDrug( Medication medication )
        {
            Check.IsNotNull ( medication.UsageDateRange.StartDate, "Medication Usage Start Date cannot be null" );
            Debug.Assert ( medication.UsageDateRange.StartDate != null, "medication.UsageDateRange.StartDate != null" );

            var prescription = new OutsidePrescriptionType
                {
                    ExternalId = medication.Key.ToString (),
                    Date = medication.UsageDateRange.StartDate.Value.ToString ( "yyyMMdd" ),
                    DoctorName = medication.PrescribingPhysicianName,
                    DrugIdentifierTypeSpecified = true,
                    DrugIdentifier = medication.MedicationCodeCodedConcept.CodedConceptCode,
                    DrugIdentifierType = DrugDatabaseType.RXNORM,
                    PrescriptionType = "reconcile",
                };
            return prescription;
        }
コード例 #5
0
ファイル: NCSCriptBuilder.cs プロジェクト: divyang4481/REM
        private static OutsidePrescriptionType TransformRemMedicationIntoOutsidePrescriptionAsFreeText( Medication medication )
        {
            Check.IsNotNull (
                medication.UsageDateRange, "Medication Usage Range was provided for " + medication.MedicationCodeCodedConcept.DisplayName );

            Check.IsNotNull ( medication.UsageDateRange.StartDate, "Medication Usage Start Date cannot be null" );
            Debug.Assert ( medication.UsageDateRange.StartDate != null, "medication.UsageDateRange.StartDate != null" );

            var prescription = new OutsidePrescriptionType
                {
                    ExternalId = medication.Key.ToString (),
                    Date = medication.UsageDateRange.StartDate.Value.ToString ( "yyyMMdd" ),
                    DoctorName = medication.PrescribingPhysicianName,
                    DrugIdentifierTypeSpecified = false,
                    Drug = NcScriptHelper.RemoveUnwantedPartsFromDrugName ( medication.RootMedicationCodedConcept.DisplayName ),
                    //// DrugIdentifier = medication.MedicationCodeCodedConcept.CodedConceptCode,
                    PrescriptionType = "reconcile",
                    ////DispenseNumber = "0",
                    ////RefillCount = "0",
                    Sig = medication.FrequencyDescription,
                    PrescriptionStatus =
                        NcScriptHelper.TransformRemMedicationStatusIntoNewCropPrescriptionStatus (
                            medication.MedicationStatus.WellKnownName ),
                    PrescriptionArchiveStatus =
                        NcScriptHelper.TransformRemMedicationIntoNewCropPrescriptionArchiveStatus (
                            medication.MedicationStatus.WellKnownName ),
                };
            return prescription;
        }
コード例 #6
0
ファイル: Patient.cs プロジェクト: divyang4481/REM
        /// <summary>
        /// Removes the medication.
        /// </summary>
        /// <param name="medication">The medication.</param>
        public virtual void RemoveMedication(Medication medication)
        {
            if (_medications.Contains(medication))
            {
                _medications.Remove(medication);
            }
            else
            {
                throw new ArgumentException("Medication not found.");
            }

            var factory = IoC.CurrentContainer.Resolve<IMedicationFactory>();
            factory.DestroyMedication(medication);

            NotifyItemRemoved(() => Medications, medication);
        }
コード例 #7
0
 private Medication BuildMedication( Patient patient, CodedConcept medicationCode )
 {
     var medication = new Medication ( patient, medicationCode, medicationCode );
     Session.SaveOrUpdate ( medication );
     return medication;
 }