Search in sources :

Example 26 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInNormalNumericRange_shouldReturnFalseIfLowNormalIsNull.

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

Example 27 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInAbsoluteNumericRange_shouldReturnFalseIfHiAbsoluteIsNull.

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

Example 28 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnTrueIfValueIsEqualToLowRangeLimit.

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

Example 29 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isValidNumericValue_shouldReturnFalseIfValueIsAboveRange.

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

Example 30 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInNormalNumericRange_shouldReturnTrueIfValueIsEqualToLowRangeLimit.

@Test
public void isInNormalNumericRange_shouldReturnTrueIfValueIsEqualToLowRangeLimit() {
    ConceptNumeric concept = new ConceptNumeric();
    concept.setHiNormal(10.34d);
    concept.setLowNormal(5.64d);
    assertFalse(OpenmrsUtil.isInNormalNumericRange(5.64f, 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