public void ThatDrugConcentrationCanBeCalculatedWithDoseQtyAndAdminQty() { var prescription = Prescription.NewPrescription(); prescription.Quantity.SetValue(2, "zetp", "", "", ""); prescription.FirstDose.Quantity.SetValue(200, "mg", "", "", ""); prescription.FirstSubstance.DrugConcentration.SetValue(0, "mg", "", "zetp", ""); var calculator = new PrescriptionCalculator(prescription); calculator.Calculate(); Assert.AreEqual(100, prescription.FirstSubstance.DrugConcentration.Value); }
public void ThatDurationCanBeCalculatedWithAdminQuantityAndAdminRate() { var prescription = Prescription.NewPrescription(); prescription.Quantity.SetValue(8, "zetp", "", "", ""); prescription.Duration.SetValue(0, "", "uur", "", ""); prescription.Rate.SetValue(4, "zetp", "uur", "", ""); var calculator = new PrescriptionCalculator(prescription); calculator.Calculate(); Assert.AreEqual(2, prescription.Duration.Value); }
public void ThatAdminRateCanBeCalculatedWithDrugConcentrationAndDoseRate() { var prescription = Prescription.NewPrescription(); prescription.Rate.SetValue(0, "zetp", "uur", "", ""); prescription.FirstDose.Rate.SetValue(200, "mg", "uur", "", ""); prescription.FirstSubstance.DrugConcentration.SetValue(100, "mg", "", "zetp", ""); var calculator = new PrescriptionCalculator(prescription); calculator.Calculate(); Assert.AreEqual(2, prescription.Rate.Value); }
public void ThatDurationCanBeCalculatedWithDoseQuantityAndDoseRate() { var prescription = Prescription.NewPrescription(); prescription.FirstDose.Quantity.SetValue(8, "mg", "", "", ""); prescription.Duration.SetValue(0, "", "uur", "", ""); prescription.FirstDose.Rate.SetValue(4, "mg", "uur", "", ""); var calculator = new PrescriptionCalculator(prescription); calculator.Calculate(); Assert.AreEqual(2, prescription.Duration.Value); }
public void ThatAdminQuantityCanBeCalculatedWithFrequencyAndAdminTotal() { var prescription = Prescription.NewPrescription(); prescription.Frequency.Time = "dag"; prescription.Frequency.Value = 2; prescription.Total.Unit = "zetp"; prescription.Total.Value = 4; prescription.Total.Time = "dag"; prescription.Quantity.Unit = "zetp"; var calculator = new PrescriptionCalculator(prescription); calculator.Calculate(); Assert.AreEqual(2, prescription.Quantity.Value); }
public void ThatFrequencyCanBeCalculatedWithDoseQuantityAndDoseTotal() { var prescription = Prescription.NewPrescription(); prescription.FirstDose.Quantity.Unit = "mg"; prescription.FirstDose.Quantity.Value = 4; prescription.FirstDose.Total.Unit = "mg"; prescription.FirstDose.Total.Value = 8; prescription.FirstDose.Total.Time = "dag"; var calculator = new PrescriptionCalculator(prescription); calculator.Calculate(); Assert.AreEqual(2, prescription.Frequency.Value); }
public static PrescriptionDto UpdatePrescription(PrescriptionDto prescriptionDto, string patientId) { var prescription = PrescriptionAssembler.AssemblePrescriptionBo(prescriptionDto); var pc = new PrescriptionCalculator(prescription); pc.Calculate(); return PrescriptionAssembler.AssemblePrescriptionDto(prescription); }