Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-management into O3-2490
  • Loading branch information
ayush-AI committed Oct 11, 2023
2 parents 1652912 + 863ca3c commit 2df45f4
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "5.0.0",
"version": "5.1.0",
"command": {
"publish": {
"verifyAccess": false
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-active-visits-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-active-visits-app",
"version": "5.0.0",
"version": "5.1.0",
"description": "Active visits widget microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-active-visits-app.js",
"main": "src/index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { render, screen, act } from '@testing-library/react';
import VisitDetailComponent from './visit-detail.component';
import { useVisit } from './visit.resource';
import { formatDate } from '@openmrs/esm-framework';

jest.mock('./visit.resource');

Expand All @@ -23,11 +24,12 @@ describe('VisitDetailComponent', () => {
});

it('should render visit details and switches when data is available', () => {
let visitDate = new Date();
mockedUseVisit.mockReturnValueOnce({
visit: {
uuid: visitUuid,
visitType: { display: 'Some Visit Type' },
startDatetime: '2023-07-29T12:34:56Z',
startDatetime: visitDate,
encounters: [],
},
isLoading: false,
Expand All @@ -36,7 +38,7 @@ describe('VisitDetailComponent', () => {
render(<VisitDetailComponent visitUuid={visitUuid} patientUuid={patientUuid} />);

expect(screen.getByText(/Some Visit Type/)).toBeInTheDocument();
expect(screen.getByText(/29-Jul-2023, 12:34 PM/)).toBeInTheDocument();
expect(screen.getByText(formatDate(visitDate))).toBeInTheDocument();

expect(screen.getByText('All Encounters')).toBeInTheDocument();
expect(screen.getByText('Visit Summary')).toBeInTheDocument();
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-appointments-app",
"version": "5.0.0",
"version": "5.1.0",
"description": "Appointments front-end module for the OpenMRS SPA",
"browser": "dist/openmrs-esm-appointments-app.js",
"main": "src/index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const AppointmentDetails: React.FC<AppointmentDetailsProps> = ({ appointment })
<span className={styles.historyGridCount}>{appointmentsCount.cancelledAppointments}</span>
</div>
<div>
<p className={styles.historyGridLabel}>{t('upcomming', 'Upcoming')}</p>
<p className={styles.historyGridLabel}>{t('upcoming', 'Upcoming')}</p>
<span className={styles.historyGridCount}>{appointmentsCount.upcomingAppointments}</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function saveQueueEntry(
patient: {
uuid: patientUuid,
},
startedAt: toDateObjectStrict(toOmrsIsoString(new Date())),
startedAt: new Date(),
sortWeight: sortWeight,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ const VisitForm: React.FC<VisitFormProps> = ({ patientUuid, appointment }) => {

const payload: NewVisitPayload = {
patient: patientUuid,
startDatetime: toDateObjectStrict(
toOmrsIsoString(
new Date(dayjs(visitDate).year(), dayjs(visitDate).month(), dayjs(visitDate).date(), hours, minutes),
),
startDatetime: new Date(
dayjs(visitDate).year(),
dayjs(visitDate).month(),
dayjs(visitDate).date(),
hours,
minutes,
),
visitType: visitType,
location: selectedLocation,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/translations/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"unscheduled": "Unscheduled",
"unscheduledAppointments": "Unscheduled appointments",
"unscheduledAppointments_lower": "unscheduled appointments",
"upcomming": "Upcoming",
"upcoming": "Upcoming",
"view": "View",
"viewCalendar": "View Calendar",
"visitLocation": "Visit Location",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"unscheduled": "Unscheduled",
"unscheduledAppointments": "Unscheduled appointments",
"unscheduledAppointments_lower": "unscheduled appointments",
"upcomming": "Upcoming",
"upcoming": "Upcoming",
"view": "View",
"viewCalendar": "View Calendar",
"visitLocation": "Visit Location",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"unscheduled": "Unscheduled",
"unscheduledAppointments": "Unscheduled appointments",
"unscheduledAppointments_lower": "unscheduled appointments",
"upcomming": "Upcoming",
"upcoming": "Upcoming",
"view": "View",
"viewCalendar": "View Calendar",
"visitLocation": "Visit Location",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/translations/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"unscheduled": "Unscheduled",
"unscheduledAppointments": "Unscheduled appointments",
"unscheduledAppointments_lower": "unscheduled appointments",
"upcomming": "Upcoming",
"upcoming": "Upcoming",
"view": "הצג",
"viewCalendar": "הצג לוח שנה",
"visitLocation": "מיקום הביקור",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/translations/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"unscheduled": "មិនបានគ្រោងទុក",
"unscheduledAppointments": "ការណាត់ជួបដែលមិនបានគ្រោងទុក",
"unscheduledAppointments_lower": "unscheduled appointments",
"upcomming": "Upcoming",
"upcoming": "Upcoming",
"view": "ពិនិត្យមើល",
"viewCalendar": "ពិនិត្យមើលប្រតិទិន",
"visitLocation": "ទីតាំងមកពិនិត្យ",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-list-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-list-app",
"version": "5.0.0",
"version": "5.1.0",
"description": "Patient list microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-list-app.js",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-registration-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-registration-app",
"version": "5.0.0",
"version": "5.1.0",
"description": "Patient registration microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-registration-app.js",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-search-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-search-app",
"version": "5.0.0",
"version": "5.1.0",
"description": "Patient search microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-search-app.js",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-service-queues-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-service-queues-app",
"version": "5.0.0",
"version": "5.1.0",
"description": "Outpatient front-end module for the OpenMRS SPA",
"browser": "dist/openmrs-esm-service-queues-app.js",
"main": "src/index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export async function updateQueueEntry(
patient: {
uuid: patientUuid,
},
startedAt: toDateObjectStrict(toOmrsIsoString(new Date())),
startedAt: new Date(),
sortWeight: sortWeight,
queueComingFrom: previousQueueUuid,
},
Expand Down Expand Up @@ -396,7 +396,7 @@ export async function addQueueEntry(
patient: {
uuid: patientUuid,
},
startedAt: toDateObjectStrict(toOmrsIsoString(new Date())),
startedAt: new Date(),
sortWeight: sortWeight,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModa
const queuePriority = priority === '' ? defaultPriority : priority;
const emergencyPriorityConceptUuid = config.concepts.emergencyPriorityConceptUuid;
const sortWeight = priority === emergencyPriorityConceptUuid ? 1.0 : 0.0;
const endDate = toDateObjectStrict(toOmrsIsoString(new Date()));
const endDate = new Date();
updateQueueEntry(
queueEntry?.visitUuid,
queueEntry?.queueUuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function batchClearQueueEntries(queueEntries: Array<MappedVisitQueu
while (curReq < queueEntries.length) {
const end = queueEntries.length < curReq + batchSize ? queueEntries.length : curReq + batchSize;
const concurrentReq = new Array(batchSize);
const endedAt = toDateObjectStrict(toOmrsIsoString(new Date()));
const endedAt = new Date();
for (let index = curReq; index < end; index++) {
await Promise.all([
endPatientStatus(queueEntries[index]?.queueUuid, queueEntries[index]?.queueEntryUuid, endedAt),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function addQueueEntry(
patient: {
uuid: patientUuid,
},
startedAt: toDateObjectStrict(toOmrsIsoString(new Date())),
startedAt: new Date(),
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const RemoveQueueEntryDialog: React.FC<RemoveQueueEntryDialogProps> = ({ queueEn
stopDatetime: new Date(),
};

const endedAt = toDateObjectStrict(toOmrsIsoString(new Date()));
const endedAt = new Date();

voidQueueEntry(
queueEntry.queueUuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const TransitionQueueEntryModal: React.FC<TransitionQueueEntryModalProps> = ({ q
const { mutate } = useVisitQueueEntries('', '');

const launchEditPriorityModal = useCallback(() => {
const endedAt = toDateObjectStrict(toOmrsIsoString(new Date()));
const endedAt = new Date();
updateQueueEntry(
queueEntry?.visitUuid,
queueEntry?.queueUuid,
Expand Down

0 comments on commit 2df45f4

Please sign in to comment.