-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) O3-4064: Print patient information with modified configuration #2022
Conversation
Size Change: -214 kB (-1.42%) Total Size: 14.8 MB
ℹ️ View Unchanged
|
okay @vasharma05 I think I cleaned up my mess... :) The main build is passing now, and I did a follow up commit on this PR fixing the lock file... the tests are running now, fingers crossed, but I will keep an eye on it. |
Thanks a lot @mogoodrich!! Really grateful for the same! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @vasharma05. All look good except MSF is interested in the Print Feature being enabled as a Feature flag.
I don't think we're yet at a point where the print feature is ready to be automatically enabled. We can maybe discuss a way to make it possible to enable it via configuration, but it's still, IMO, fairly fragile and not yet ready for prime time. |
@ibacher what do you mean by "fairly fragile"? Is the code not well-written/tested/stable. |
return printPatientSticker?.header?.logo ? ( | ||
<img alt="implementation-logo" src={printPatientSticker?.header?.logo} /> | ||
) : ( | ||
<svg data-testid="openmrs-logo" role="img" viewBox="0 0 380 119" xmlns="http://www.w3.org/2000/svg"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this with an SVG sprite using #omrs-logo-full-mono
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with the above sprite, but it's not rendering in the iframe created by the library when printing the sticker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a TODO comment in the logic as a reminder to look into why this isn't working.
@rbuisson What I really mean is that this is something like the third re-write of how we configure this component and it isn't clear to me that we are following any requirements gathered from anywhere (this PR, for example, must have a ticket). It's not that I don't trust the code, it's that I don't think what this feature is doing is well-defined enough yet. (Is A4 the right size? Does this support wrist bands? Does this support printing to index-card sizes? Should we be including in the printed space itself data on when it was printed, by whom, and where? Do we need to support multiple configurations of different type of identity cards?) |
packages/esm-patient-banner-app/src/print-identifier-sticker/patient-detail.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-banner-app/src/print-identifier-sticker/patient-detail.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-banner-app/src/print-identifier-sticker/print-identifier-sticker.modal.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-banner-app/src/print-identifier-sticker/print-identifier-sticker.modal.tsx
Show resolved
Hide resolved
}, | ||
header: { | ||
_type: Type.Object, | ||
_description: 'The header to display on the patient sticker', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_description: 'The header to display on the patient sticker', | |
_description: 'Configuration properties for the patient sticker headerConfiguration properties for the patient sticker header', |
Maybe this works better?
return ( | ||
<div> | ||
<span> | ||
<strong className={styles.strong}>{t('patientNameWithSeparator', 'Patient name:')}</strong> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'm not a big fan of including punctuation marks in the translation string. Different languages have varying punctuation rules, and some may not use certain punctuation marks at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, right, that's why I have added them in the translation string, rather than harcoding this. This gives the user the choice of using their own separator and allows formatting properly for RTL.
Thanks!
.../esm-patient-banner-app/src/print-identifier-sticker/print-identifier-sticker-modal.test.tsx
Outdated
Show resolved
Hide resolved
Thank you. Let's see what the feedback and possibly build the case for this first attempt at printing registration card. |
.../esm-patient-banner-app/src/print-identifier-sticker/print-identifier-sticker-modal.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I presume the design will change a fair bit over time as we continue to iterate on the design and the functional requirements. Thanks for working on this, @vasharma05, @usamaidrsk, and thanks for the reviews, @jnsereko, @ibacher.
Requirements
Summary
This PR works on improving the current implementation of printing the Patient Identifier sticker, with the following additions/ modifications to the existing implementation:
Barcode
The identifier sticker can now house a barcode displaying the patient's Primary identifier Value. Displaying the barcode can be changed via the configuration.
Implementation Logo
The implementer can now decide whether to display the implementation logo on the sticker and if opted, they can also decide to override the default OpenMRS logo with their implementation's logo.
Patient details to be displayed
The implementer can now configure which patient details should be displayed on the sticker. The supported information is shown in the configuration point description.
Patient identifiers
The implementer can configure whether to display all the patient identifiers or a few selected identifiers on the sticker.
Page size
The implementer can configure the sticker page size, which can follow standard pages (A4, A3, etc.) or follow this section for better understanding.
Configuration
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-4062
Other