nazrulworld / fhirpath Goto Github PK
View Code? Open in Web Editor NEWFHIRPath implementation in Python.
Home Page: https://nazrul.me/fhirpath/
License: Apache License 2.0
FHIRPath implementation in Python.
Home Page: https://nazrul.me/fhirpath/
License: Apache License 2.0
This is not a bug report but a question.
I created a Patient resource with the following content
{
"resourceType": "Patient",
"id": "1",
"name": [
{
"given": [
"John"
],
"family": "Mercer"
},
{
"given": [
"Alex"
],
"family": "Connor"
}
]
}
Then, I tried the following search
search_context = SearchContext(engine, "Patient")
# equivalent to /Patient?name=John&name=Connor
params = (("name", "John"), ("name", "Connor"), )
search_tool = Search(search_context, params=params)
bundle = search_tool()
assert bundle.total > 0
No documents are matched due to the nested
wrapper on the top-most GroupTerm
.
A similar query on HAPI Test Server returns a non-zero response
curl -X GET "http://hapi.fhir.org/baseR4/Patient?name=Ajay&name=Mishra&_pretty=true"
I could not any relevant documentation or rules around such matches on FHIR Search.
Is this behavior server specific or something that I may have missed in FHIR specification?
The search is not yet able to handle the _include modifier which allows to "join" resources between them.
For instance, the query string /Observation?category=laboratory&_include=Observation:encounter
which is equivalent to
search_context = SearchContext(engine, "Observation")
params = (("category", "laboratory"), ("_include", "Observation:encounter"))
fhir_search = Search(search_context, params=params)
should output a Bundle like:
{
"id": "1",
"meta": {},
"entry": [
{
"fullUrl": "Observation/123",
"resource": {
"...": "...",
"resourceType": "Observation"
},
"search": {
"mode": "match"
}
},
{
"fullUrl": "Encounter/456",
"resource": {
"...": "...",
"resourceType": "Encounter"
},
"search": {
"mode": "include"
}
}
],
"link": [
{
"relation": "self",
"url": "https://some.url"
}
],
"total": 1,
"type": "searchset",
"resourceType": "Bundle"
}
I'm not sure how we should implement "relations" between documents but the parent-child relationship using the join datatype seems to be a good fit.
A first implementation could also consist in running multiple ES queries and construct a bundle from multiple results.
The project is currently licensed under GPLv3, which (if I'm not mistaken) makes dependent projects using GPLv3 as well (see https://choosealicense.com/licenses/gpl-3.0/).
We are currently building open-source software on top of fhirpath (and fhir.resources) but we are using the more permissive Apache2 license (like most projects hosted at https://github.com/FHIR or popular projects like https://github.com/hapifhir/hapi-fhir or https://github.com/IBM/FHIR).
Apache2 details (and TLDR) can be found here: https://choosealicense.com/licenses/apache-2.0/
Note that we would not be impacted by other permissive licenses like the MIT License.
I know we already discussed the subject and you seemed to be open to changing the licensing model but this is becoming an issue on our end.
Related: arkhn/fhir-river#281
Hey @nazrulworld and congratulations for the amazing work you've done here! I'm currently building a FHIR api in python and fhirpath
seems to supports many features i'm interested in (search params, chaining, many modifiers etc..) so I was thinking of giving it a go! However I already have my own "provider" as you call it, and I would like to write an integration for my provider to work with fhirpath
(just like what you did with fhirpath_guillotina
).
The library I use is called fhirstore and it is based on mongoDB (storage) and elasticsearch (indexing) so I was thinking that maybe it could be easy to write my own integration but I don't really know which interfaces I need to implement and I did not find more detailed documentation. I started digging in the code of fhirpath_guillotina
but there is a lot of called imported from the guillotina framework and I don't fully understand what's going on.
Would you be willing to share more details on how to write a new provider ?
The company I work with dedicates some of its resources to develop the FHIR ecosystem (mostly python libs) and would be happy to contribute to fhirpath!
Cheers :)
I need to search for Task those statuses are not in completed, cancelled, rejected.
query = {
"status:not": "completed,cancelled,rejected",
"code:not": "|consentTask",
}
Didn’t get the expected result, but when do query positive term like "status": "ready,in-progress", it's working!
Sometimes there would no parameters for example ´@fhir/Task´ that should support (of course have to maintain maximum result limit)
Right now that is not possible.
In #7, we added support for search on several resource types but forgot to test this functionality. It would be good to do so as soon as possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.