Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenHIM is failing to forward path #17

Closed
samuelimoisili opened this issue Jan 26, 2023 · 2 comments · Fixed by #18
Closed

OpenHIM is failing to forward path #17

samuelimoisili opened this issue Jan 26, 2023 · 2 comments · Fixed by #18
Assignees

Comments

@samuelimoisili
Copy link
Contributor

OpenHIM isn't forwarding paths correctly to the mediator.

@lorerod
Copy link
Contributor

lorerod commented Feb 14, 2023

Thanks @samuelimoisili this is working now.

Environment: MacOS 13.1 (22C65); Docker desktop 4.15.0 (93002)l; Docker engine: 20.10.21

  • Request:

Method URL: POST http://localhost:5001/mediator/patient
JSON body: { "name": "Lorena" }

  • Response:

Status code: 200 OK
JSON body:

{
    "status": 201,
    "patient": {
        "resourceType": "Patient",
        "id": "1",
        "meta": {
            "versionId": "1",
            "lastUpdated": "2023-02-14T17:22:33.909+00:00"
        },
        "text": {
            "status": "generated",
            "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Lorena <b>LORENA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td/></tr></tbody></table></div>"
        },
        "identifier": [
            {
                "system": "cht"
            }
        ],
        "name": [
            {
                "use": "official",
                "family": "Lorena",
                "given": [
                    "Lorena"
                ]
            }
        ]
    }
}
  • openhim-core log:
2023-02-14 14:17:48 2023-02-14T17:17:48.322Z [worker1] info: Client (Interoperability Client) is Authenticated.
2023-02-14 14:17:48 2023-02-14T17:17:48.326Z [worker1] info: No channel matched the request /mediator
2023-02-14 14:17:52 2023-02-14T17:17:52.169Z [worker1] info: Client (Interoperability Client) is Authenticated.
2023-02-14 14:17:52 2023-02-14T17:17:52.175Z [worker1] info: The channel that matches the request /mediator/ is: Mediator
2023-02-14 14:17:52 2023-02-14T17:17:52.175Z [worker1] info: The request, '/mediator/' is authorised to access Mediator
2023-02-14 14:17:52 2023-02-14T17:17:52.176Z [worker1] info: Storing request metadata for inbound transaction
2023-02-14 14:17:52 2023-02-14T17:17:52.190Z [worker1] info: Routing http(s) request
2023-02-14 14:17:52 2023-02-14T17:17:52.204Z [worker1] info: executing primary route : Mediator
2023-02-14 14:17:52 2023-02-14T17:17:52.205Z [worker1] info: primary route completed
2023-02-14 14:17:52 2023-02-14T17:17:52.205Z [worker1] info: All routes completed for transaction: 63ebc2402b0dc100138bd2f8
2023-02-14 14:17:52 2023-02-14T17:17:52.226Z [worker1] info: stored primary response for 63ebc2402b0dc100138bd2f8
2023-02-14 14:17:52 2023-02-14T17:17:52.229Z [worker1] info: Final status for transaction 63ebc2402b0dc100138bd2f8 : Successful
2023-02-14 14:17:57 2023-02-14T17:17:57.235Z [worker1] info: HTTP socket timeout reached
2023-02-14 14:18:14 2023-02-14T17:18:14.205Z [worker1] info: Client (Interoperability Client) is Authenticated.
2023-02-14 14:18:14 2023-02-14T17:18:14.210Z [worker1] info: No channel matched the request /mediator/
2023-02-14 14:18:29 2023-02-14T17:18:29.584Z [worker1] info: Client (Interoperability Client) is Authenticated.
2023-02-14 14:18:29 2023-02-14T17:18:29.589Z [worker1] info: The channel that matches the request /mediator/ is: Mediator
2023-02-14 14:18:29 2023-02-14T17:18:29.590Z [worker1] info: The request, '/mediator/' is authorised to access Mediator
2023-02-14 14:18:29 2023-02-14T17:18:29.590Z [worker1] info: Storing request metadata for inbound transaction
2023-02-14 14:18:29 2023-02-14T17:18:29.598Z [worker1] info: Routing http(s) request
2023-02-14 14:18:29 2023-02-14T17:18:29.603Z [worker1] info: executing primary route : Mediator
2023-02-14 14:18:29 2023-02-14T17:18:29.604Z [worker1] info: primary route completed
2023-02-14 14:18:29 2023-02-14T17:18:29.604Z [worker1] info: All routes completed for transaction: 63ebc2652b0dc100138bd354
2023-02-14 14:18:29 2023-02-14T17:18:29.617Z [worker1] info: stored primary response for 63ebc2652b0dc100138bd354
2023-02-14 14:18:29 2023-02-14T17:18:29.618Z [worker1] info: Final status for transaction 63ebc2652b0dc100138bd354 : Successful

Observation: I don't know if it has anything to do with this change, but I realized when testing that step 5. of the project README has to be updated with a '/' at the end of the URL:

You can test the mediator by running curl -X GET http://localhost:5001/mediator/ -H "Authorization: Basic $(echo -n interop-client:interop-password | base64)". You should get the following response {"status": "success" }.

@lorerod
Copy link
Contributor

lorerod commented Feb 14, 2023

As @samuelimoisili already merged 17-openhim-path-forwarding, I put it as Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants