Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Search tool connexion with FHIR API #22

Merged
merged 28 commits into from
Mar 20, 2020
Merged

Conversation

nriss
Copy link
Contributor

@nriss nriss commented Mar 10, 2020

  • Search by age
  • Search by name / id
  • Search by diabetes condition

Other tasks done :

  • BlueprintJS array remplaced by patient card
  • Loading more patients using next link attribute
  • Adding "précedent" and "suivant" buttons to fetch more patients
  • Lots of improvements in service/api.tsx

@nriss nriss requested a review from Jasopaum March 10, 2020 15:39
src/components/patientPage/patientCard/index.tsx Outdated Show resolved Hide resolved
src/components/patientPage/patientCard/index.tsx Outdated Show resolved Hide resolved
src/components/patientPage/patientCard/index.tsx Outdated Show resolved Hide resolved
src/components/patients/index.tsx Show resolved Hide resolved
src/components/patients/patientTable/index.tsx Outdated Show resolved Hide resolved
src/components/patients/searchTool/index.tsx Outdated Show resolved Hide resolved
src/components/patients/searchTool/index.tsx Show resolved Hide resolved
src/services/api.tsx Outdated Show resolved Hide resolved
src/services/api.tsx Outdated Show resolved Hide resolved
@nriss nriss requested a review from Jasopaum March 13, 2020 15:42
src/components/patients/index.tsx Outdated Show resolved Hide resolved
src/components/patients/index.tsx Outdated Show resolved Hide resolved
* 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;

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're totally right !

Comment on lines 138 to 141
searchName.split(" ").map((x: string) => {
params += "&name=" + x;
return params;
});

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}`

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?

Copy link
Contributor Author

@nriss nriss Mar 18, 2020

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 Show resolved Hide resolved
* Return the same bundle with more patients, fetched from the nextLink attribute.
*/
if (!bundle.nextLink) {
console.info("no link available");

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 :)

Copy link
Contributor Author

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)

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 Show resolved Hide resolved
@nriss nriss requested a review from Jasopaum March 18, 2020 12:21
src/services/api.tsx Outdated Show resolved Hide resolved
params += "&identifier=" + x;
return params;
});
params = searchName

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params = or params +=?

Copy link
Contributor Author

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

* Return the same bundle with more patients, fetched from the nextLink attribute.
*/
if (!bundle.nextLink) {
console.info("no link available");

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

@nriss nriss requested a review from Jasopaum March 19, 2020 08:26
@nriss nriss self-assigned this Mar 19, 2020
Copy link

@Jasopaum Jasopaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@nriss nriss merged commit 1ed7db6 into master Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants