Search in sources :

Example 16 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInAbsoluteNumericRange_shouldReturnFalseIfValueIsBelowRange.

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

Example 17 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInNormalNumericRange_shouldReturnFalseIfValueIsBelowRange.

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

Example 18 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInNormalNumericRange_shouldReturnTrueIfValueIsEqualToHiRangeLimit.

@Test
public void isInNormalNumericRange_shouldReturnTrueIfValueIsEqualToHiRangeLimit() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiNormal(5.67);
    concept.setLowNormal(2.67);
    assertFalse(OpenmrsUtil.isInNormalNumericRange(5.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 19 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnTrueIfValueIsInRange.

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

Example 20 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInAbsoluteNumericRange_shouldReturnTrueIfValueIsEqualToHiRangeLimit.

@Test
public void isInAbsoluteNumericRange_shouldReturnTrueIfValueIsEqualToHiRangeLimit() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiCritical(4.34d);
    concept.setLowCritical(3.67d);
    assertFalse(OpenmrsUtil.isInAbsoluteNumericRange(4.34f, 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