-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
…pes, calling the API to get the observation, allergies and condition number for a patient
…ations, conditions and hospitalisations on patient table. Clicking on the number will print them on the console.
… of the search tool (search by name with exact and start with)
…or id, removing patientTable array which are replaced by Patient Cards
…ing PatientBundle objects
src/services/api.tsx
Outdated
* TODO : for now, this function is limited by the server response to 500 resources. Must find a way to improve it (searching computation done by the server ideally ?) | ||
*/ | ||
let bundles: Bundle[] = []; | ||
let params: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you initialize params to "" here instead of doing it several times below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're totally right !
src/services/api.tsx
Outdated
searchName.split(" ").map((x: string) => { | ||
params += "&name=" + x; | ||
return params; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
searchName.split(" ").map((x: string) => `${params}&name=`{x}`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I don't really get it, what do you do with the list resulting from the map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we discussed, replaced by :
params += searchName
.split(" ")
.map((x: string) => `&identifier=${x}`)
.join();
src/services/api.tsx
Outdated
* Return the same bundle with more patients, fetched from the nextLink attribute. | ||
*/ | ||
if (!bundle.nextLink) { | ||
console.info("no link available"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user will not see the console, maybe you can show him something :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in issue #24
I don't know for now how to manage that for bundle without next link (in case we merge two bundles for example, with complex requests needing multiple api calls)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just saying that you could show something in the interface instead of printing it to the console (for instance with a toaster as in Pyrog). But if you're going to solve this soon, it's ok
src/services/api.tsx
Outdated
params += "&identifier=" + x; | ||
return params; | ||
}); | ||
params = searchName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params =
or params +=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are doing here a second call to get patients per id, so we reinitialize the parameters
src/services/api.tsx
Outdated
* Return the same bundle with more patients, fetched from the nextLink attribute. | ||
*/ | ||
if (!bundle.nextLink) { | ||
console.info("no link available"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just saying that you could show something in the interface instead of printing it to the console (for instance with a toaster as in Pyrog). But if you're going to solve this soon, it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Other tasks done :