Closed gmej closed 5 months ago
I have drafted the first version of the FHIR connector interface. You can find it in the swagger deployment in dev: https://gravitate-health.lst.tfo.upm.es/swagger-fosps/?urls.primaryName=FHIR%20Connector
I need feedback with this interface definition before implementing the connector as a proxy for other FHIR servers.
ping @amedranogil @joofio
I see no issue with this definition, other than connectors should offer access to any FHIR type, so maybe we should enable a "type free" search and retrieval for future-proofing?
OK, I'll make it available for any resource type.
@jkiddo @joofio How can we achieve this? Is there a possibility to search at system level? I think it's not implemented yet in HAPI FHIR https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#system_search
I dont fully understand what you are trying to achieve
So the thing is we are implementing the "proxy mode" for the connector. It will look on all the sources to find the resource you are trying to query (being hosted in FOSPS or other FHIR sources outside). What I am trying to do is enabling an endpoint with a "generic" HAPI FHIR search, i.e. looking for any kind of resource matching the query
You can do 'generic' searches using transactions, e.g.:
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"request": {
"method": "GET",
"url": "Patient?_elements=id"
}
},
{
"request": {
"method": "GET",
"url": "Composition?type=document"
}
}
]
}
you post it to the root of the endpoint, e.g. https://gravitate-health.lst.tfo.upm.es/epi/api/fhir
That's exactly what we needed to know, thanks!
This is a "FHIR transaction" right? Like its documented in the example HAPI FHIR server? https://hapi.fhir.org/baseR4/swagger-ui/#/System%20Level%20Operations/post_
Its a regular FHIR transaction, yes
You can find the documentation here https://www.hl7.org/fhir/http.html#transaction
I've updated it for this generic FHIR transaction, I'll implement this, and the connector will execute the search in different FHIR servers and respond with all results.
I have implemented a "proxy" for this Generic search (FHIR transaction). The endpoint is /connector/api/
. The schema is in the documentation Jens sent. The service accepts a list of FHIR Urls to execute the search transaction. Now we have configured both FHIR servers in FOSPS (ePI and IPS), but external FHIR servers can be connected.
Here is an example of this service. Search for a Patient which name is like alicia
, and a Bundle with id = bundlepackageleaflet-en-f3d8b9999dbf0bb7ed96cabee591db10:
curl --location 'https://gravitate-health.lst.tfo.upm.es/connector/api/' \
--header 'Content-Type: application/json' \
--data '{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"request": {
"method": "GET",
"url": "Patient?name=alicia"
}
},
{
"request": {
"method": "GET",
"url": "Bundle?_id=bundlepackageleaflet-en-f3d8b9999dbf0bb7ed96cabee591db10"
}
}
]
}'
The response are now 4 entries: one entry per request-server pair. In this case: 2 servers * 2 requests = 4 entries.
All FOSPS connectors will be exposed through a single HTTP REST API interface. This task consists of creating an OpenAPI file, and uploading it to FOSPS swagger to be validated by everyone.
Connectors have two operation modes: push and pull.
IMPORTANT: All these FHIR resources returned by this API must contain provenance. A resource will be returned with its correspondant provenance:
This interface can be under a path like
/connector/api/
These operations will be available in this API: