Generate JSON file from CCD

Support/help with CloverETL implementation problems

Rajesh
Posts: 3
Joined: Wed Aug 02, 2017 4:19 am

Generate JSON file from CCD

Postby Rajesh » Wed Aug 02, 2017 7:31 pm

Hi All,

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.

a quick response will really appreciated.

Thanks in advance.

Regards,
Rajesh

bartonv
Posts: 20
Joined: Wed May 03, 2017 12:10 pm

Re: Generate JSON file from CCD

Postby bartonv » Fri Aug 04, 2017 2:21 pm

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,
---
Vladimir Barton
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com
How to speed up communication with CloverCARE support

Rajesh
Posts: 3
Joined: Wed Aug 02, 2017 4:19 am

Re: Generate JSON file from CCD

Postby Rajesh » Fri Aug 04, 2017 6:07 pm

Thank you so much for your reply Vladimir.

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.

your inputs will really helps me.

Thanks,
Raj

bartonv
Posts: 20
Joined: Wed May 03, 2017 12:10 pm

Re: Generate JSON file from CCD

Postby bartonv » Mon Aug 14, 2017 3:13 pm

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:

  1. Assuming the input file is selected, click on the Mapping edit button.
  2. 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.
  3. Select the checkbox of the root element and define the output port (port 0) and the output metadata (consisting of a single string field).
  4. Drag [element with children – element, text and subelements] from the Input grid and drop it on the single field in the Output grid.

Respectfully,
---
Vladimir Barton
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com
How to speed up communication with CloverCARE support


cron