Search in sources :

Example 6 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInAbsoluteNumericRange_shouldReturnFalseIfValueIsAboveRange.

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

Example 7 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnTrueIfValueIsEqualToHiRangeLimit.

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

Example 8 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnFalseIfLowCriticalIsNull.

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

Example 9 with ConceptNumeric

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

the class OpenmrsUtilUnitTest method isInCriticalNumericRange_shouldReturnFalseIfValueIsBelowRange.

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

Example 10 with ConceptNumeric

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

the class ConceptServiceTest method getConceptNumericByUuid_shouldFindObjectGivenValidUuid.

/**
 * @see ConceptService#getConceptNumericByUuid(String)
 */
@Test
public void getConceptNumericByUuid_shouldFindObjectGivenValidUuid() {
    String uuid = "c607c80f-1ea9-4da3-bb88-6276ce8868dd";
    ConceptNumeric conceptNumeric = Context.getConceptService().getConceptNumericByUuid(uuid);
    Assert.assertEquals(5089, (int) conceptNumeric.getConceptId());
}
Also used : ConceptNumeric(org.openmrs.ConceptNumeric) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) 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