public class UcumEssenceService extends Object implements UcumService
UcumService.UcumVersionDetails| Constructor and Description |
|---|
UcumEssenceService(InputStream stream)
Create an instance of Ucum services.
|
UcumEssenceService(String filename)
Create an instance of Ucum services.
|
| 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.
|
public static final String UCUM_OID
public UcumEssenceService(InputStream stream) throws UcumException
UcumExceptionpublic UcumEssenceService(String filename) throws UcumException
UcumExceptionpublic UcumService.UcumVersionDetails ucumIdentification()
UcumServiceucumIdentification in interface UcumServicepublic UcumModel getModel()
UcumServicegetModel in interface UcumServicepublic List<Concept> search(ConceptKind kind, String text, boolean isRegex)
UcumServicesearch in interface UcumServicekind - - can be null. scope of searchtext - - requiredpublic List<String> validateUCUM()
UcumServicevalidateUCUM in interface UcumServicepublic Set<String> getProperties()
UcumServicegetProperties in interface UcumServicepublic String validate(String unit)
UcumServicevalidate in interface UcumServicepublic String validateInProperty(String unit, String property)
UcumServicevalidateInProperty in interface UcumServicepublic String validateCanonicalUnits(String unit, String canonical)
UcumServicevalidateCanonicalUnits in interface UcumServicepublic String analyse(String unit) throws UcumException
analyse in interface UcumServiceunits - the unit codeUcumExceptionpublic String getCanonicalUnits(String unit) throws UcumException
UcumServicegetCanonicalUnits in interface UcumServiceUcumExceptionpublic List<DefinedUnit> getDefinedForms(String code) throws UcumException
UcumServicegetDefinedForms in interface UcumServiceUcumExceptionpublic Pair getCanonicalForm(Pair value) throws UcumException
UcumServicegetCanonicalForm in interface UcumServiceUcumExceptionpublic Decimal convert(Decimal value, String sourceUnit, String destUnit) throws UcumException
UcumServiceconvert in interface UcumServiceUcumExceptionpublic Pair multiply(Pair o1, Pair o2) throws UcumException
UcumServicemultiply in interface UcumServiceUcumExceptionpublic String getCommonDisplay(String code)
UcumServicegetCommonDisplay in interface UcumServicepublic boolean isComparable(String units1, String units2) throws UcumException
UcumServiceisComparable in interface UcumServiceUcumExceptionCopyright © 2014–2018 University Health Network. All rights reserved.