Inpatient EHR Ward Medications - hmislk/hmis GitHub Wiki

Inpatient EHR โ€” Ward Medications

Ward medications are the prescriptions written for a patient during their inpatient stay โ€” the drugs they receive while admitted in the ward. They are distinct from discharge medications (take-home) and from pharmacy direct-issue records (which are the dispensing events).

Page (admission-wide): Admission Profile โ†’ Clinical Data โ†’ Ward Medications
Page (per-assessment): Clinical Assessment โ†’ Inward Medicines
Page (timeline): Admission Profile โ†’ Clinical Data โ†’ Medicine Timeline
XHTML: /inward/inward_ward_medicines.xhtml, /inward/inward_assessment_inward_medicines.xhtml, /inward/inward_ward_medicines_timeline.xhtml
Controller: InpatientClinicalDataController
Field: admissionWardMedicine / admissionWardMedicines
Privilege: InpatientClinicalAssessment


Adding a Ward Medication

From the Ward Medications page:

Field Required Notes
Medicine Yes Auto-complete search across the pharmaceutical item master (minimum 4 characters). Search returns VMP/AMP/generic items.
Dose No Numeric value
Dose Unit No Selected from units available for the chosen medicine
Frequency No e.g., Once daily, Twice daily, 8-hourly
Duration No Numeric value
Duration Unit No Days, weeks, etc.
Comment No Free-text note / special instruction (e.g. "with food", "withhold if BP low"). Shown on the Active and Past lists.

Click Add. Before saving, the system runs an allergy check โ€” if the prescribed drug matches any recorded patient allergy, a yellow ALLERGY ALERT message appears at the top of the page. The prescriber can still proceed.

The prescription is saved as a ClinicalFindingValue with:

  • clinicalFindingValueType = WardMedicine
  • prescription.indoor = true (marks it as an inpatient ward prescription)
  • prescription.prescribedBy = current user
  • prescription.prescribedAt = current timestamp

Active Ward Medications List

The Active Ward Medications panel shows all current prescriptions:

Column Content
Medicine Formatted prescription string (drug name, dose, frequency, duration)
Prescribed By Clinician who wrote the prescription
Prescribed At Date and time of prescribing
Changed From If this prescription replaced a previous one, the original is noted
Comment Any note entered when the medication was added
Action Edit (change dose/frequency) ยท Omit (stop the medication)

You can also tick one or more rows in this list to request them from a pharmacy โ€” see Requesting Selected Medicines from Pharmacy below.


Changing Dose or Frequency

Click the Edit (pencil) icon on an active medication. A dialog opens to enter the new dose and/or frequency. On save:

  • The original prescription is marked omitted with reason "Dose/frequency changed" and omittedAt / omittedBy timestamps
  • A new prescription is created with the updated values and a parent reference pointing to the original
  • The active list shows the new prescription; the past list shows the original with a note to "see active list for updated prescription"

Omitting a Medication

Click the Omit (ร—) icon on an active medication. A dialog prompts for an omission reason. On confirm:

  • prescription.omittedAt = current timestamp
  • prescription.omittedBy = current user
  • prescription.omissionReason = reason entered
  • The medication moves from the Active list to the Past Ward Medications list

Past Ward Medications List

The Past Ward Medications panel shows a count in its header (e.g. "Past Ward Medications (Omitted / Completed) - 3") and lists all stopped/omitted medications for the admission with:

  • Medicine name and prescription details
  • Prescribed By / At
  • Omitted At / By
  • Omission reason (a medication that was dose/frequency-changed is marked accordingly, with a pointer to the active list for the updated prescription)
  • Comment

Requesting Selected Medicines from Pharmacy

Nurses can request the medicines a patient needs directly from this page.

  1. In the Active Ward Medications list, tick the medicines to be requested (one, several, or all).
  2. Click Request Selected from Pharmacy (in the Active panel header).
  3. The system opens the Request from Pharmacy page with the ticked medicines already added as request lines โ€” the dispensable item and quantity are worked out from each prescription's dose, frequency and duration.
  4. Choose the requesting pharmacy and review/adjust quantities, then settle the request as usual.

Pharmacy quick-pick: the request page remembers the last pharmacy you requested from for that ward and pre-offers it, and shows up to 5 recent pharmacies as one-click chips โ€” so repeat requests from the same ward are fast. The choice always stays changeable.

See Request Medicine from Pharmacy for the full request-page workflow.


Recording Medication Administration

Once medicines have been received into the ward (see Ward Medicine Request, Issue, and Return Workflow), nurses can record when each dose is administered to the patient. This is Stage 1 of a two-stage process โ€” it creates a clinical record of administration but does not immediately deduct stock.

How to Record an Administration

  1. In the Active Ward Medications list, find the medicine that was given
  2. Click Mark as Administered next to that medicine
  3. In the dialog that opens:
    • Select the stock batch from which the medicine was taken (batches are sorted first-expiry-first-out)
    • Enter the quantity administered
    • Choose the status: Given, Not Given, Partially Given, or Refused
    • Add optional comments (e.g., "Given with food", "Patient refused")
  4. Click Save

The administration record is saved but ward stock is not yet reduced. Stock is deducted later, in bulk, using the Deduct Administered Medicines from Ward Stock page (Stage 2).

Administration History

Past administration records for each prescription are shown below the active medication list. Each record shows the batch used, quantity, status, timestamp, and the staff member who recorded it.

Retiring an Administration Record

If an administration was recorded in error, it can be retired (undone) as long as stock has not yet been deducted for it. Click the Retire button next to the record, enter a reason, and confirm.

Important: Once stock has been deducted (Stage 2), the administration record is final and cannot be retired.

For the full two-stage workflow, see Ward Medication Administration and Stock Deduction.


Medicine Timeline

The Medicine Timeline view (inward_ward_medicines_timeline.xhtml) shows all ward medications for the admission on a PrimeFaces Timeline component. Medications are colour-coded:

Colour Status
Green Active (currently prescribed)
Grey Expired (duration elapsed)
Red Omitted (manually stopped)

Each timeline event is selectable to view the full prescription details.


Relationship to Pharmacy Dispensing

Ward medication prescriptions are clinical records โ€” they represent what the doctor has ordered. Pharmacy dispensing (what was actually issued) is tracked separately through the Pharmacy BHT Issue workflow. Both records are visible on the Admission Profile and contribute to the full medication history, but they are managed by different teams (clinical vs pharmacy). The Request Selected from Pharmacy action turns a clinical order into a pharmacy request.


Related Articles