Nested Json
rromero1956 opened this issue · 4 comments
Hi
I have an issue that I do have a work around, but I am hopping that you have a suggestion how to prevent from this to be happening.
Issue:
I have a Json file that I need to extract it into 3 cursors: curDueList, curEncounter and curEpisode
the curDuelist is strait forward, no issue. See picture curDueList
The other two cursors are part of a nested Json.
after flatten, creating the link for a child parent relationship between them (no problem here)
after that I do have two sets of Json arrays ready to be convert to a cursor
The first cursor I do create for some reason remember the first cursor extracted. See picture curEncounter
Similarly when I do the extract the cursor curEpisode. See picture curEpisode
Any Idea how I could prevent this from happening. At this moment my work around is to have an SQL with the data elements that I need.
Thanks for any suggestions
Also, I notice many sessions are open. Do you have a clean-up/unload/reset routing that need to be run at the end
Thanks
Here is the code that I am running and the json file. The MainNested.txt is actually a .prg (need to rename)
xJsonNested.txt
mainNested.txt
Hi
I look at your code and the solution was a simple bug
in the function value you have a case statement for the token types
the particular one that is at fault is:
case this.cur_token.type == T_NULL
this.eat(T_BOOLEAN) && this should be T_NULL
return .null.
after that it works my test file
Thanks
Hi rromero1956,
I apologize for not being able to answer you before, thanks for finding this bug. I've fixed already.
regards!
One last thing
Inside the function parse in the class parser
you have a line
set step on
that line should be removed or commented for distribution
Otherwise it just keep popping up the debugger
Thanks, I think I've removed it already. I'll take a look anyway.