Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » OHF » How to set the CDA document TemplateId?
How to set the CDA document TemplateId? [message #48477] Sun, 28 September 2008 08:04 Go to next message
RobertHua is currently offline RobertHuaFriend
Messages: 58
Registered: July 2009
Member
Hi Everybody!
When I create a POCDMT000040ClinicalDocumen object clinicalDocument,I
want to set the ClinicalDocument/TemplateId,I do not find the function
clinicalDocument.setTemplateId(),only finding the
clinicalDocument.getTemplateId().I believe that there must have a way to
set the ClinicalDocument/TemplateId value.
Can someone help me?

Thanks in advance!
RobertHua
Re: How to set the CDA document TemplateId? [message #48566 is a reply to message #48477] Mon, 29 September 2008 21:58 Go to previous message
No real name is currently offline No real nameFriend
Messages: 292
Registered: July 2009
Senior Member
Hi Robert,

The CDA representation is an EMF generated model. Thus, elements that
appear in the CDA schema with multiplicity > 1 are generated as EList
types in the code. Thus, the get method returns you the list to which
you then .add() your value.

II templateId = CDAR2Factory.eINSTANCE.createII();
templateId.setRoot("<template oid here>");
cda.getTemplateId().add(templateId);

The EMF generated code makes this model tough to deal with sometimes. I
recommend having a copy of the CDA schema open as well. EMF does not
generate xsd:choice or enumerations of enumerations very well. And there
are a lot of ELists that, consequently, don't check the type of object
that you are adding so to stay schema compliant you have to be careful.

The model is something, it's better than nothing and far from good CDA
tooling. There just isn't much good tooling for CDA out there now. There
is a real need for this kind of thing in the community --- and it is a
really difficult task to do it 'right' for every kind of healthcare
event a CDA can represent.

So, I strongly recommend reading more on EMF (Eclipse Modeling
Framework) and looking at the
org.eclipse.ohf.ihe.xds.metadata.extract.cdar2 code to familiarize
yourself on some of the usage patterns that EMF genterated code introduces.

regards,
- Sarah


RobertHua wrote:
> Hi Everybody!
> When I create a POCDMT000040ClinicalDocumen object clinicalDocument,I
> want to set the ClinicalDocument/TemplateId,I do not find the function
> clinicalDocument.setTemplateId(),only finding the
> clinicalDocument.getTemplateId().I believe that there must have a way to
> set the ClinicalDocument/TemplateId value.
> Can someone help me?
>
> Thanks in advance!
> RobertHua
>
Re: How to set the CDA document TemplateId? [message #587800 is a reply to message #48477] Mon, 29 September 2008 21:58 Go to previous message
No real name is currently offline No real nameFriend
Messages: 292
Registered: July 2009
Senior Member
Hi Robert,

The CDA representation is an EMF generated model. Thus, elements that
appear in the CDA schema with multiplicity > 1 are generated as EList
types in the code. Thus, the get method returns you the list to which
you then .add() your value.

II templateId = CDAR2Factory.eINSTANCE.createII();
templateId.setRoot("<template oid here>");
cda.getTemplateId().add(templateId);

The EMF generated code makes this model tough to deal with sometimes. I
recommend having a copy of the CDA schema open as well. EMF does not
generate xsd:choice or enumerations of enumerations very well. And there
are a lot of ELists that, consequently, don't check the type of object
that you are adding so to stay schema compliant you have to be careful.

The model is something, it's better than nothing and far from good CDA
tooling. There just isn't much good tooling for CDA out there now. There
is a real need for this kind of thing in the community --- and it is a
really difficult task to do it 'right' for every kind of healthcare
event a CDA can represent.

So, I strongly recommend reading more on EMF (Eclipse Modeling
Framework) and looking at the
org.eclipse.ohf.ihe.xds.metadata.extract.cdar2 code to familiarize
yourself on some of the usage patterns that EMF genterated code introduces.

regards,
- Sarah


RobertHua wrote:
> Hi Everybody!
> When I create a POCDMT000040ClinicalDocumen object clinicalDocument,I
> want to set the ClinicalDocument/TemplateId,I do not find the function
> clinicalDocument.setTemplateId(),only finding the
> clinicalDocument.getTemplateId().I believe that there must have a way to
> set the ClinicalDocument/TemplateId value.
> Can someone help me?
>
> Thanks in advance!
> RobertHua
>
Previous Topic:About DocumentDescriptor CCR
Next Topic:How to set the CDA document Title?
Goto Forum:
  


Current Time: Fri Dec 19 10:52:22 GMT 2014

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

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