Skip to content
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

(fix) : fix failing iit evaluation date time and update clock in translation #544

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}}`, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

never used this syntax for translations before. Great catch.

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
Loading