XSD use and mapping

One Star

XSD use and mapping

I'm trying to use a xsd for HL7 Clinical Document Architecture (CDA) (as a canonical data model.)
I need to map the values from the csv file to the CDA xsd
I have already set up the csv file in Talend but can anyone help me with how to import, use and map a xsd with Talend?
Thanks
Four Stars

Re: XSD use and mapping

I may not have understood your request - but you might want to do the following:
To to Metadata --> File XML --> Right Click select Create file XML -- >..... Select your XSD as Input File ---> Build your definition by defining the XPath Loop and fields to extract that will match your CSV.
Once you specify this schema, you can bring it into a tFileInputXML.
One Star

Re: XSD use and mapping

It sounds as though you're trying to write out an HL7 file, if this is the case you can use the tHL7Output component to create an HL7 2.X compliant document. The component is either available through a search for tHL7Output or via the palette under Unstructured -> HL7. Hope that answers your question.
One Star

Re: XSD use and mapping

Thank you for the feedback. What I'm trying to do is map from a csv file to an xml with xsd definition and then map from the xsd to a outpufile. When I run the test my xsd is overwritten and the produced xml does not comply with the xml schema. Any tips ?
Why do I have to define the xsd format as input or output? I need it as a canonical model in the middle of my bus.
Thanks
Four Stars

Re: XSD use and mapping

It appears some features of HL7 components are available only in the Enterprise version - http://www.talendforge.org/forum/viewtopic.php?id=28013 You've not indicated why you can't the HL7 component.
The HL7 Output component is similar to the tFileOutputMSXML component. Assuming your csv file generates a bunch of fields, I'd connect that data flow to a tFileOutputMSXML component. As shown in the image, I imported the XSD that I created from this sample XML on the web - http://www.w3.org/TR/grddl-primer/hl7-sample.xml And from the left, you'd need to map your fields to the output on the right. What is very important in either of these components is setting the right loop and group elements. See this Help Article on how to use this component. https://help.talend.com/search/all?query=tFileOutputMSXML&content-lang=en
Unfortunately, when working with XML files, there's hardly an out of the box solution for every case - even for standard file formats. It'd be good if you can get familiar with your file format and understand the hierarchy (or hierarchies - if it's multiple schemas in one, meaning it has more than one 1: many relationships).
Hope this helps...