Skip to content

Add prescription to appointment as doctor #21

Description

@maikelsalazar

Add Prescription to a patient's appointment as doctor:
As an authenticated doctor, I want to add a prescription for a patient's appointment, so that the patient can follow the recommended indications.

Feature (Gherkin)

Feature: Add Prescription

Background:
  Given I am an authenticated doctor
  And I am on my doctor's dashboard
  And I see the list of appointments
  And I have located the appointment
  And I click on the "Add Prescription" button
  And the "Add Prescription" form opens

Scenario: View add prescription form
  Then the form's fields are:
    - Patient's Name
    - Medicine Names
    - Dosage instructions
    - Additional Notes
    - Add Prescription button
    - Cancel button
  And the patient's name should be prefilled and disabled

Scenario: Successfully adding a prescription 
  When I enter valid medicine names
  And I optionally enter dosage instructions or additional notes
  And I click on the "Add Prescription" button
  Then the prescription should be associated with the selected appointment
  And I should see a "Prescription saved" message 
  And the "Add Prescription" form is closed
  And I should remain on my doctor's dashboard

Scenario: Add prescription with missing required data
  When I leave one or more required fields empty
  And I click on the "Add Prescription" button
  Then the prescription should not be saved
  And I should remain on the "Add Prescription" form
  And I should see the proper validation error messages

Scenario: Cancel to add a prescription
  When I click on the "Cancel" button
  Then the "Add Prescription" form should close
  And I should remain on my doctor's dashboard 

Acceptance Criteria:

  1. When viewing the Add Prescription form:
    • Patient's Name prefilled and disabled
    • Medicine Names (required)
    • Dosage Instructions
    • Additional Notes
    • Add Prescription button
    • Cancel button
  2. After adding a prescription successfully:
    • The prescription must be persisted in the database.
    • The prescription must be associated with the selected appointment.
    • I should see the "Prescription saved" confirmation message
    • The form should close automatically
    • The user should remain on the doctor's dashboard.
  3. When I do not fill in any required field:
    • The prescription should not be saved
    • I should remain on the "Add Prescription" form
    • I should see the proper validation error messages
  4. When cancelling the operation:
    • The "Add Prescription" form should close.
    • No prescription should be saved.
    • The user should remain on the doctor's dashboard.

Priority: Medium
Story Points: 5
Notes:

  • A doctor must not be able to add prescriptions to another doctor's appointments.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions