Skip to content

Commit

Permalink
Patch for missing Location.near.type property
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Aug 22, 2024
1 parent 4c196ce commit aa0f3b1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/routes/fhir/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ function augmentConformance(json: fhir4.CapabilityStatement, baseUrl: string) {
text: "OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)"
}
];

// There is a bug in our current sandbox causing the definition of the
// Location.near parameter to not have a type property. If so - fix it here!
const Location = json.rest[0].resource?.find(r => r.type === "Location")
const nearDef = Location?.searchParam?.find(p => p.name === "near")
if (nearDef && !nearDef.type) {
nearDef.type = "special"
}
}

return json;
Expand Down

0 comments on commit aa0f3b1

Please sign in to comment.