Support of clinical units (units not present in UCUMFormat properties file)
tiaden opened this issue · 8 comments
Hi
First thanks for this wonderful tool. Not sure if I'm right but I get a TokenException when I try the below
var ucumService = new UCUMServiceProvider();
var unitFormatService = ucumService.getFormatService();
var unitFormat = unitFormatService.getUnitFormat();
Unit<?> parsed1 = unitFormat.parse("mm[hg]");
System.out.println(parsed1);
I'm using the version 2.0 of this tool.
With a little investigation, I found that the definition of METER_OF_MERCURY_COLUMN is present in the UCUM.java file but not present if the UCUMFormat properties files. I'm not sure if I'm right.
Also I tried to more tests of this tool using the the functional tests provided by graham grieve at
https://unitsofmeasure.org/trac/wiki/FunctionalTests
After doing that I found that there are few units not supported by the version 2.0 of this tool. Please see below
Test 1-105: The unit '103/ul' was expected to be valid, but wasn't accepted
Test 1-106: The unit '10-3/ul' was expected to be valid, but wasn't accepted
Test 1-107: The unit '10*+3/ul' was expected to be valid, but wasn't accepted
Test 1-110: The unit 'm[H2O]' was expected to be valid, but wasn't accepted
Test 1-111: The unit '1023' was expected to be valid, but wasn't accepted
Test 1-114: The unit '4.[pi].10-7.N/A2' was expected to be valid, but wasn't accepted
Test 1-117: The unit '1{c}' was expected to be valid, but wasn't accepted
Test 1-155: The unit 'meq' was expected to be valid, but wasn't accepted
Test 1-162: The unit 'mm[Hg]' was expected to be valid, but wasn't accepted
Test 1-184: The unit 'wk' was expected to be valid, but wasn't accepted
Test 1-204: The unit 'meq' was expected to be valid, but wasn't accepted
Test 1-224: The unit 'wk' was expected to be valid, but wasn't accepted
Test 1-241: The unit '/[HPF]' was expected to be valid, but wasn't accepted
Test 1-242: The unit '/[LPF]' was expected to be valid, but wasn't accepted
Test 1-246: The unit '[APL'U]' was expected to be valid, but wasn't accepted
Test 1-248: The unit '[GPL'U]' was expected to be valid, but wasn't accepted
Test 1-249: The unit '[IU]' was expected to be valid, but wasn't accepted
Test 1-250: The unit '[IU]/d' was expected to be valid, but wasn't accepted
Test 1-251: The unit '[IU]/L' was expected to be valid, but wasn't accepted
Test 1-252: The unit '[IU]/mL' was expected to be valid, but wasn't accepted
Test 1-253: The unit '[MPL'U]' was expected to be valid, but wasn't accepted
Test 1-254: The unit '1012/L' was expected to be valid, but wasn't accepted
Test 1-255: The unit '106/L' was expected to be valid, but wasn't accepted
Test 1-256: The unit '109/L' was expected to be valid, but wasn't accepted
Test 1-275: The unit 'm[IU]/L' was expected to be valid, but wasn't accepted
Test 1-297: The unit 'mm[Hg]' was expected to be valid, but wasn't accepted
Test 1-337: The unit 'u[IU]/mL' was expected to be valid, but wasn't accepted
Test 1-351: The unit 'wk' was expected to be valid, but wasn't accepted
Test k=1=001: The unit '[arb'U]' was expected to be valid, but wasn't accepted
Test k=1=003: The unit '[iU]/mL' was expected to be valid, but wasn't accepted
Test k=1=005: The unit '[bdsk'U]' was expected to be valid, but wasn't accepted
Test k=1=008: The unit 'mm[Hg]' was expected to be valid, but wasn't accepted
Test k=1=010: The unit 'cm[H2O]' was expected to be valid, but wasn't accepted
Test k=1=014: The unit 'cm[H2O].s/L' was expected to be valid, but wasn't accepted
Test k=1=018: The unit 'cm[H2O]/(s.m)' was expected to be valid, but wasn't accepted
Test k=1=021: The unit '[drp]' was expected to be valid, but wasn't accepted
Test k=1=022: The unit 'dB[SPL]' was expected to be valid, but wasn't accepted
Test k=1=025: The unit '[ka'U]' was expected to be valid, but wasn't accepted
Test k=1=044: The unit '[knk'U]' was expected to be valid, but wasn't accepted
Test k=1=046: The unit 'meq/(8.h)' was expected to be valid, but wasn't accepted
Test k=1=047: The unit 'osm' was expected to be valid, but wasn't accepted
Test k=1=048: The unit '[mclg'U]' was expected to be valid, but wasn't accepted
Test k=1=049: The unit 'g.m/{hb}m2' was expected to be valid, but wasn't accepted
Test k=1=050: The unit 'meq/(8.h.kg)' was expected to be valid, but wasn't accepted
Test k=1=051: The unit 'osm/kg' was expected to be valid, but wasn't accepted
Test k=1=054: The unit 'meq/(kg.h)' was expected to be valid, but wasn't accepted
Test k=1=055: The unit 'osm/L' was expected to be valid, but wasn't accepted
Test k=1=058: The unit 'meq/h' was expected to be valid, but wasn't accepted
Test k=1=075: The unit '[todd'U]' was expected to be valid, but wasn't accepted
Test k=1=076: The unit '[in_i'Hg]' was expected to be valid, but wasn't accepted
Test k=1=077: The unit 'm[iU]/mL' was expected to be valid, but wasn't accepted
Test k=1=079: The unit '/[arb'U]' was expected to be valid, but wasn't accepted
Test k=1=080: The unit '[iU]' was expected to be valid, but wasn't accepted
Test k=1=083: The unit '[HPF]' was expected to be valid, but wasn't accepted
Test k=1=084: The unit '[iU]/d' was expected to be valid, but wasn't accepted
Test k=1=088: The unit '[iU]/h' was expected to be valid, but wasn't accepted
Test k=1=090: The unit 'u[iU]' was expected to be valid, but wasn't accepted
Test k=1=091: The unit '/[iU]' was expected to be valid, but wasn't accepted
Test k=1=092: The unit '[iU]/kg' was expected to be valid, but wasn't accepted
Test k=1=094: The unit '103{rbc}' was expected to be valid, but wasn't accepted
Test k=1=095: The unit '[iU]/L' was expected to be valid, but wasn't accepted
Test k=1=098: The unit '[iU]/min' was expected to be valid, but wasn't accepted
Test k=1=099: The unit 'mL/cm[H2O]' was expected to be valid, but wasn't accepted
Test k=1=107: The unit 'ueq' was expected to be valid, but wasn't accepted
Test k=1=149: The unit 'dB' was expected to be valid, but wasn't accepted
Test k=1=165: The unit 'eq' was expected to be valid, but wasn't accepted
Test k=1=172: The unit '1012/L' was expected to be valid, but wasn't accepted
Test k=1=180: The unit '103/L' was expected to be valid, but wasn't accepted
Test k=1=188: The unit '103/mL' was expected to be valid, but wasn't accepted
Test k=1=193: The unit 'mosm/L' was expected to be valid, but wasn't accepted
Test k=1=196: The unit '103/mm3' was expected to be valid, but wasn't accepted
Test k=1=204: The unit '106/L' was expected to be valid, but wasn't accepted
Test k=1=212: The unit '106/mL' was expected to be valid, but wasn't accepted
Test k=1=215: The unit 'meq' was expected to be valid, but wasn't accepted
Test k=1=220: The unit '106/mm3' was expected to be valid, but wasn't accepted
Test k=1=223: The unit 'meq/(kg.d)' was expected to be valid, but wasn't accepted
Test k=1=228: The unit '109/L' was expected to be valid, but wasn't accepted
Test k=1=231: The unit 'meq/(kg.min)' was expected to be valid, but wasn't accepted
Test k=1=236: The unit '109/mL' was expected to be valid, but wasn't accepted
Test k=1=239: The unit 'meq/d' was expected to be valid, but wasn't accepted
Test k=1=244: The unit '109/mm3' was expected to be valid, but wasn't accepted
Test k=1=247: The unit 'meq/kg' was expected to be valid, but wasn't accepted
Test k=1=255: The unit 'meq/L' was expected to be valid, but wasn't accepted
Test k=1=263: The unit 'meq/min' was expected to be valid, but wasn't accepted
Thanks a lot for pointing that out. I wasn't aware the functional tests also worked with the UCUM system, do you think you might be able to write something about how to do that e.g. in the Wiki: https://github.com/unitsofmeasurement/uom-systems/wiki? For those units missing a format entry we'll add them for the next release. There was also a Jigsaw related dependency to the RI that should go into that, see #153
Sure, I can write about the functional in the wiki.. I will let you know when it is done. I also have a working example of those tests in java in case you want me to share that with you.
Sorry about the delay, this is the writing about the functional tests https://github.com/unitsofmeasurement/uom-systems/wiki/Conformance-to-Ucum-Functional-Tests.
When do you plan on releasing version 2.01 ? I can help with the addition of units in case you need help
Thank you
Ok. So if I understand correctly you want me to help with the addition of new units for UCUM and CLDR 36 ? I just want to confirm so I don't work on the wrong subject/task
I am also facing an issue with the clinical unit mm[Hg] not being accepted. Is there a timeframe of when this enhancement will be included?
Will have a look over Easter. There are other issues with UCUM especially the way that it loads resource bundles under Java 9 and above (Jigsaw) so there are other things to do there anyway.
Thanks for the update!