Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
As a follow-up to a previous question, and still as a rookie, having tried to figure out this myself trying and researching a lot, I need to ask for help once more.
I have a patient that has multiple cases, and those multiple cases each have multiple targets which have multiple results, of which there are multiple evidence, of which each consists of multiple vaccinations and multiple medications.
Something like this:
patient - result 1 -target 1 - evidence 1 - vaccination 1
- medication 1
- medication 2
- evidence 2 - vaccination 1
- vaccination 2
- target 2 - evidence 1 - vaccination 1
- medication 1
- medication 2
I am able to isolate patient - to - evidence and show the multiple evidence one at a time. I don't see in the path loop expression where I could build for every multiple occurrence (see pic).
What I'm able to do (one property at a time
I would like to be able to display in my output the full file, the patient to targets, to results, to evidence, to vaccinations, and to medication.
Basically, display it just as I receive it (it is going into a different format but same basic structure.)
Thank you so much for any help you can give me.
Monica
Thank you very much!!!
Can you please provide some complete sample records in JSON and the exact expected output? Then I can try to help you out.
Thank you for trying to help. These are the 3 json files (all .txt for attaching). forum is the file that has the schema I was talking about, then I'm joining it with a patient data file (and others) to produce something like the forumoutput file that I'm attaching.
Thanks for providing the JSON samples, they are very helpful.
Do you know that you can pass a whole JSON node through as a string in the tFileInputJSON component? If you select Xpath as the 'Read by' option, you can check 'Get nodes' for the the column you are interested in and that whole node and its sub-nodes will be passed through as a string instead of getting parsed. See screenshot below of tFileInputJSON.
It seems this would come in handy for you because you want to pass the whole 'result' node through untouched from your input to your output. You also want to pass the 'patient' node the same way from the patients file.
It seems the general plan for your job would be:
Read result data with tFileInputJSON-> Parse patient id to Long and 'result' node as string with 'Get nodes' -> use as main input row to the tMap
Read patient data with tFileInputJSON-> Parse patient id to Long and 'patient' node as string with 'Get nodes' -> use as the lookup row to the tMap
Join data on patient id in tMap -> Output your JSON as the patient node string followed by the result node string