Pharmacy Sale Mandatory Fields Configuration - hmislk/hmis GitHub Wiki

Overview

This feature allows hospital administrators to configure which patient and prescription details are mandatory when processing pharmacy sales. Different institutions have different requirements - some need complete patient records for all sales, while others may allow sales without patient information for walk-in customers.

When to Use

Use these configuration options to:

  • Enforce patient registration for all pharmacy sales (e.g., for insurance tracking)
  • Require specific patient details like phone numbers for follow-up calls
  • Mandate referring doctor information for prescription tracking
  • Adapt to different departments with varying documentation requirements
  • Comply with institutional policies for patient data collection

Common Scenarios

Scenario 1: Insurance-Based Hospital

  • Patient registration is mandatory
  • Name, phone, gender, and address are required
  • Referring doctor must be recorded
  • Used for: Insurance claims, patient follow-up, prescription tracking

Scenario 2: Retail Pharmacy (Walk-in)

  • Patient registration is optional
  • Only phone number required (if patient registers)
  • No referring doctor needed
  • Used for: Over-the-counter sales, minimal documentation

Scenario 3: Government Hospital

  • Patient registration is mandatory
  • Name and area are required (for demographic reporting)
  • Referring doctor required
  • Used for: Public health reporting, service area analysis

How to Configure

Accessing Configuration

  1. Navigate to Menu โ†’ Administration โ†’ Manage Institutions โ†’ Preferences โ†’ Configuration Options
  2. Use the search box to find configuration options by their key name
  3. Each validation option can be enabled or disabled independently
  4. Click the Save button after making changes

Configuration Option Keys

When searching for configuration options, use these exact key names:

Configuration Option Key Purpose
Patient is required in Pharmacy Retail Sale Makes patient registration mandatory
Patient Name is required in Pharmacy Retail Sale Requires patient name
Patient Phone is required in Pharmacy Retail Sale Requires phone or mobile number
Patient Gender is required in Pharmacy Retail Sale Requires gender selection
Patient Address is required in Pharmacy Retail Sale Requires address entry
Patient Area is required in Pharmacy Retail Sale Requires area selection
Referring Doctor is required in Pharmacy Retail Sale Requires referring doctor selection

Quick Search Tips:

  • Search for "Patient is required" to find all patient-related validations
  • Search for "Pharmacy Retail Sale" to see all pharmacy sale validations
  • Configuration options are case-sensitive when searching

Configuration Options

1. Patient is Required in Pharmacy Retail Sale

What it does: Makes patient registration mandatory before completing any pharmacy sale.

When enabled:

  • Users cannot complete a sale without selecting or creating a patient
  • All sales will be linked to a patient record

When disabled:

  • Sales can be completed without patient information
  • Useful for walk-in customers or over-the-counter sales

Error message if violated: "Patient is required."


2. Patient Name is Required in Pharmacy Retail Sale

What it does: Requires patient name to be entered if a patient is registered.

When enabled:

  • If user creates/selects a patient, the name field must be filled
  • Works only if patient exists or is required

When disabled:

  • Patient name is optional even if patient is registered

Error message if violated: "Patient name is required."

Important: If "Patient is Required" is disabled and no patient is provided, this validation is skipped.


3. Patient Phone is Required in Pharmacy Retail Sale

What it does: Requires at least one phone number (mobile or landline) for the patient.

When enabled:

  • Either phone or mobile number must be provided
  • If only one number is given, it satisfies the requirement

When disabled:

  • Phone numbers are optional

Error message if violated: "Patient phone number is required."

Tip: The system accepts either the phone field OR the mobile field, so users can fill in whichever is available.


4. Patient Gender is Required in Pharmacy Retail Sale

What it does: Requires patient gender/sex to be selected.

When enabled:

  • Gender must be selected (Male/Female/Other) for patient registration
  • Useful for demographic reporting and prescription safety

When disabled:

  • Gender is optional

Error message if violated: "Patient gender is required."


5. Patient Address is Required in Pharmacy Retail Sale

What it does: Requires patient address to be entered.

When enabled:

  • Address field must be filled if patient is registered
  • Useful for delivery services or patient follow-up

When disabled:

  • Address is optional

Error message if violated: "Patient address is required."


6. Patient Area is Required in Pharmacy Retail Sale

What it does: Requires patient area/location to be selected from predefined areas.

When enabled:

  • User must select patient's geographical area
  • Useful for service area analysis and planning

When disabled:

  • Area selection is optional

Error message if violated: "Patient area is required."

Note: Areas must be pre-configured in the system under Setup โ†’ Areas.


7. Referring Doctor is Required in Pharmacy Retail Sale

What it does: Requires a referring doctor to be selected for the sale.

When enabled:

  • User must select the doctor who prescribed the medication
  • Works independently of patient requirements
  • Useful for prescription tracking and commission calculations

When disabled:

  • Referring doctor is optional

Error message if violated: "Referring doctor is required."

Important: This validation is independent of patient requirements. You can require referring doctor even if patient is not required.


Understanding the Logic

Patient Existence Logic

