这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@PatrickWaweru
Copy link

@PatrickWaweru PatrickWaweru commented Aug 28, 2025

Requirements

O3-4998 Add functionality to print a drug label during drug dispensing.

This is the label that is normally stuck to the dispensing package or bottle. It might not contain the same details as the prescription. For example: The label is different from the prescription in these areas:

  1. It contains the actual drug dispensed (brand name)
  2. It contains the actual Quantity dispensed
  3. it contains the Date dispensed
  4. It contains the Batch number and expiry date (for traceability)
  5. It contains the Pharmacist’s initials or name
  6. It contains Cautionary labels or auxiliary instructions
    e.g., “May cause drowsiness,” “Keep refrigerated,” “Finish the full course”
  7. It contains the Prescription number / reference
  8. It contains Refill info in case partial dispense was done
  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Add a button to print a drug label during drug dispensing

Screenshots

Drug-Label.webm

Related Issue

Other

@makombe makombe requested review from mogoodrich and mseaton August 28, 2025 08:49
@PatrickWaweru PatrickWaweru changed the title (feat) Add drug dispense label print function (feat) O3-4998 Add drug dispense label print function Aug 28, 2025
@denniskigen denniskigen requested a review from chibongho October 27, 2025 17:08
@chibongho
Copy link
Contributor

Hi @PatrickWaweru, can you give us a brief description of this new feature? How is different from the existing "Print Prescription" functionality?

@PatrickWaweru
Copy link
Author

Hi @PatrickWaweru, can you give us a brief description of this new feature? How is different from the existing "Print Prescription" functionality?

Hi @chibongho This is the label that is normally stuck to the dispensing package or bottle. It might not contain the same details as the prescription. For example: The label is different from the prescription in these areas:

  1. It contains the actual drug dispensed (brand name)
  2. It contains the actual Quantity dispensed
  3. it contains the Date dispensed
  4. It contains the Batch number and expiry date (for traceability)
  5. It contains the Pharmacist’s initials or name
  6. It contains Cautionary labels or auxiliary instructions
    e.g., “May cause drowsiness,” “Keep refrigerated,” “Finish the full course”
  7. It contains the Prescription number / reference
  8. It contains Refill info in case partial dispense was done

@mogoodrich
Copy link
Member

@PatrickWaweru this PR has changes to 96 files... I suspect it's outdated and needs to be updated with the latest dispensing code so we can properly review?

@PatrickWaweru PatrickWaweru force-pushed the addDrugDispensePrintLabelFunction branch from 5ec2566 to e14c73f Compare October 29, 2025 21:42
@PatrickWaweru
Copy link
Author

@PatrickWaweru this PR has changes to 96 files... I suspect it's outdated and needs to be updated with the latest dispensing code so we can properly review?

Hi @mogoodrich This is now fixed

Copy link
Contributor

@chibongho chibongho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we are duplicating a lot of similar code from printing Prescription to get the printing Label to work. We can try to reuse code more. For example, instead of:

<PrescriptionPrintAction encounterUuid={encounterUuid} patientUuid={patientUuid} />
<LabelPrintAction encounterUuid={encounterUuid} />

we can do:

<PrintAction encounterUuid={encounterUuid} patientUuid={patientUuid} printMode="prescription"/>
<PrintAction encounterUuid={encounterUuid} patientUuid={patientUuid} printMode="label"/>

</span>{' '}
&mdash;{' '}
<span className={styles.prescriptionInfo}>
{dosageInstruction?.route?.text} &mdash; {dosageInstruction?.timing?.code?.text}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire string <code> for <duration> <unit> needs to be translated as one string, as we cannot assume that those things will appear in that order in a different language. See this for example on how to add template variables within the translation string.

<span className={styles.faintText}>{t('quantity', 'Quantity')}</span>
{': '}
<span className={styles.prescriptionInfo}>
{quantity.value} {quantity.unit}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. Needs to be a translation

)}
</p>
<p>
<span className={styles.faintText}>{t('datePrescribed', 'Date prescribed')}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ':' needs to be part of the translation string (especially for rtl languages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants