Comments (16)
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.
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.
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.
If I set max_bundles=1
the error is not thrown.
from fhircrackr.
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.
Thanks!
from fhircrackr.
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.
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.
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.
Unfortunately, the base-url is not explicitly mentioned in the searchset bundle.
For me any of these solutions is fine :)
from fhircrackr.
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.
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.
Is there a possibility to test the extraction of the base-url on our site before release?
from fhircrackr.
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.
Thank you!
from fhircrackr.
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)
- fhir_melt loses rows
- Vignette building fails when hapi is down
- Change documentation of fhir_table_description et al
- fhir_crack() | ncores > 1 takes unclear amount of RAM HOT 2
- Custom headers for Cookie based authentication HOT 1
- POST search with relative next links doesn't work HOT 4
- fixed file name pattern to function fhir_load prevents loading arbitrary named xml files HOT 3
- Set Cookie as Headers instead of Named Paramaters HOT 5
- Paging with relative links breaks when searching for `http://` type CodeSystems HOT 6
- Check that next-links don't get url encoded
- BUG: fhircrack fhir_search function gets stuck HOT 4
- Older Version in the CRAN Repository? HOT 2
- Base URL not creectly printed in fhir_search() HOT 1
- CRAN checks fail because \donttest{} examples are tested
- Update Package Citation Info
- fhir_url can't deal with `=` in parameter values HOT 1
- feature: load bundles from xml character vectors HOT 5
- Documantation fhir_cast() - Example not working HOT 2
- feature: select elements based on attribute values in fhir_crack
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fhircrackr.