Werner Beukes · Jan 15, 2021

How to test transformation from Virtual Document to FLR

I just need to know if I can test a Virtual Document to a flat file transformation using the Test facility in the Tools tab of the Data Transformation Builder.

There is an example in Ensemble(ENSDEMO namespace), but that is for a Virtual Document to Virtual Document. I need to know the syntax in the Input box.

1 0 14 87
Log in or sign up to continue


What kind of virtual document? What class is the source message -- for example EnsLib.EDI.XML.Document?

Yes. Source class is EnsLib.EDI.XML.Document and target is RecordMaps.Cxxxx.CxxxCxxxxx.Record.

That makes it easy. You can just paste raw XML into the Input Message box in the testing tool.

I am a bit confused. If you look at the Ensemble Demo.HL7.MsgRouter.Schema:ORM_O01, which is a Virtual document to Virtual Document transformation, the data in the Input box looks like this, MSH:;~\&:ST01C:A:HNS:A:20041209100007::ADT;A08:26070901:P:2.2:26070901::AL:::::::2.2b

Should my source data not look like this?

That's an HL7 vdoc (EnsLib.HL7.Message) and that sample is HL7 code (though with strange delimiters).

So yes, if your input message is HL7 (EnsLib.HL7.Message) then you can just paste a raw HL7 message into the testing tool.

If your input message is XML (EnsLib.EDI.XML.Document) then you can just paste raw XML into the testing tool.

If your input message is an EnsLib.EDI.XML.Document and the message content is HL7 there's going to be a problem :)

I see my mistake now. The Demo is EnsLib.HL7.Message. My source is EnsLib.EDI.XML.Document. So the demo data format is useless in this case.  Is there an example somewhere of a transformation of a class of this type?

Sorry. I need to be more specific. An example which contains test data in the Inbox for this specific type of transformation.

It looks like the ENSDEMO namespace doesn't have an example for XML v-docs.

The basic steps are:
- Import an XSD (XML schema) for the document format you need to work with:

- In your DTL, select XML as the Source Type and for Source Document Type select the schema that you just imported

- The DTL editor will use the imported schema to display a document structure that you can use to visually build your mappings

At this point you can paste into the testing tool a sample XML that follows the XSD.

If you just want to do a quick test to see how this works, you can find a simple XSD online and import that. I found this sample which includes an XSD and sample XML that follows the XSD's structure:


Once again I do have to apologize. I did not give you enough information. I might have given you the impression that I do not know how to transform this particular type of class. All the steps that you described above, have been completed. It is just that I got stuck when I wanted to use the Test tool and I did not know how to input the test data for this particular type of class. It should be in order to use the link above to create my own input then? 

No worries, it's always hard to understand from a forum post how far along someone is with their project.

Have you been given any sample XML files that adhere to the schema? If so, you can just copy the XML into the test tool window. If you do this, does it work?

One other question: what version of Ensemble or HealthShare are you using?

I am missing something. My input data is not giving me the results that I am expecting. I think it is the way I am inputting the XML. Lets say the source is EnsLib.EDI.XML.Document SMP_KPMAIN1:KPMAIN1 and their are 2 group levels within this document. SMP_GRP1followed by SMP_GRP2. Within SMP_GRP1 there are 3 fields. GRP1FLD1, GRP1FLD2 and GRP1FLD3. Under SMP_GRP2 there are 5 fields. GRP2FLD1- 5. My question is, do I have to specify the whole document structure in my XML, even though I only want to test the transformation of one field? E.g. GRP2FLD4. The other question is, what would the XML look like? Is it different from a flat file transformation? I just cannot get it right.

The example test data that they give in Ensemble Demo.HL7.MsgRouter.Schema:ORM_O01 just confuses me even more.

Regarding the version that I am using, it is Iris for Ubuntu 2018.1.2

Can the customer provide you with a sample XML file?

If not, you can try something like this online tool which accepts an XSD file and generates a sample XML document with fake data according to the XSD schema.

Demo.HL7.MsgRouter.Schema:ORM_O01 really isn't applicable to your use case. Not worth spending your time on it.