-
Notifications
You must be signed in to change notification settings - Fork 13
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
Comments
@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. |
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 |
Unable to load FHIR bundle data using CyFHIR plugin.
Steps Followed -
Added CyFHIR to $NEO4J_HOME/plugins folder
Added APOC to $NEO4J_HOME/plugins folder
In $NEO4J_HOME/conf/neo4j.conf added apoc and cyfhir as unrestricted plugins NEO4J_dbms_security_procedu res_unrestricted: apoc.,cyfhir.
Restarted the server
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)
Executed the command - CALL cyfhir.resource.load("file:///myfile.json", {validation: true, version: "r4"}) to load json
Error -
Input FHIR Bundle - https://github.com/Optum/CyFHIR/blob/main/demo/synthea-bundles/Agustin529_Ontiveros947_fe08e9ee-b231-93d9-0554-5b5540c9335b.json
The text was updated successfully, but these errors were encountered: