I've been doing some work with the i2b2 unit conversions.  Note we are on 1.7, 
so I can speak to earlier versions - it might work, it might not. Some of you 
may already be using this capability....  I2b2 supports client side units 
conversion but also has server side units conversion capability. I'll attempt 
to explain below...

H2
_____________________________________

.

A normal numeric query with the default project setting (the above not set or 
set to OFF) Yields the following SQL when searching for patients with a weight  
<= 1600 ounces (we are storing weights in ounces):
insert into BlueHeronData.QUERY_GLOBAL_TEMP (patient_num, panel_count)
with t as (
select  /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ f.patient_num
from BlueHeronData.observation_fact f
where
f.concept_cd IN (select concept_cd from  BlueHeronData.concept_dimension   
where concept_path LIKE '\i2b2\PCORI\Vitals\Weight\%')
AND  (  modifier_cd = '@'  AND    (( valtype_cd = 'N' AND   nval_num  < 1600 
AND  tval_char IN ('E','LE')) OR ( valtype_cd = 'N' AND   nval_num  <= 1600 AND 
 tval_char = 'L' ))  )
group by  f.patient_num
)

In the project parameters, add the parameter  CRC_ENABLE_UNITCD_CONVERSION  and 
set it to  ON

Enabling this server side unit conversion for i2b2 with no other change yields 
the following SQL generated:

insert into BlueHeronData.QUERY_GLOBAL_TEMP (patient_num, panel_count)
with t as (
select  /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ f.patient_num
from BlueHeronData.observation_fact f
where
f.concept_cd IN (select concept_cd from  BlueHeronData.concept_dimension   
where concept_path LIKE '\i2b2\PCORI\Vitals\Weight\%')
AND  (  modifier_cd = '@'  AND    (( valtype_cd = 'N' AND   case
when  units_cd = 'OUNCES' then nval_num   end  < 1600 AND  tval_char IN
when  units_cd = 'OUNCES' then nval_num   end  <= 1600 AND  tval_char = 'L' ))  
)
group by  f.patient_num
)

Note that the units_cd now appear in the query by default, as specified in the 
c_metadataxml field

Adding in the conversion units to the metadata xml, and searching for patients 
with a weight < 100 lbs yields:
insert into BlueHeronData.QUERY_GLOBAL_TEMP (patient_num, panel_count)
with t as (
select  /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ f.patient_num
from BlueHeronData.observation_fact f
where
f.concept_cd IN (select concept_cd from  BlueHeronData.concept_dimension   
where concept_path LIKE '\i2b2\PCORI\Vitals\Weight\%')
AND  (  modifier_cd = '@'  AND    (( valtype_cd = 'N' AND   case
when  units_cd = 'POUNDS' then nval_num *  16
when  units_cd = 'GRAMS' then nval_num * 0.035274
when  units_cd = 'KILOGRAMS' then nval_num * 35.274
when  units_cd = 'OUNCES' then nval_num   end  < 1600 AND  tval_char IN 
('E','LE')) OR ( valtype_cd = 'N' AND   case
when  units_cd = 'POUNDS' then nval_num *  16
when  units_cd = 'GRAMS' then nval_num * 0.035274
when  units_cd = 'KILOGRAMS' then nval_num * 35.274
when  units_cd = 'OUNCES' then nval_num   end  <= 1600 AND  tval_char = 'L' ))  
)
group by  f.patient_num
)

Note that in the i2b2 web client, the query shows up at < 1600 ounces even 
though I specified <100 pounds in the dialog box for specifying weight.


If one now  turns off CRC_ENABLE_UNITCD_CONVERSION  then the webclient will 
again ignore the units, and convert whatever ever units you specify to the 
'normal units'.

My conclusions are :


*   The server side flag that turns on the unit conversion machinery in i2b2 
should be used if one has values in the fact table for findings or results with 
heterogeneous units - e.g. some weights in pounds, some in kilograms, etc.   
Note it is a global flag.  If one turns it on, then all queries for numeric 
results follow the pattern with specified units.

