OHDSI Home | Forums | Wiki | Github

AchillesWeb: Java script error on Observation Period tab

Hi All,

I have exported the Achilles Result to JSON. I am facing issue with Observation Period tab as data is not getting displayed.
When I checked the console, I could see there is an JavaScript error.

Please find below the screenshot of error:

When I backtracked to code, it seems to be ok.

Any help would be greatly appreciated.

If it says ‘map is not a function’, it means that the target of the call to .map() is not an array. Can you check your JSON file and check what is being returned in the object:
AGE_BY_GENDER.CATEGORY

This should be an array.

Hey Chris,

I check the JSON file for observation period it is an array only. Please find below screenshot of JSON.
Is there anything else that I can check ??

I can see in your screenshot that the AGE_BY_GENDER property is a single object element with 4 properties. I think this is a problem with the rjson serialization that doesn’t create arrays around single row results. The json structure you have is:

AGE_BY_GENDER: { "CATEGORY": "FEMALE", "MIN_VALUE": 4, "P10_VALUE": 22, "P25_VALUE": 34 ....}

What it should be is:

AGE_BY_GENDER: {"CATEGORY": ["FEMALE"], "MIN_VALUE": [4], "P10_VALUE": [22] ...

So, it looks like your database only has females? We’ve seen this issue in the past and there’s a ‘normalizeDataframe’
function that we call on a result property to make the elements in it arrays instead of the single-value objects.

Here’s an example where it is called:

What we need to do is call that function on the AGE_BY_GENDER object before it renders into the plot. I can make a branch and pr on this. I’ll open up an issue on git and we can track it there.

@Megha_Maheshwari
I’ve pushed up a branch with an attempt to fix your issue. The branch is called ‘issue-64’ and you can see it here:

Would you be able to pull that branch down and confirm in your environment before I merge into master? There may be other issues uncovered by your dataset’s characteristics, and I’d prefer to capture all the issues before making a merge into master.

If you aren’t familiar with pulling and checking out the branch, I understand and I’ll merge it into master if you are unable to verify the branch.

@Chris_Knoll
I tested the updated code (for Achilles.js). Issue with Observation Period tab is resolved. I am not familiar with pulling and checking out the branch. Could you please do that.

I am facing problem with Drug and Drug Era tab.For these two table ,export_to_JSON results in no files. When I backtracked and checked, it seems SQL queries for Drug tables export have join with vocabulary ATC and for our conversion we have used vocabulary NDC. So I just wanted to check with you whether it is expected that for conversion only ATC vocabulary will be used? Let me know if my understanding is wrong.

Do you mean that you are storing NDC concepts directly into the drug exposure table as the drug_concept_id?

Yes…we are not using standard concepts.
Just wanted to check on that part.

Right, not using standard concepts will not allow a rollup from a drug exposure (found in the RxNorm vocabulary) to the ingredient or ATC class.This is required for the drug exposure/drug era reports.

t