I am new to this tool. I just downloaded the 45days trial version and trying to achieve the CCD conversion to JSON file. My objective is to generate the JSON from CCD (continuity of care document which is usually in XML format).
Can someone please help me how can proceed to achieve this? did anyone worked on this requirement in past? your inputs will really helps to me.
Hi Rajesh,
let me break this down into 2 separate issues: reading the CCD file and writing into a JSON file:
1. I understood that the CCD file is basically a file containing some XML code. We have 3 different components that can read XML code: XMLExtract, XMLReader and XMLPathReader. Since you are new to CloverETL I would suggest taking advantage of the XMLExtract component as it provides a user friendly GUI for mapping the XML tags and attributes to the output metadata. More information on how to use the XMLExtract component can be found here.
2. As for writing your data into JSON, I would recommend the JSONWriter component. The Help document can be found and reviewed here.
As an example graph, I suggest reviewing the inbuilt examples in the CloverETL Designer (they are available since the 4.6 version of CloverETL Designer). If you launch the Designer and navigate to Help > CloverETL Examples, it will open up a list of graphs where you would want to review these 2 graphs in the Basic reading & writing section: “XML Files” and “JSON Files”.
Regards,
This is will really helped me i went through all videos and prepared the same in local system.
however, If i use the XMLExtract and JSON Writer i have to mapping so many things like i need to select individual checkboxs. do we have any functionality to check whole nodes in one time. because my CCD consists a lot of nodes and attributes. i think again i need to convert that XML to XSD to generate that into JSON? do we have any shortcut to implement this.
Hi Rajesh,
there is indeed an easier way in case you simply need to transform the XML code to JSON as is. It can be achieved by performing the following steps:
Use the XMLExtract component to read the entire CCD file content into a single field.
Push this field through a Reformat component and take advantage of the xml2json CTL function in order to transform the XML code to JSON code.
Write the JSON code into an output file by using the JSONWriter component.
Note #1: There are multiple ways how to read the entire file content into a single field, for example by using FlatFileReader). Note #2: If you intend to utilize XMLExtract, you will have to perform the mapping in the following way:
* Assuming the input file is selected, click on the Mapping edit button.
* In the pop-up window, click on the ‘Generate tree structure’ button. This will generate the .XSD file and you will be able to see the tree structure.
* Select the checkbox of the root element and define the output port (port 0) and the output metadata (consisting of a single string field).
* Drag [element with children – element, text and subelements] from the Input grid and drop it on the single field in the Output grid.