Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » OHF » Set Value?
Set Value? [message #48838] Thu, 09 October 2008 04:18 Go to next message
RobertHua is currently offline RobertHuaFriend
Messages: 58
Registered: July 2009
Member
XML:<value xsi:type="PQ" value="155" unit="mm[hg]"/>
Creating a datatype PQ pq,I can use pq.setUnit("mm[hg]"),but the
parameter of the pq.setValue is an object.I do not known how to create the
right object.
Can someone help me?
Re: Set Value? [message #48900 is a reply to message #48838] Thu, 09 October 2008 09:16 Go to previous messageGo to next message
RobertHua is currently offline RobertHuaFriend
Messages: 58
Registered: July 2009
Member
<value xsi:type="RTO_PQ_PQ">
<numerator value="88"/>
<denominator value="1" unit="min"/>
</value>

How to Create the value element? The getValue.add() can add the PQ,but the
PQ do not have the setNumerator or getNumerator?

I do not find the way to create the value element and the way to set the
element value.Can someone help me?
Re: Set Value? [message #48962 is a reply to message #48900] Thu, 09 October 2008 14:51 Go to previous message
No real name is currently offline No real nameFriend
Messages: 292
Registered: July 2009
Senior Member
The 'value' element in the observation is of type 'ANY' which is the
base data type of every underlying datatype in the CDA. So you need to
create an instance of the datatype of your choice and then the mehtods
should be available to you. Numbers use their object wrapper types.

PQ quantityValue = CDAR2Factory.eINSTANCE.createPQ();
quantityValue.setValue(new Double(1.234567890));
quantityValue.setUnit("mg/Hg");

- Sarah


RobertHua wrote:
> <value xsi:type="RTO_PQ_PQ">
> <numerator value="88"/>
> <denominator value="1" unit="min"/>
> </value>
>
> How to Create the value element? The getValue.add() can add the PQ,but
> the PQ do not have the setNumerator or getNumerator?
> I do not find the way to create the value element and the way to set the
> element value.Can someone help me?
>
Re: Set Value? [message #587888 is a reply to message #48838] Thu, 09 October 2008 09:16 Go to previous message
RobertHua is currently offline RobertHuaFriend
Messages: 58
Registered: July 2009
Member
<value xsi:type="RTO_PQ_PQ">
<numerator value="88"/>
<denominator value="1" unit="min"/>
</value>

How to Create the value element? The getValue.add() can add the PQ,but the
PQ do not have the setNumerator or getNumerator?

I do not find the way to create the value element and the way to set the
element value.Can someone help me?
Re: Set Value? [message #587901 is a reply to message #48900] Thu, 09 October 2008 14:51 Go to previous message
No real name is currently offline No real nameFriend
Messages: 292
Registered: July 2009
Senior Member
The 'value' element in the observation is of type 'ANY' which is the
base data type of every underlying datatype in the CDA. So you need to
create an instance of the datatype of your choice and then the mehtods
should be available to you. Numbers use their object wrapper types.

PQ quantityValue = CDAR2Factory.eINSTANCE.createPQ();
quantityValue.setValue(new Double(1.234567890));
quantityValue.setUnit("mg/Hg");

- Sarah


RobertHua wrote:
> <value xsi:type="RTO_PQ_PQ">
> <numerator value="88"/>
> <denominator value="1" unit="min"/>
> </value>
>
> How to Create the value element? The getValue.add() can add the PQ,but
> the PQ do not have the setNumerator or getNumerator?
> I do not find the way to create the value element and the way to set the
> element value.Can someone help me?
>
Previous Topic:How to Create Organization Information
Next Topic:Will SAT be maintained
Goto Forum:
  


Current Time: Mon Nov 24 22:45:54 GMT 2014

Powered by FUDForum. Page generated in 0.23647 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software