Skip to content

Commit

Permalink
Merge pull request #25 from Gravitate-Health/development
Browse files Browse the repository at this point in the history
retrieve lenses by identifier instead of name
  • Loading branch information
aalonsolopez authored Oct 23, 2024
2 parents bb2a5f8 + 356b6be commit 224a39d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/lensesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const retrieveLensesNames = async () => {
return []
}
for (let entry of lensesBundle.entry) {
response.push(entry.resource.name)
response.push(entry.resource.identifier[0].value)
}
return response
} catch (error) {
Expand All @@ -24,12 +24,12 @@ const retrieveLensesNames = async () => {
}

const retrieveLense = async (lenseId: string): Promise<Object | null> => {
let lensPath = `/Library?name:exact=${lenseId}`
let lensPath = `/Library?identifier=${lenseId}`
try {
let lenses = await fetch(`${fhirIpsURL}${lensPath}`)
let lensesBundle = await lenses.json()
if (lensesBundle.total === 0) {
return `No lens found with ${lenseId} name`
return `No lens found with ${lenseId} identifier`
}
return lensesBundle.entry[0].resource
} catch (error) {
Expand Down

0 comments on commit 224a39d

Please sign in to comment.