CDCgov / dibbs-query-connector

A FHIR client allowing public health agencies to query health care organizations directly or via a TEFCA QHIN
Creative Commons Zero v1.0 Universal
4 stars 0 forks source link

Initializing My Queries page frontend when user queries present #168

Open robertandremitchell opened 1 day ago

robertandremitchell commented 1 day ago

PULL REQUEST

Summary

This adds this page in Figma: https://www.figma.com/design/Iuw9me6kYftBF4WTCEsCZz/Query-Connector?node-id=475-20666&node-type=frame&m=dev.

This page should populate at http://localhost:3000/queryBuilding if there are queries present in the database, which is currently the case because query has the 220 default eRSD queries in it at the moment.

For now, I've limited that to just two queries. I found that the table had trouble rendering for 220; I think this has to do with how the backend pulls the data that should be less relevant once we have a query_data column; basically the backend is doing a lot more complex work to replicate query_data that it should not have to do to pull that data. We may want to revisit the backend pull after that is done; we could simplify from:

// Type definition for CustomUserQueries
export interface CustomUserQuery {
  query_id: string;
  query_name: string;
  conditions_list?: string;
  valuesets: ValueSet[];
}

to 
// Type definition for CustomUserQueries
export interface CustomUserQuery {
  query_id: string;
  query_name: string;
  conditions_list?: string;
  query_data?: JSON;
}

And add query_data and conditions_list to getCustomQueries at a later date if we did want to try to simplify that function for now. I think it may make sense to do that in the next PR to get this merged, or at least focus on any needed frontend changes in this ticket for the time being.

Similarly, I've just repeated the condition.name in the conditions column as well as query_name just to demonstrate what that will look like; this will eventually have differences based on how queries are saved but we do not yet have the functionality to save/edit queries. I added some additional fluff text to query_name to differentiate for the purposes of design review.

The only button that is functional on the page at the moment is the create query button, which will redirect to build from templates; edit and delete will come in future PRs.

Related Issue

Fixes #134

Additional Information

@mikang a few design questions:

Checklist