I'm using this hapi-fhir v4.2.0 server with jpa and it's working just fine. I have added a few patients and I'm able to GET/POST requests to my hapi-fhir localhost environment.
I'm also able to create a subscription using this URL: http://localhost:8080/hapi-fhir-jpaserver/fhir/Subscription with this body:
{
"resourceType": "Subscription",
"criteria": "Patient",
"reason": "Give me the patient",
"end": "2021-01-01T00:00:00Z",
"status": "requested",
"channel": {
"type": "rest-hook",
"endpoint": "http://localhost:1337",
"payload": "application/json"
}
}
Whenever I made a POST or PUT to a Patient
, the subscription should be triggered and send a POST request to http://localhost:1337
but nothing happens.
What I have tried:
requested
to active
Patient
to Patient?name=John
payload
argumentapplication/fhir+json
And still not working :( what I'm missing here guys?
Edit: My backend is a simple nodejs running with morgan
, so it will log every POST/GET/PUT attempt in the console.
This is the homepage for the HAPI-FHIR library. We are developing an open-source implementation of the FHIR specification in Java. FHIR (Fast Healthcare Interoperability Resources) is a specification for exchanging healthcare data in a modern and developer friendly way.
IBM FHIR Server overviewIBM FHIR Server is an open source technology written in Java licensed under Apache 2.0. It can be used to process, validate and store healthcare data according to HL7 FHIR specifications.
Every resource type defined by FHIR has a corresponding class, which contains a number of getters and setters for the basic properties of that resource. HAPI tries to make populating objects easier, by providing lots of convenience methods.
The HAPI FHIR library is an implementation of the HL7 FHIR specification for Java. Explaining what FHIR is would be beyond the scope of this documentation, so if you have not previously worked with FHIR, the specification is a good place to start.
When using the Subscription resource, the FHIR server combines the roles of publisher and information distributer. Other arrangements of the publish and subscribe pattern describe separate agents for the two roles.
HAPI tries to make populating objects easier, by providing lots of convenience methods. For example, the Observation resource has an "issued" property which is of the FHIR "instant" type (a system time with either seconds or milliseconds precision).
I also experienced the same thing. But, I managed to solve it.
We need to turn on the subscription rest webhook at hapi.properties file.
...
##################################################
# Subscriptions
##################################################
# Enable REST Hook Subscription Channel
subscription.resthook.enabled=true
...
If you are now using the latest version, v5.3.0, it is in application.yaml.
...
subscription:
resthook_enabled: true
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With