diff --git a/src/applications/mhv-medications/components/PrescriptionDetails/PrescriptionPrintOnly.jsx b/src/applications/mhv-medications/components/PrescriptionDetails/PrescriptionPrintOnly.jsx index ae19a7b98243..40b9143b6832 100644 --- a/src/applications/mhv-medications/components/PrescriptionDetails/PrescriptionPrintOnly.jsx +++ b/src/applications/mhv-medications/components/PrescriptionDetails/PrescriptionPrintOnly.jsx @@ -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 => (
@@ -87,7 +88,7 @@ const PrescriptionPrintOnly = props => {

Last filled on:{' '} - {dateFormat(rx.dispensedDate, 'MMMM D, YYYY')} + {dateFormat(rx.sortedDispensedDate, 'MMMM D, YYYY')}

Status:{' '} @@ -192,9 +193,7 @@ const PrescriptionPrintOnly = props => {

Shipped on:{' '} - {entry?.trackingList?.[0]?.completeDateTime - ? dateFormat(entry.trackingList[0].completeDateTime) - : EMPTY_FIELD} + {dateFormat(latestTrackingStatus?.completeDateTime)}

Medication description: diff --git a/src/applications/mhv-medications/util/pdfConfigs.js b/src/applications/mhv-medications/util/pdfConfigs.js index 0d51c720e3e5..6c2ffd9a59da 100644 --- a/src/applications/mhv-medications/util/pdfConfigs.js +++ b/src/applications/mhv-medications/util/pdfConfigs.js @@ -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, }, { @@ -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, }, ]; diff --git a/src/applications/mhv-medications/util/txtConfigs.js b/src/applications/mhv-medications/util/txtConfigs.js index 922e41dbc0a7..94b08916d552 100644 --- a/src/applications/mhv-medications/util/txtConfigs.js +++ b/src/applications/mhv-medications/util/txtConfigs.js @@ -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( @@ -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}