Skip to content

Commit

Permalink
MHV-65010: Synced dispensed date for web and print view (#33673)
Browse files Browse the repository at this point in the history
* MHV-65010: Synced dispensed date for web and print view

* synced "shipped on" date

* missed null check in txt config
  • Loading branch information
vmenshutin-bylight authored Dec 24, 2024
1 parent dd4e28f commit 62bb22d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import VaPharmacyText from '../shared/VaPharmacyText';
const PrescriptionPrintOnly = props => {
const { rx, hideLineBreak, refillHistory, isDetailsRx } = props;
const pharmacyPhone = pharmacyPhoneNumber(rx);
const latestTrackingStatus = rx?.trackingList?.[0];

const activeNonVaContent = pres => (
<div className="print-only-rx-details-container vads-u-margin-top--1p5">
Expand Down Expand Up @@ -87,7 +88,7 @@ const PrescriptionPrintOnly = props => {
<div className="print-only-rx-details-container">
<p>
<strong>Last filled on:</strong>{' '}
{dateFormat(rx.dispensedDate, 'MMMM D, YYYY')}
{dateFormat(rx.sortedDispensedDate, 'MMMM D, YYYY')}
</p>
<p>
<strong>Status:</strong>{' '}
Expand Down Expand Up @@ -192,9 +193,7 @@ const PrescriptionPrintOnly = props => {
</p>
<p>
<strong>Shipped on:</strong>{' '}
{entry?.trackingList?.[0]?.completeDateTime
? dateFormat(entry.trackingList[0].completeDateTime)
: EMPTY_FIELD}
{dateFormat(latestTrackingStatus?.completeDateTime)}
</p>
<p className="vads-u-margin--0">
<strong>Medication description: </strong>
Expand Down
8 changes: 4 additions & 4 deletions src/applications/mhv-medications/util/pdfConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const buildPrescriptionsPDFList = prescriptions => {
items: [
{
title: 'Last filled on',
value: dateFormat(rx.dispensedDate, 'MMMM D, YYYY'),
value: dateFormat(rx.sortedDispensedDate, 'MMMM D, YYYY'),
inline: true,
},
{
Expand Down Expand Up @@ -497,9 +497,9 @@ ${backImprint ? `* Back marking: ${backImprint}` : ''}`
},
{
title: `Shipped on`,
value: entry?.trackingList?.[0]?.completeDateTime
? dateFormat(entry.trackingList[0].completeDateTime)
: 'None noted',
value: dateFormat(
prescription?.trackingList?.[0]?.completeDateTime,
),
inline: true,
},
];
Expand Down
8 changes: 2 additions & 6 deletions src/applications/mhv-medications/util/txtConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const buildPrescriptionsTXT = prescriptions => {
result += `
${rx.prescriptionName}
Last filled on: ${dateFormat(rx.dispensedDate, 'MMMM D, YYYY')}
Last filled on: ${dateFormat(rx.sortedDispensedDate, 'MMMM D, YYYY')}
Status: ${validateField(rx.dispStatus)}
${(pdfStatusDefinitions[rx.refillStatus] || pdfDefaultStatusDefinition).reduce(
Expand Down Expand Up @@ -256,11 +256,7 @@ Filled by pharmacy on: ${
entry?.dispensedDate ? dateFormat(entry.dispensedDate) : 'None noted'
}
Shipped on: ${
entry?.trackingList?.[0]?.completeDateTime
? dateFormat(entry.trackingList[0].completeDateTime)
: 'None noted'
}
Shipped on: ${dateFormat(prescription?.trackingList?.[0]?.completeDateTime)}
Description: ${description}
Expand Down

0 comments on commit 62bb22d

Please sign in to comment.