*   If the units are always going to be homogenous, then no need to flip the 
switch on the server side unit conversion - the i2b2 client will convert the 
query to normal units if one uses one of the convertible units per the 
metadataxml file

*    Hence, in the case of weights there is no harm done in storing weights as 
ounces (as Clarity does).  That gives the best granularity for converting to 
pounds/grams/kilos.


The metadata xml which contains the unit conversions used in the above testing 
is :
<?xml version="1.0"?>
<ValueMetadata>
<Version>3.02</Version>
<CreationDateTime>06/11/2014 07:00:00</CreationDateTime>
<Loinc>3141-9</Loinc>
<TestID>LOINC:3141-9</TestID>
<TestName>Weight</TestName>
<DataType>PosFloat</DataType>
<Flagstouse>H</Flagstouse>
<Oktousevalues>Y</Oktousevalues>
<EnumValues></EnumValues>
<UnitValues>
<NormalUnits>OUNCES</NormalUnits>
<ConvertingUnits>
   <Units>POUNDS</Units>
   <MultiplyingFactor> 16 </MultiplyingFactor>
</ConvertingUnits>
<ConvertingUnits>
   <Units>GRAMS</Units>
   <MultiplyingFactor>0.035274 </MultiplyingFactor>
</ConvertingUnits>
<ConvertingUnits>
   <Units>KILOGRAMS</Units>
   <MultiplyingFactor>35.274 </MultiplyingFactor>
</ConvertingUnits>
</UnitValues>
<LowofLowValue>0</LowofLowValue>
<HighofLowValue></HighofLowValue>
<HighofHighValue>64000</HighofHighValue>
<LowofHighValue>64000</LowofHighValue>
</ValueMetadata>






From: Campbell, James R [mailto:[email protected]]
Sent: Tuesday, July 01, 2014 9:20 AM
To: Hickman, Hubert B; McClay, James C; Beard, Phillip; Phillip Reeder; 
[email protected]
Cc: [email protected]
Subject: RE: Weight units


I am sure that the reason for Epic decision relates to newborn weights although 
even there I think grams would be better.  Phillip proposed a smallest common 
denominator for measures and I am inclined to keep the ounces and add 
conversion units for

grams to weight 3 kg

pounds for three kg and above with (kg appended). (175lb (79.9 kg)

I know metadataxml can convert the units but the question is do we need to 
write any code to get a uniform display and query engine

________________________________
From: Hickman, Hubert B [[email protected]]
Sent: Tuesday, July 01, 2014 12:01 AM
To: Campbell, James R; McClay, James C
Subject: Weight units
Weight being stored in ounces (which seems to be its native form in Epic, sigh, 
ugh) seems to be of little use to our target audience.

Our end users are not thinking in ounces, for sure.  I would propose we convert 
these to pounds or kilograms when we move them into the fact table (otherwise, 
the unit conversion machinery in i2b2 will be used ALL the time, and my fear it 
is going to be slow).

Unless somebody is a "YE OLDE ENGLISH PEDIATRICIAN" no medical person I know of 
really thinks in ounces...

The heron code converts weights from ounces to pounds.  Shall we follow suit?

Hubert Hickman
P/A III
The Nebraska Medical Center, Zip 5030
[email protected]<mailto:[email protected]>
(402) 559-4838


________________________________

The Nebraska Medical Center E-mail Confidentiality Disclaimer

The information in this e-mail may be privileged and confidential, intended 
only for the use of the addressee(s) above. Any unauthorized use or disclosure 
of this information is prohibited. If you have received this e-mail by mistake, 
please delete it and immediately contact the sender.
_______________________________________________
Gpc-dev mailing list
[email protected]
http://listserv.kumc.edu/mailman/listinfo/gpc-dev

Reply via email to