Skip to content

Commit

Permalink
Merge branch 'main' into chore/update-transifex
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Jun 12, 2024
2 parents f9a9772 + cb9ad24 commit c7761e4
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 46 deletions.
2 changes: 1 addition & 1 deletion e2e/specs/vitals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test('Record vital signs', async ({ page }) => {

await test.step('And I should see the newly recorded vital signs on the page', async () => {
await expect(headerRow).toContainText(/temp/i);
await expect(headerRow).toContainText(/blood pressure/i);
await expect(headerRow).toContainText(/bp/i);
await expect(headerRow).toContainText(/pulse/i);
await expect(headerRow).toContainText(/r. rate/i);
await expect(headerRow).toContainText(/SPO2/i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const PastVisitOverview: React.FC<DefaultPatientWorkspaceProps> = ({ patientUuid

const headerData: Array<typeof DataTableHeader> = useMemo(
() => [
{ key: 'startDate', header: t('startDate', 'Start Date') },
{ key: 'startDate', header: t('startDate', 'Start date') },
{ key: 'visitType', header: t('type', 'Type') },
{ key: 'location', header: t('location', 'Location') },
{ key: 'endDate', header: t('endDate_title', 'End Date'), colSpan: 2 },
{ key: 'endDate', header: t('endDate_title', 'End date'), colSpan: 2 },
],
[t],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DeleteVisitActionItem: React.FC<DeleteVisitActionItemProps> = ({ patientUu
renderIcon={TrashCan}
size={isTablet ? 'lg' : 'sm'}
>
{isActiveVisit ? t('cancelVisit', 'Cancel visit') : t('deleteVisit', 'Delete')}
{isActiveVisit ? t('cancelVisit', 'Cancel visit') : t('deleteVisit', 'Delete visit')}
</Button>
</UserHasAccess>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ const StartVisitForm: React.FC<StartVisitFormProps> = ({
showSnackbar({
isLowContrast: true,
kind: 'success',
subtitle: t('visitStartedSuccessfully', '{visit} started successfully', {
subtitle: t('visitStartedSuccessfully', '{{visit}} started successfully', {
visit: t('offlineVisit', 'Offline Visit'),
}),
title: t('visitStarted', 'Visit started'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const CurrentVisitSummary: React.FC<CurrentVisitSummaryProps> = ({ patientUuid }
if (!currentVisit) {
return (
<EmptyState
headerTitle={t('currentVisit', 'currentVisit')}
headerTitle={t('currentVisit', 'Current visit')}
displayText={t('noActiveVisitMessage', 'active visit')}
launchForm={() => launchPatientWorkspace('start-visit-workspace-form')}
/>
Expand All @@ -40,7 +40,7 @@ const CurrentVisitSummary: React.FC<CurrentVisitSummaryProps> = ({ patientUuid }

return (
<div className={styles.container}>
<CardHeader title={t('currentVisit', 'Current Visit')}>
<CardHeader title={t('currentVisit', 'Current visit')}>
<span>{isValidating ? <InlineLoading /> : null}</span>
</CardHeader>
<div className={styles.visitSummaryCard}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { useVisit, getConfig } from '@openmrs/esm-framework';
import { waitForLoadingToFinish } from 'tools';
import CurrentVisitSummary from './current-visit-summary.component';

const mockUseVisits = useVisit as jest.Mock;
Expand All @@ -17,19 +18,7 @@ describe('CurrentVisitSummary', () => {
jest.clearAllMocks();
});

test('should display loading state', () => {
mockUseVisits.mockReturnValueOnce({
currentVisit: null,
isLoading: true,
isValidating: false,
error: null,
});

render(<CurrentVisitSummary patientUuid="some-uuid" />);
expect(screen.getByText('Loading current visit...')).toBeInTheDocument();
});

test('should display empty state when there is no active visit', () => {
test('renders an empty state when there is no active visit', () => {
mockUseVisits.mockReturnValueOnce({
currentVisit: null,
isLoading: false,
Expand All @@ -38,11 +27,11 @@ describe('CurrentVisitSummary', () => {
});

render(<CurrentVisitSummary patientUuid="some-uuid" />);
expect(screen.getByText('currentVisit')).toBeInTheDocument();
expect(screen.getByText(/current visit/i)).toBeInTheDocument();
expect(screen.getByText('There are no active visit to display for this patient')).toBeInTheDocument();
});

test("should display visit summary when there's an active visit", async () => {
test('renders a visit summary when for the active visit', async () => {
mockGetConfig.mockResolvedValue({ htmlFormEntryForms: [] });
mockUseVisits.mockReturnValueOnce({
currentVisit: {
Expand All @@ -67,7 +56,9 @@ describe('CurrentVisitSummary', () => {

render(<CurrentVisitSummary patientUuid="some-uuid" />);

await screen.findByText('Current Visit');
await waitForLoadingToFinish();

expect(screen.getByText(/current visit/i)).toBeInTheDocument();
expect(screen.getByText('Diagnoses')).toBeInTheDocument();
const buttonNames = ['Notes', 'Tests', 'Medications', 'Encounters'];
buttonNames.forEach((buttonName) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,13 @@ const EncountersTableLifecycle = ({ patientUuid }) => {
}

if (error) {
return <ErrorState headerTitle={t('encounters', 'encounters')} error={error} />;
return <ErrorState headerTitle={t('encounters', 'Encounters')} error={error} />;
}

if (!encounters?.length) {
return <EmptyState headerTitle={t('encounters', 'encounters')} displayText={t('encounters', 'Encounters')} />;
return (
<EmptyState headerTitle={t('encounters', 'Encounters')} displayText={t('encounters__lower', 'encounters')} />
);
}

return <EncountersTable encounters={encounters} showAllEncounters />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const MedicationSummary: React.FC<MedicationSummaryProps> = ({ medications }) =>
</div>
) : (
<EmptyState
displayText={t('medications', 'medications')}
displayText={t('medications__lower', 'medications')}
headerTitle={t('medications', 'Medications')}
></EmptyState>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NotesSummary: React.FC<NotesSummaryProps> = ({ notes }) => {
</div>
))
) : (
<EmptyState displayText={t('notes', 'notes')} headerTitle="Notes"></EmptyState>
<EmptyState displayText={t('notes__lower', 'notes')} headerTitle={t('notes', 'Notes')} />
)}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ const VisitTable: React.FC<VisitTableProps> = ({ showAllEncounters, visits, pati

// All encounters tab in visits
if (!visits?.length) {
return <EmptyState headerTitle={t('encounters', 'encounters')} displayText={t('encounters', 'Encounters')} />;
return (
<EmptyState headerTitle={t('encounters', 'Encounters')} displayText={t('encounters__lower', 'encounters')} />
);
}

return (
Expand Down
3 changes: 3 additions & 0 deletions packages/esm-patient-chart-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"emptyStateText": "There are no {{displayText}} to display for this patient",
"encounterDeleted": "Encounter deleted",
"encounters": "Encounters",
"encounters__lower": "encounters",
"encounters_title": "Encounters",
"encounterType": "Encounter type",
"end": "End",
Expand Down Expand Up @@ -84,6 +85,7 @@
"markDeceased": "Mark deceased",
"markingPatientDeceasedInfoText": "Marking the patient as deceased will end any active visits for this patient",
"medications": "Medications",
"medications__lower": "medications",
"missingVisitType": "Missing visit type",
"modifyVisitDate": "Modify visit date",
"movePatient": "Move patient",
Expand All @@ -99,6 +101,7 @@
"noEncountersToDisplay": "No encounters to display",
"noObservationsFound": "No observations found",
"notes": "Notes",
"notes__lower": "notes",
"optional": "optional",
"orderDurationAndUnit": "for {{duration}} {{durationUnit}}",
"orderIndefiniteDuration": "Indefinite duration",
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-patient-forms-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function startupApp() {
subscribePrecacheStaticDependencies(() => syncAllDynamicOfflineData('form'));
}

// t('clinicalForm', 'Clinical Form')
// t('clinicalForm', 'Clinical form')
export const patientFormEntryWorkspace = getAsyncLifecycle(() => import('./forms/form-entry.workspace'), options);

// t('clinicalForms', 'Clinical Forms')
// t('clinicalForms', 'Clinical forms')
export const clinicalFormsWorkspace = getAsyncLifecycle(() => import('./forms/forms-dashboard.workspace'), options);

export const clinicalFormActionMenu = getSyncLifecycle(clinicalFormActionMenuComponent, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const DoseInput: React.FC<{
) : (
<NumberInput
id="doseNumber"
label={t('doseNumber', 'Dose number within series')}
label={t('doseNumberWithinSeries', 'Dose number within series')}
min={0}
onChange={(event) => field.onChange(parseInt(event.target.value || 0))}
value={field.value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const SequenceTable: React.FC<SequenceTableProps> = ({ immunizationsByVaccine, l

const tableHeader = useMemo(
() => [
{ key: 'sequence', header: sequences.length ? t('sequence', 'Sequence') : t('doseNumber', 'Dose Number') },
{ key: 'vaccinationDate', header: t('vaccinationDate', 'Vaccination Date') },
{ key: 'expirationDate', header: t('expirationDate', 'Expiration Date') },
{ key: 'sequence', header: sequences.length ? t('sequence', 'Sequence') : t('doseNumber', 'Dose number') },
{ key: 'vaccinationDate', header: t('vaccinationDate', 'Vaccination date') },
{ key: 'expirationDate', header: t('expirationDate', 'Expiration date') },
{ key: 'edit', header: '' },
],
[t, sequences.length],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ImmunizationsDetailedSummary: React.FC<ImmunizationsDetailedSummaryProps>
}) => {
const { t, i18n } = useTranslation();
const { immunizationsConfig } = useConfig();
const displayText = t('immunizations', 'immunizations');
const displayText = t('immunizations__lower', 'immunizations');
const headerTitle = t('immunizations', 'Immunizations');
const locale = i18n.language.replace('_', '-');
const pageUrl = window.getOpenmrsSpaBase() + `patient/${patientUuid}/chart`;
Expand Down Expand Up @@ -73,7 +73,7 @@ const ImmunizationsDetailedSummary: React.FC<ImmunizationsDetailedSummaryProps>
const tableHeader = useMemo(
() => [
{ key: 'vaccine', header: t('vaccine', 'Vaccine') },
{ key: 'recentVaccination', header: t('recentVaccination', 'Recent Vaccination') },
{ key: 'recentVaccination', header: t('recentVaccination', 'Recent vaccination') },
{ key: 'add', header: '' },
],
[t],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const ImmunizationsForm: React.FC<DefaultPatientWorkspaceProps> = ({
<DatePickerInput
id="vaccinationDateInput"
placeholder="dd/mm/yyyy"
labelText={t('vaccinationDate', 'Vaccination Date')}
labelText={t('vaccinationDate', 'Vaccination date')}
type="text"
invalid={!!errors['vaccinationDate']}
invalidText={errors['vaccinationDate']?.message}
Expand Down Expand Up @@ -396,7 +396,7 @@ const ImmunizationsForm: React.FC<DefaultPatientWorkspaceProps> = ({
<DatePickerInput
id="date-picker-calendar-id"
placeholder="dd/mm/yyyy"
labelText={t('expirationDate', 'Expiration Date')}
labelText={t('expirationDate', 'Expiration date')}
type="text"
/>
</DatePicker>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface ImmunizationsOverviewProps {
const ImmunizationsOverview: React.FC<ImmunizationsOverviewProps> = ({ patient, patientUuid, basePath }) => {
const { t } = useTranslation();
const immunizationsCount = 5;
const displayText = t('immunizations', 'immunizations');
const displayText = t('immunizations__lower', 'immunizations');
const headerTitle = t('immunizations', 'Immunizations');
const urlLabel = t('seeAll', 'See all');
const pageUrl = window.spaBase + basePath + '/immunizations';
Expand Down
2 changes: 2 additions & 0 deletions packages/esm-patient-immunizations-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"add": "Add",
"cancel": "Cancel",
"doseNumber": "Dose number within series",
"doseNumberWithinSeries": "Dose number within series",
"edit": "Edit",
"error": "Error",
"errorSaving": "Error saving vaccination",
Expand All @@ -10,6 +11,7 @@
"immunization": "Immunization",
"immunizations": "Immunizations",
"Immunizations": "Immunizations",
"immunizations__lower": "immunizations",
"immunizationWorkspaceTitle": "Immunization Form",
"lotNumber": "Lot Number",
"manufacturer": "Manufacturer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const PatientListDetailsTable: React.FC<PatientListDetailsTableProps> = ({ listM
},
{
key: 'startDate',
header: t('startDate', 'Start Date'),
header: t('startDate', 'Start date'),
},
],
[t],
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-medications-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const drugOrderPanel = getAsyncLifecycle(
);

export const medicationsDashboardLink =
// t('Medications', 'Medications')
// t('medications', 'Medications')
getSyncLifecycle(
createDashboardLink({
...dashboardMeta,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-medications-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"male": "Male",
"medicationDurationAndUnit": "for {{duration}} {{durationUnit}}",
"medicationIndefiniteDuration": "Indefinite duration",
"Medications": "Medications",
"medications": "Medications",
"modify": "Modify",
"none": "None",
"noResultsForDrugSearch": "No results to display for \"{{searchTerm}}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,18 @@ const VitalsOverview: React.FC<VitalsOverviewProps> = ({ patientUuid, pageSize,
},
{
key: 'temperatureRender',
header: withUnit(t('temperature', 'Temp'), conceptUnits.get(config.concepts.temperatureUuid) ?? ''),
header: withUnit(t('temperatureAbbreviated', 'Temp'), conceptUnits.get(config.concepts.temperatureUuid) ?? ''),
isSortable: true,

sortFunc: (valueA, valueB) =>
valueA.temperature && valueB.temperature ? valueA.temperature - valueB.temperature : 0,
},
{
key: 'bloodPressureRender',
header: withUnit(t('bloodPressure', 'BP'), conceptUnits.get(config.concepts.systolicBloodPressureUuid) ?? ''),
header: withUnit(
t('bloodPressureAbbreviated', 'BP'),
conceptUnits.get(config.concepts.systolicBloodPressureUuid) ?? '',
),
isSortable: true,

sortFunc: (valueA, valueB) =>
Expand All @@ -107,15 +110,18 @@ const VitalsOverview: React.FC<VitalsOverviewProps> = ({ patientUuid, pageSize,
},
{
key: 'respiratoryRateRender',
header: withUnit(t('respiratoryRate', 'R. Rate'), conceptUnits.get(config.concepts.respiratoryRateUuid) ?? ''),
header: withUnit(
t('respiratoryRateAbbreviated', 'R. Rate'),
conceptUnits.get(config.concepts.respiratoryRateUuid) ?? '',
),
isSortable: true,

sortFunc: (valueA, valueB) =>
valueA.respiratoryRate && valueB.respiratoryRate ? valueA.respiratoryRate - valueB.respiratoryRate : 0,
},
{
key: 'spo2Render',
header: withUnit(t('spo2', 'SPO2'), conceptUnits.get(config.concepts.oxygenSaturationUuid) ?? ''),
header: withUnit(t('spo2', 'SpO2'), conceptUnits.get(config.concepts.oxygenSaturationUuid) ?? ''),
isSortable: true,

sortFunc: (valueA, valueB) => (valueA.spo2 && valueB.spo2 ? valueA.spo2 - valueB.spo2 : 0),
Expand Down
2 changes: 2 additions & 0 deletions packages/esm-patient-vitals-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"biometrics": "Biometrics",
"biometrics_lower": "biometrics",
"bloodPressure": "Blood Pressure",
"bloodPressureAbbreviated": "BP",
"bmi": "BMI",
"bp": "BP",
"calculatedBmi": "BMI (calc.)",
Expand Down Expand Up @@ -36,6 +37,7 @@
"recordVitalsAndBiometrics": "Record Vitals and Biometrics",
"respirationRate": "Respiration rate",
"respiratoryRate": "R. rate",
"respiratoryRateAbbreviated": "R. Rate",
"saveAndClose": "Save and close",
"seeAll": "See all",
"spo2": "SpO2",
Expand Down

0 comments on commit c7761e4

Please sign in to comment.