public interface UcumService
| Modifier and Type | Interface and Description |
|---|---|
static class |
UcumService.UcumVersionDetails |
| Modifier and Type | Method and Description |
|---|---|
String |
analyse(String unit)
given a unit, return a formal description of what the units stand for using
full names
|
Decimal |
convert(Decimal value,
String sourceUnit,
String destUnit)
given a value and source unit, return the value in the given dest unit
an exception is thrown if the conversion is not possible
|
Pair |
getCanonicalForm(Pair value)
given a value/unit pair, return the canonical form as a value/unit pair
1 mm -> 1e-3 m
|
String |
getCanonicalUnits(String unit)
given a set of units, return their canonical form
|
String |
getCommonDisplay(String code)
given a set of UCUM units, return a likely preferred human dense form
SI units - as is.
|
List<DefinedUnit> |
getDefinedForms(String code)
for a given canonical unit, return all the defined units that have the
same canonical unit.
|
UcumModel |
getModel()
provided for various utility/QA uses.
|
Set<String> |
getProperties()
return a list of the defined types of units in this UCUM version
|
boolean |
isComparable(String units1,
String units2)
given two pairs of units, return true if they sahre the same canonical base
|
Pair |
multiply(Pair o1,
Pair o2)
multiply two value/units pairs together and return the result in canonical units
Note: since the units returned are canonical,
|
List<Concept> |
search(ConceptKind kind,
String text,
boolean isRegex)
Search through the UCUM concepts for any concept containing matching text.
|
UcumService.UcumVersionDetails |
ucumIdentification()
return Ucum Identification details for the version in use
|
String |
validate(String unit)
validate whether a unit code are valid UCUM units
|
String |
validateCanonicalUnits(String unit,
String canonical)
validate whether a units are valid UCUM units and additionally require that the
units match a particular base canonical unit
|
String |
validateInProperty(String unit,
String property)
validate whether a units are valid UCUM units and additionally require that the
units from a particular property
|
List<String> |
validateUCUM()
Check UCUM.
|
UcumModel getModel()
UcumService.UcumVersionDetails ucumIdentification()
List<String> validateUCUM()
List<Concept> search(ConceptKind kind, String text, boolean isRegex)
kind - - can be null. scope of searchtext - - requiredisRegex - Set<String> getProperties()
String validate(String unit)
units - - the unit code to checkString analyse(String unit) throws UcumException
units - the unit codeUcumExceptionOHFExceptionString validateInProperty(String unit, String property)
units - - the unit code to checkString validateCanonicalUnits(String unit, String canonical)
units - - the unit code to checkString getCanonicalUnits(String unit) throws UcumException
unit - UcumExceptionOHFExceptionboolean isComparable(String units1, String units2) throws UcumException
units1 - units2 - UcumExceptionList<DefinedUnit> getDefinedForms(String code) throws UcumException
code - UcumExceptionOHFExceptionPair getCanonicalForm(Pair value) throws UcumException
value - UcumExceptionOHFExceptionDecimal convert(Decimal value, String sourceUnit, String destUnit) throws UcumException
value - sourceUnit - destUnit - UcumExceptionOHFExceptionPair multiply(Pair o1, Pair o2) throws UcumException
o1 - o2 - UcumExceptionString getCommonDisplay(String code)
code - Copyright © 2014–2019 University Health Network. All rights reserved.