Implement Previous Medicines Retrieval for Patients

Issue Summary

Add functionality to retrieve a patient’s previous prescriptions (medicines) via an API endpoint.

Current Behavior: There is no way to fetch previously prescribed medicines for a patient.

Expected Behavior: System should provide an endpoint to return all past prescriptions for a given patient.

Problem Statement

What is missing? No API exists to fetch previous medicines. Impact: Slower workflow Poor patient history tracking Reproduction: Try fetching past medicines → No endpoint available

Proposed Solution

Create a new API endpoint Add a button to Retrieve previous medicines.

Test-Driven Development

Acceptance Criteria (Given-When-Then)

Scenario 1: Fetch previous prescriptions successfully

Given a valid patient ID exists And the patient has previous prescriptions When the client requests previous medicines Then the system returns a list of medicines And each record contains name, dosage, frequency, and date

Scenario 2: Patient has no prescriptions

Given a valid patient book number exists And the patient has no previous prescriptions When the client requests previous medicines Then the system returns an no previous prescriptions message

Edited by ashritha kunjeti