The system uses smart logic to apply validations:

  1. If "Patient is Required" = Enabled:

    • Patient must be provided
    • All enabled patient detail validations are enforced
  2. If "Patient is Required" = Disabled:

    • Patient is optional
    • If user provides a patient, patient detail validations are checked
    • If user does NOT provide a patient, patient detail validations are skipped

Example Scenarios

Example 1: Optional Patient, Mandatory Phone

  • Configuration:
    • Patient is Required = Disabled
    • Patient Phone is Required = Enabled
  • Result:
    • User can complete sale without a patient โœ“
    • If user creates a patient, phone must be provided โœ“

Example 2: Mandatory Patient, Optional Details

  • Configuration:
    • Patient is Required = Enabled
    • Patient Name is Required = Disabled
    • Patient Phone is Required = Disabled
  • Result:
    • User must create/select a patient โœ“
    • Name and phone are optional โœ“

Example 3: No Patient, Doctor Required

  • Configuration:
    • Patient is Required = Disabled
    • Referring Doctor is Required = Enabled
  • Result:
    • User can skip patient registration โœ“
    • User must select a referring doctor โœ“

Where These Validations Apply

These validation rules are enforced at two points in the pharmacy sale process:

1. Direct Sale (Pharmacy Counter)

  • Page: Pharmacy โ†’ Retail Sale
  • Button: "Settle" button
  • User completes the sale directly at the pharmacy counter

2. Sale for Cashier

  • Page: Pharmacy โ†’ Sale for Cashier
  • Button: "Settle Bill at Cashier" button
  • Sale is created at pharmacy and settled at cashier counter

Both pages use the same validation rules, ensuring consistency across the system.

Best Practices

For Hospital Administrators

  1. Start with minimal requirements and add more as needed

  2. Consider your workflow:

    • Insurance-based: Enable patient and all details
    • Walk-in pharmacy: Disable patient requirement, enable phone only
    • Mixed: Enable patient requirement but make details optional
  3. Train staff on why certain fields are mandatory

  4. Review periodically - adjust settings based on reporting needs

For Pharmacy Staff

  1. Understand the requirements of your institution
  2. Fill required fields completely to avoid errors
  3. Use existing patients when possible (search before creating new)
  4. Provide accurate phone numbers for patient follow-up
  5. If validation error occurs:
    • Read the error message carefully
    • Fill in the missing required information
    • Contact administrator if a field should not be mandatory

Troubleshooting

Error: "Patient is required"

Cause: Patient requirement is enabled but no patient was selected. Solution: Search for and select an existing patient, or create a new patient.

Error: "Patient name is required"

Cause: Patient name validation is enabled and name field is empty. Solution: Enter the patient's full name before settling the bill.

Error: "Patient phone number is required"

Cause: Phone validation is enabled and neither phone nor mobile is provided. Solution: Enter at least one phone number (either phone or mobile field).

Error: "Patient gender is required"

Cause: Gender validation is enabled and gender is not selected. Solution: Select the patient's gender from the dropdown.

Error: "Patient address is required"

Cause: Address validation is enabled and address field is empty. Solution: Enter the patient's address.

Error: "Patient area is required"

Cause: Area validation is enabled and no area is selected. Solution: Select the patient's area from the dropdown. If area is not available, contact administrator to add it.

Error: "Referring doctor is required"

Cause: Referring doctor validation is enabled and no doctor is selected. Solution: Select the doctor who prescribed the medication.

Wrong Field is Mandatory

Cause: Configuration setting is enabled when it shouldn't be. Solution: Contact system administrator to review and adjust the configuration.

Administrator Configuration Checklist

When setting up a new department or pharmacy:

  • Review institutional policies for patient data collection
  • Determine which fields are legally required
  • Consider reporting and insurance requirements
  • Enable appropriate validation options
  • Test the configuration with pharmacy staff
  • Document the requirements for staff training
  • Review configuration after 30 days of use
  • Adjust based on staff feedback and operational needs

FAQ

Q: Can different departments have different requirements?

A: Currently, these settings apply system-wide to all pharmacy sales. Department-specific settings are not available in this version.

Q: If I disable "Patient is Required", will patient details never be validated?

A: Patient details will still be validated if a user chooses to register a patient. The validations only skip if both the patient requirement is disabled AND no patient is provided.

Q: Can I require phone number but not patient?

A: If "Patient is Required" is disabled, you can enable "Patient Phone is Required". In this case, if the user registers a patient (optional), the phone becomes mandatory. If the user doesn't register a patient, the validation is skipped.

Q: What's the difference between phone and mobile?

A: The system has two separate fields for phone numbers. The validation is satisfied if either one is filled. Users can provide a landline number OR a mobile number.

Q: Can I change these settings after going live?

A: Yes, administrators can change these settings at any time. Changes take effect immediately for new sales.

Q: Will changing settings affect old bills?

A: No, these validations only apply when settling new bills. Existing bills are not affected.

Q: Can I make referring doctor mandatory but patient optional?

A: Yes, the referring doctor validation is independent of patient validations. This is useful for tracking prescriptions even for walk-in customers.


Last Updated: 2025-10-05 Version: 3.0.0 For Technical Details: See developer documentation in the repository

โš ๏ธ **GitHub.com Fallback** โš ๏ธ