Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load fhir bundle using CyFHIR plugin #35

Closed
rajakushwah1 opened this issue Sep 12, 2021 · 3 comments
Closed

Unable to load fhir bundle using CyFHIR plugin #35

rajakushwah1 opened this issue Sep 12, 2021 · 3 comments

Comments

@rajakushwah1
Copy link

rajakushwah1 commented Sep 12, 2021

Unable to load FHIR bundle data using CyFHIR plugin.

Steps Followed -

  1. Added CyFHIR to $NEO4J_HOME/plugins folder

  2. Added APOC to $NEO4J_HOME/plugins folder

  3. In $NEO4J_HOME/conf/neo4j.conf added apoc and cyfhir as unrestricted plugins NEO4J_dbms_security_procedu res_unrestricted: apoc.,cyfhir.

  4. Restarted the server

  5. Added escape chars to all double quotes in the JSON by executing the below code
    import json,re
    f = open('Agustin529_Ontiveros947_fe08e9ee-b231-93d9-0554-5b5540c9335b.json',)
    bundle = json.load(f)
    bundle_string = json.dumps(bundle)
    bundle_string_formatted = re.sub(r'"', '\"', bundle_string)
    out_file = open("myfile.json", "w")
    json.dump(bundle_string_formatted, out_file, indent = 6)

  6. Executed the command - CALL cyfhir.resource.load("file:///myfile.json", {validation: true, version: "r4"}) to load json

Error -
image

Input FHIR Bundle - https://github.com/Optum/CyFHIR/blob/main/demo/synthea-bundles/Agustin529_Ontiveros947_fe08e9ee-b231-93d9-0554-5b5540c9335b.json

@frisbm
Copy link
Contributor

frisbm commented Sep 12, 2021

@rajakushwah1 Thanks for sharing the issue you're having, unfortunately CyFHIR does not currently supporting loading from a local file. If you take a look at some of the documentation of the [APOC Load JSON Clause]https://neo4j.com/labs/apoc/4.1/import/load-json/), they discuss some of the settings you need to set to use that function with local files. You could try following those guides and then passing the result of loading the local JSON file into cyfhir.resource.load or you could use your above python code and the Neo4J python driver to commit the bundle itself like I do in the demo notebooks.

@rajakushwah1
Copy link
Author

rajakushwah1 commented Sep 13, 2021

@MatthewFrisby Thanks for the quick reply, I have done the settings to load a file from local. But unable to load the result in cyfhir.resource.load

image

Please correct me if the request is incorrect.

@frisbm
Copy link
Contributor

frisbm commented Sep 20, 2021

Thats still not going to work without following all the instructions laid out by Neo4j, and even then it might not work like I mentioned above. The other issue that doesn't even have a chance to throw an error here is that you're using the cyfhir.resource.load() on a bundle, you would need to use the cyfhir.bundle.load() instead for the 'fhirbundle.json'.

Theres not really a usecase for this other than playing around with fhir resources in the Neo4j Browser UI so I am closing this issue and I recommend that you re-read my comments above and the look through the documentation again, as well as look at the multiple examples throughout this repository here for node and here for python. I am closing this issue because this doesn't really pertain to this CyFHIR or a bug within the code, but if you do run into issues using it in an intended way, please

@frisbm frisbm closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants