Search in sources :

Example 21 with ConceptNumeric

use of org.openmrs.ConceptNumeric in project openmrs-core by openmrs.

the class OpenmrsUtilUnitTest method isValidNumericValue_shouldReturnFalseIfValueIsBelowRange.

@Test
public void isValidNumericValue_shouldReturnFalseIfValueIsBelowRange() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiAbsolute(10.34d);
    concept.setLowAbsolute(6.67d);
    assertFalse(OpenmrsUtil.isValidNumericValue(15.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 22 with ConceptNumeric

use of org.openmrs.ConceptNumeric in project openmrs-core by openmrs.

the class OpenmrsUtilUnitTest method isValidNumericValue_shouldReturnTrueIfValueIsInRange.

@Test
public void isValidNumericValue_shouldReturnTrueIfValueIsInRange() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiAbsolute(10.34d);
    concept.setLowAbsolute(3.67d);
    assertTrue(OpenmrsUtil.isValidNumericValue(5.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 23 with ConceptNumeric

use of org.openmrs.ConceptNumeric in project openmrs-core by openmrs.

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnFalseIfValueIsAboveRange.

@Test
public void isInCriticalNumericRange_shouldReturnFalseIfValueIsAboveRange() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiCritical(4.34d);
    concept.setLowCritical(3.67d);
    assertFalse(OpenmrsUtil.isInCriticalNumericRange(5.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 24 with ConceptNumeric

use of org.openmrs.ConceptNumeric in project openmrs-core by openmrs.

the class OpenmrsUtilUnitTest method isInAbsoluteNumericRange_shouldReturnTrueIfValueIsEqualToLowRangeLimit.

@Test
public void isInAbsoluteNumericRange_shouldReturnTrueIfValueIsEqualToLowRangeLimit() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiCritical(14.34d);
    concept.setLowCritical(4.34d);
    assertFalse(OpenmrsUtil.isInAbsoluteNumericRange(4.34f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 25 with ConceptNumeric

use of org.openmrs.ConceptNumeric in project openmrs-core by openmrs.

the class OpenmrsUtilUnitTest method isInNormalNumericRange_shouldReturnTrueIfValueIsInRange.

@Test
public void isInNormalNumericRange_shouldReturnTrueIfValueIsInRange() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiNormal(10.34d);
    concept.setLowNormal(3.67d);
    assertTrue(OpenmrsUtil.isInNormalNumericRange(5.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Aggregations

ConceptNumeric (org.openmrs.ConceptNumeric)39 Test (org.junit.Test)36 Concept (org.openmrs.Concept)7 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)7 OpenmrsMatchers.hasConcept (org.openmrs.test.OpenmrsMatchers.hasConcept)5 ConceptDatatype (org.openmrs.ConceptDatatype)4 ConceptDescription (org.openmrs.ConceptDescription)4 ConceptName (org.openmrs.ConceptName)4 ConceptClass (org.openmrs.ConceptClass)3 ConceptComplex (org.openmrs.ConceptComplex)3 Query (org.hibernate.Query)2 SQLQuery (org.hibernate.SQLQuery)2 LuceneQuery (org.openmrs.api.db.hibernate.search.LuceneQuery)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 Date (java.util.Date)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1