예제 #1
0
 @Test
 public final void testHeight() {
   final DiscreteNumericalVariable heightVar =
       makeDiscreteNumerical("height", ValueRetriever.HEIGHT);
   final Patient patient = SampleCalculations.dummyPatientWithVitals(1);
   verifyRetrievedValue(heightVar, patient, patient.getHeight());
 }
예제 #2
0
 @Test
 public final void testWeight6MonthsAgo() {
   final DiscreteNumericalVariable weight6MonthsAgoVar =
       makeDiscreteNumerical("weight6MonthsAgo", ValueRetriever.WEIGHT_6_MONTHS_AGO);
   final Patient patient = SampleCalculations.dummyPatientWithVitals(1);
   verifyRetrievedValue(weight6MonthsAgoVar, patient, patient.getWeight6MonthsAgo());
 }
예제 #3
0
  @Test
  public final void testWithRetrievedLabs() {
    final List<AbstractVariable> vars = new ArrayList<AbstractVariable>();
    final Patient patient = SampleCalculations.dummyPatientWithLabs(1);

    // Note that vars is empty at this point.
    final VariableEntry expected = new VariableEntry(vars);

    addAllLabs(expected, vars, patient);
    final VariableEntry entry = VariableEntry.withRetrievedValues(vars, patient);
    assertEquals(expected.getDynamicValues(), entry.getDynamicValues());
  }
예제 #4
0
  @Test
  public final void testCardiacAge() {
    final DiscreteNumericalVariable var = SampleModels.cardiacAgeVariable();
    final Patient patient = SampleCalculations.dummyPatientWithVitals(1);
    final Collection<DiscreteNumericalVariable> vars = ImmutableSet.of(var);
    // Use VariableEntry to generate the expected dynamic values.
    final VariableEntry expected =
        new VariableEntry(vars)
            .putDynamicValue(
                VariableEntry.makeNumericalInputName(var.getKey()),
                String.valueOf(patient.getAge()));

    verifyRetrievedValue(vars, patient, expected.getDynamicValues());
  }
예제 #5
0
 @Test
 public final void testBmi() {
   final DiscreteNumericalVariable bmiVar = makeDiscreteNumerical("bmi", ValueRetriever.BMI);
   final Patient patient = SampleCalculations.dummyPatientWithVitals(1);
   verifyRetrievedValue(bmiVar, patient, patient.getBmi());
 }