Giter Site home page Giter Site logo

Comments (16)

palmjulia avatar palmjulia commented on June 16, 2024 1

Thank's for checking. It's not a fix yet, we'll have to incorporate it into the fhircrackr so you can use it. But I think we should be able to squeeze it in before the next release (which is just around the corner). I'm out of office this week but I'll give you an update as soon as I integrated the fix in the development version so you can try it out.

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Hi! That's an interesting error, thanks for reporting! Could you quickly check for me if the error occurs if you set max_bundles=1 in fhir_search()?

And I'd also be interested in how you pagination works, is there a next link in each bundle that can be used in a GET request to page to the next bundle? If so, what does this link look like?

from fhircrackr.

tobiasgirardet avatar tobiasgirardet commented on June 16, 2024

Yes, there is a next link in each bundle. Here is an example:

  "link": [
    {
      "relation": "self",
      "url": "/app/FHIR/r4/Patient?_shipPagination=eyJvZmZzZXQiOjB9"
    },
    {
      "relation": "first",
      "url": "/app/FHIR/r4/Patient?_shipPagination=eyJvZmZzZXQiOjB9"
    },
    {
      "relation": "next",
      "url": "/app/FHIR/r4/Patient?_shipPagination=eyJvZmZzZXQiOjIwfQ%3D%3D"
    }
  ],

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

If I set max_bundles=1 the error is not thrown.

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Okay thanks then it is indeed the next link that is causing problems with curl. I'll look into it and get back to you.

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

Thanks!

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Okay, so if I understand it correctly you next link is not an actual URL but just a part of it that would supposedly have to be pasted to the base url of your FHIR server? So any program that wants to page through the bundles has to know the base url and the next link to get to the next bundle?

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

yes the next link is a relative url that has to be appended to the base url of our FHIR server in order to get the next bundle

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Oh that's unfortunate. Because we currently don't have a way to know the base url for sure inside of fhir_search(), because we're allowing any FHIR Search URL to be handed over to the function and I think there is no 100% exact way to extract (only) the base url from an arbitrary FHIR search request.

I don't suppose the base URL is per se is to be found anywhere in your searchset bundle right? So we'd probably have to create an additional argument or some kind of extension to the existing arguments that allow you to pass the base url to fhir_search so we can internally add it the next link before querying the next bundle.

Edit: Maybe there is a way to extract the base URL and I'm just not good enough with Regex. I guess that's what we should try first.

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

Unfortunately, the base-url is not explicitly mentioned in the searchset bundle.
For me any of these solutions is fine :)

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Okay I'll do my best =D

stringr::str_match(request, ".*:\\/\\/.*?\\/") might work to get the base URL out of the original FHIR search request. At least if your bsae URL doesn't contain any single /.

If you have the time, could you check if stringr::str_match(request, ".*:\\/\\/.*?\\/") , where request is a string with an arbitrary FHIR Search request for your server, will indeed return the base URL.

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

Our base-url doesn't contain any single / so it should work. I checked the regex with our next-links and the base-url is extracted correctly. Thanks for the quick fix!

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

Is there a possibility to test the extraction of the base-url on our site before release?

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Yes, definetely. As usual a couple of other things came in the way, but I hope I'll be fixing it in the next few days and ask you to test the fix before we're putting it on CRAN. Thanks for offering!

from fhircrackr.

karzideh avatar karzideh commented on June 16, 2024

Thank you!

from fhircrackr.

palmjulia avatar palmjulia commented on June 16, 2024

Finally got around to it. Seems almost too easy, not sure if I forgot anything but can't test it because I don't have a server with relative next links. Could you check if fhir_search() now works when you install the the github version with:
remotes::install_github("https://github.com/POLAR-fhiR/fhircrackr", ref = "fix_paging")?

from fhircrackr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.