Skip to content

Commit

Permalink
(fix) : fix failing iit evaluation date time and update clock in tran…
Browse files Browse the repository at this point in the history
…slation (#544)

* (fix) : ensure IIT evaluation date is correctly parsed

* (fix) : translation on clock in keys
  • Loading branch information
donaldkibet authored Jan 13, 2025
1 parent c53caa6 commit 423bcaa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export const ClockOutStrip = () => {
<div className={styles.clockOutInfo}>
<Alarm />
<p className={styles.clockInTime}>
{t('clockInTime', `Clocked in on ${dayjs(globalActiveSheet.clockIn).format('D MMM YYYY, HH:mm A')}`)}
{t('clockInTime', `Clocked in on {{clockInDateTime}}`, {
clockInDateTime: dayjs(globalActiveSheet.clockIn).format('D MMM YYYY, HH:mm A'),
})}
</p>
<span className={styles.middot}>&middot;</span>
<p className={styles.cashPointName}>{globalActiveSheet.cashPoint.name}</p>
Expand Down
13 changes: 1 addition & 12 deletions packages/esm-billing-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"allPaymentModes": "All Payment Modes",
"amount": "Amount",
"anErrorOccurred": "An Error Occurred",
"anErrorOccurredClockingIn": "",
"anErrorOccurredClockingOut": "An error occurred clocking out",
"anErrorOccurredCreatingPaymentPoint": "An error occurred creating payment point",
"approvedTotal": "Approved Total",
"attributeDescription": "Attribute description",
Expand Down Expand Up @@ -72,10 +70,7 @@
"claimSummary": "Claim Summary",
"clear": "Clear",
"clearSearch": "Clear search input",
"clockIn": "Clock In",
"clockingIn": "Clocking in",
"clockingOut": "Clocking Out",
"clockOut": "Clock Out",
"clockInTime": "Clocked in on {{clockInDateTime}}",
"close": "Close",
"create": "Create",
"createClaimError": "Create Claim error",
Expand Down Expand Up @@ -210,15 +205,13 @@
"paymentModes": "Payment Modes",
"paymentModeSummary": "Payment Mode Summary",
"paymentPayment": "Bill Payment",
"paymentPoint": "Payment point",
"paymentPoints": "Payment Points",
"payments": "Payments",
"paymentType": "Payment Type",
"pendingHIEVerification": "Pending HIE verification",
"pendingVerificationReason": "",
"Phone Number": "Phone Number",
"pickLabRequest": "Pick Lab Request",
"pleaseSelectPaymentPoint": "Please select a payment point",
"policyNumber": "Policy number",
"preAuthJustification": "Pre-Auth Justification",
"preauthRequest": "Preauth requests",
Expand Down Expand Up @@ -275,8 +268,6 @@
"selectitemstorequestforpreauth": "Select items that are to be included in the pre authorization request",
"selectPaymentMethod": "Select payment method",
"selectPaymentMode": "Select payment mode",
"selectPaymentPoint": "Select payment point",
"selectPaymentPointMessage": "Select the payment point on which you will be clocked in.",
"selectTimesheet": "Select timesheet",
"sendClaim": "Pre authorization request sent successfully",
"sendClaimError": "Pre authorization request failed, please try later",
Expand All @@ -292,8 +283,6 @@
"stockItem": "Stock Item",
"stockItemError": "Stock Item",
"success": "Success",
"successfullyClockedIn": "",
"successfullyClockedOut": "Successfully Clocked Out",
"successfullyCreatedPaymentPoint": "Successfully created payment point",
"timesheet": "Timesheet",
"total": "Total",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import usePatientIITScore from '../hooks/usePatientIITScore';
import styles from './iit-risk-score.scss';
import dayjs from 'dayjs';

interface CarePanellIITRiskScoreProps {
patientUuid: string;
Expand Down Expand Up @@ -40,6 +41,10 @@ const CarePanellIITRiskScore: React.FC<CarePanellIITRiskScoreProps> = ({ patient
);
}

const evaluationDate = dayjs(riskScore?.evaluationDate).isValid()
? formatDate(parseDate(riskScore.evaluationDate))
: '--';

if (error) {
return <ErrorState error={error} headerTitle={t('iitRiscScore', 'IIT Risk Score')} />;
}
Expand All @@ -53,7 +58,7 @@ const CarePanellIITRiskScore: React.FC<CarePanellIITRiskScoreProps> = ({ patient
</Column>
<Column lg={4} md={4} sm={4} className={styles.riskScoreCardItem}>
<strong>{t('evaluationDate', 'Evaluation Date')}:</strong>
<p>{formatDate(parseDate(riskScore?.evaluationDate))}</p>
<p>{evaluationDate}</p>
</Column>
</Row>
<Row style={{ display: 'flex' }}>
Expand Down

0 comments on commit 423bcaa

Please sign in to comment.