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

Inconsistent LocationHierarchy Endpoint Responses Between Production and Stage Environments #17

Closed
lincmba opened this issue May 21, 2024 · 0 comments · Fixed by #18
Closed
Assignees

Comments

@lincmba
Copy link
Contributor

lincmba commented May 21, 2024

Description:
Our custom LocationHierarchy endpoint exhibits different behaviors when using different JPA servers. When hitting the endpoint in the production environment, the response includes the children block as expected. However, in the staging environment, the children block is missing from the response.

Production Response:

{
  "LocationHierarchyTree": {
    "locationsHierarchy": {
      "listOfNodes": {
        "treeNodeId": "Location/<locationId>",
        "treeNode": [
          {
            "nodeId": "Location/<locationId>",
            "label": "Some FHIR Location",
            "node": { ... },
            "children": [ ... ]
          }
        ]
      }
    }
  }
}

Stage Response:

{
  "LocationHierarchyTree": {
    "locationsHierarchy": {
      "listOfNodes": {
        "treeNodeId": "Location/<locationId>",
        "treeNode": [
          {
            "nodeId": "Location/<locationId>",
            "label": "Some FHIR Location",
            "node": { ... }
          }
        ]
      }
    }
  }
}

Note: The children block is missing in the stage response.

Investigation Findings:
The root cause of this inconsistency is the getId() function in the Location class. This function should return the ID of the location in the format Location/<locationId>. While this format is correctly returned in the production environment, in the stage environment, the ID is returned as a URL, such as "http://host-server:<port>/fhir/Location/<locationId>".

This discrepancy in the ID format is causing the children block to be omitted from the stage environment response.

@lincmba lincmba self-assigned this May 21, 2024
lincmba added a commit that referenced this issue May 21, 2024
 Extract the location id in the correct format from the returned value when getId() is called
 fixes #17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant