Subscription Framework - REST Hook HTTP 404 Not Found

43 views
Skip to first unread message

Nguyễn Hải Phong

unread,
Jun 9, 2025, 1:07:23 AMJun 9
to HAPI FHIR
Hi all & James,


I've got issues with Subscription framework with RESTHook Endpoint:
- My channel:
{ "resourceType": "Subscription", "id": "1", "meta": { "versionId": "1", "lastUpdated": "2025-06-09T11:58:32.629+07:00", "source": "#7jodiNp66Fg8nr5L", "tag": [ { "system": "http://hapifhir.io/fhir/StructureDefinition/subscription-matching-strategy", "code": "IN_MEMORY", "display": "In-memory" } ] }, "status": "active", "criteria": "Patient?_format=json", "channel": { "type": "rest-hook", "endpoint": "http://10.86.224.32:8000/patient-handler", "payload": "application/fhir+json" } }

Screenshot 2025-06-09 120023.png
Set up & start successfully.

- My RESTHook Endpoint: 
Screenshot 2025-06-09 120204.png
Up & reachable.
But when I posted an Patient Resource, I've got the error: 
Screenshot 2025-06-09 120518.png
It failed to reach my RESTHook Endpoint and issued an HTTP 404 Not Found error.

Anyone have any idea on this situation? 

I used hapi-fhir-jpaserver-starter-image-v8.2.0-1package.

Thank you in advanced.

James Agnew

unread,
Jun 9, 2025, 5:48:43 AMJun 9
to Nguyễn Hải Phong, HAPI FHIR
This means that the server was unable to successfully deliver a FHIR REST update operation to the endpoint configured in your subscription (http://10.86.224.32:8000/patient-handler). Check that this endpoint is reachable, and supports FHIR REST semantics.

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/e3aabf94-27c5-460d-a0ea-428adcb415c6n%40googlegroups.com.

Nguyễn Hải Phong

unread,
Jun 10, 2025, 1:03:30 AMJun 10
to HAPI FHIR
Thank James,

But I am not really sure about "FHIR REST semantics" part, How should I implement my RESTHook Endpoint? Any spec that I can check?

Really appriciated if you can note some information regarding this matter, 

James Agnew

unread,
Jun 10, 2025, 5:35:14 AMJun 10
to Nguyễn Hải Phong, HAPI FHIR
The REST HOOK delivery mechanism expects the receiver to be a compliant FHIR server, capable of at least:

- Returning a CapabilityStatement when "[endpoint]/metadata" is requested (all FHIR endpoints must be able to do this)
- Supporting a FHIR update, i.e. {PUT} "[endpoint]/[resourceType]/[id]", and returning an appropriate response

Cheers,
James

Nguyễn Hải Phong

unread,
Jun 11, 2025, 3:49:07 AMJun 11
to HAPI FHIR
Thank you James, 
Very informative!

But I found the problem:
  • New channel settings:

 '{
  "resourceType": "Subscription",
  "extension": [
    {
      "url": "http://hapifhir.io/fhir/StructureDefinition/subscription-payload-search-criteria",
      "valueString": "Patient?_id=${matched_resource_id}&_include=*"
    }
  ]
,

  "status": "active",
  "criteria": "Patient?_format=json",
  "channel": {
    "type": "rest-hook",
    "endpoint": "http://10.86.224.32:8000/patient-handler",
    "payload": "application/fhir+json"
  }
}
==============
I found that the old one do not have extension (acording to Subscriptions R5 Backport IG); so the Subscription framework do not know to collect data to send out. I think there should be some base/default behavior for the case like this?

James Agnew

unread,
Jun 11, 2025, 11:16:14 AMJun 11
to Nguyễn Hải Phong, HAPI FHIR
FYI: It's definitely possible to use Subscriptions in R4 without that "R5 subscription backport" extension - The Subscription resource you posted is a standard R4 subscription, and should work fine as-is. And either way I wouldn't expect missing inclusion criteria to cause a 404 error. That error can only come from your delivery endpoint.

Glad you have things working though.

Cheers,
James

Reply all
Reply to author
Forward
0 new messages