care
care copied to clipboard
N+1 API queries in prescription administration table
Currently, the code flow in fetching data for the prescription administration table is:
- List prescriptions for a consultation.
- Computing the overall start and end administration date range to initialize pagination
- Compute the latest range required to be shown in view (eg. last X hours)
- Listing administrations for each of the prescriptions within that range.
TODO: A solution to be discussed