Search in sources :

Example 1 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnFalseIfHiCriticalIsNull.

@Test
public void isInCriticalNumericRange_shouldReturnFalseIfHiCriticalIsNull() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiCritical(null);
    assertFalse(OpenmrsUtil.isInCriticalNumericRange(5.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 2 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isValidNumericValue_shouldReturnTrueIfHiAbsoluteIsNull.

@Test
public void isValidNumericValue_shouldReturnTrueIfHiAbsoluteIsNull() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiAbsolute(null);
    assertTrue(OpenmrsUtil.isValidNumericValue(5.67f, concept));
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) Test(org.junit.Test)

Example 3 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInNormalNumericRange_shouldReturnFalseIfValueIsAboveRange.

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

Example 4 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInAbsoluteNumericRange_shouldReturnTrueIfValueIsInRange.

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

Example 5 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isValidNumericValue_shouldReturnTrueIfLowAbsoluteIsNull.

@Test
public void isValidNumericValue_shouldReturnTrueIfLowAbsoluteIsNull() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setLowAbsolute(null);
    assertTrue(OpenmrsUtil.isValidNumericValue(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