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

15th pull #38

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a137bd8
(test): Add test for `patient-list-detail.component` (#790)
ayush-AI Aug 27, 2023
96f97e4
feat: Add ability to auto-populate obs from NUPI
donaldkibet Feb 9, 2023
3c15932
(feat) add nascop facility number to use value modal
donaldkibet Jun 20, 2023
5c94537
KHP3-4128 Add patient facility of origin on client registry modal (#808)
CynthiaKamau Sep 7, 2023
458d190
(enhc) further enhancements to patient registration
donaldkibet Mar 5, 2024
624803c
(feat) Add ability to hide and show person attributes field
donaldkibet May 23, 2024
ee5bbfc
Initial commit to fork management for kenyaemr
donaldkibet Jun 19, 2024
35ce45e
(release) kenyaemr-patient-management 7.0.2 (#25)
donaldkibet Jul 1, 2024
e75827c
(fix) Fix error when registrering patient on `dateOfBirth` field (#26)
donaldkibet Jul 1, 2024
d07fd4c
(fix) remove null values from queues query params (#27)
donaldkibet Jul 2, 2024
2924276
(fix) identifier sources (#28)
donaldkibet Jul 2, 2024
21f1580
Patient identifier mapping to fields now working (#29)
munania Jul 8, 2024
76c29d7
Fix queue service filter by location
makombe Jul 15, 2024
97c7943
(fix) O3-3418 service queues fails to re-fetch after delete ops (#1210)
PiusKariuki Jul 1, 2024
fc0d317
(fix) O3-3523: Refetch queue entry data when the search criteria chan…
vasharma05 Jul 4, 2024
15c5e1a
Merge pull request #31 from makombe/queue-fixes-latest
makombe Jul 16, 2024
14afb68
Fix dob date picker increasing selected date by a month
makombe Jul 16, 2024
c729989
(fix):O3-3611-Disable automatic selection of upcoming appointment (#1…
makombe Jul 16, 2024
5da523f
Merge pull request #33 from makombe/upcoming-appointment
makombe Jul 17, 2024
02a966c
Merge pull request #32 from makombe/dob
makombe Jul 17, 2024
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
64 changes: 0 additions & 64 deletions .github/workflows/e2e.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-management",
"version": "7.0.0",
"version": "7.0.2",
"private": true,
"description": "Patient management microfrontend for the OpenMRS 3.x frontend",
"workspaces": [
Expand All @@ -11,7 +11,7 @@
"ci:publish": "yarn workspaces foreach --all --topological --exclude @openmrs/esm-patient-management npm publish --access public --tag latest",
"ci:prepublish": "yarn workspaces foreach --all --topological --exclude @openmrs/esm-patient-management npm publish --access public --tag next",
"release": "yarn workspaces foreach --all --topological version",
"verify": "turbo run lint typescript test --concurrency=1",
"verify": "turbo run lint typescript --concurrency=1",
"test-e2e": "playwright test",
"postinstall": "husky install"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-active-visits-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@openmrs/esm-active-visits-app",
"version": "7.0.0",
"name": "@kenyaemr/esm-active-visits-app",
"version": "7.0.2",
"description": "Active visits widget microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-active-visits-app.js",
"browser": "dist/kenyaemr-esm-active-visits-app.js",
"main": "src/index.ts",
"source": true,
"license": "MPL-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-active-visits-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { configSchema } from './config-schema';
import activeVisitsComponent from './active-visits-widget/active-visits.component';
import visitDetailComponent from './visits-summary/visit-detail.component';

const moduleName = '@openmrs/esm-active-visits-app';
const moduleName = '@kenyaemr/esm-active-visits-app';

const options = {
featureName: 'active-visits',
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-appointments-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@openmrs/esm-appointments-app",
"version": "7.0.0",
"name": "@kenyaemr/esm-appointments-app",
"version": "7.0.2",
"description": "Appointments front-end module for the OpenMRS SPA",
"browser": "dist/openmrs-esm-appointments-app.js",
"browser": "dist/kenyaemr-esm-appointments-app.js",
"main": "src/index.ts",
"source": true,
"license": "MPL-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import AppointmentsTable from './appointments-table.component';
import { configSchema } from '../../config-schema';
import { getByTextWithMarkup } from '../../../../../tools/test-utils';

defineConfigSchema('@openmrs/esm-appointments-app', configSchema);
defineConfigSchema('@kenyaemr/esm-appointments-app', configSchema);

const appointments: Array<Appointment> = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const spaHomePage = ` ${window.getOpenmrsSpaBase()}home`;
export const omrsDateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZZ';
export const appointmentLocationTagName = 'Appointment Location';

export const moduleName = '@openmrs/esm-appointments-app';
export const moduleName = '@kenyaemr/esm-appointments-app';

export const datePickerPlaceHolder = 'dd/mm/yyyy';
export const dateFormat = 'DD/MM/YYYY';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,22 @@ const AppointmentsForm: React.FC<AppointmentsFormProps> = ({
const appointmentPayload = constructAppointmentPayload(data);

// check if Duplicate Response Occurs
const response: FetchResponse = await checkAppointmentConflict(appointmentPayload);
let errorMessage = t('appointmentConflict', 'Appointment conflict');
if (response?.data?.hasOwnProperty('SERVICE_UNAVAILABLE')) {
errorMessage = t('serviceUnavailable', 'Appointment time is outside of service hours');
} else if (response?.data?.hasOwnProperty('PATIENT_DOUBLE_BOOKING')) {
errorMessage = t('patientDoubleBooking', 'Patient already booked for an appointment at this time');
}
if (response.status === 200) {
setIsSubmitting(false);
showSnackbar({
isLowContrast: true,
kind: 'error',
title: errorMessage,
});
return;
}
// const response: FetchResponse = await checkAppointmentConflict(appointmentPayload);
// let errorMessage = t('appointmentConflict', 'Appointment conflict');
// if (response?.data?.hasOwnProperty('SERVICE_UNAVAILABLE')) {
// errorMessage = t('serviceUnavailable', 'Appointment time is outside of service hours');
// } else if (response?.data?.hasOwnProperty('PATIENT_DOUBLE_BOOKING')) {
// errorMessage = t('patientDoubleBooking', 'Patient already booked for an appointment at this time');
// }
// if (response.status === 200) {
// setIsSubmitting(false);
// showSnackbar({
// isLowContrast: true,
// kind: 'error',
// title: errorMessage,
// });
// return;
// }

// Construct recurring pattern payload
const recurringAppointmentPayload = {
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import appointementsForm from './form/appointments-form.component';
import patientSearch from './patient-search/patient-search.component';
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');

const moduleName = '@openmrs/esm-appointments-app';
const moduleName = '@kenyaemr/esm-appointments-app';

const options = {
featureName: 'appointments',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ const PatientUpcomingAppointmentsCard: React.FC<PatientUpcomingAppointmentsProps
.concat(futureAppointments)
.filter((appointment) => appointment.status !== 'CheckedIn');

useEffect(() => {
if (appointments.length === 1) {
setSelectedAppointment(appointments[0]);
setUpcomingAppointment(appointments[0]);
}
}, [appointments]);

const handleRadioChange = (appointment: Appointment) => {
setSelectedAppointment(appointment);
setUpcomingAppointment(appointment);
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-patient-list-management-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@openmrs/esm-patient-list-management-app",
"version": "7.0.0",
"name": "@kenyaemr/esm-patient-list-management-app",
"version": "7.0.2",
"description": "Microfrontend for managing patient lists in O3",
"browser": "dist/openmrs-esm-patient-list-management-app.js",
"browser": "dist/kenyaemr-esm-patient-list-management-app.js",
"main": "src/index.ts",
"source": true,
"license": "MPL-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-list-management-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import rootComponent from './root.component';
import listDetailsTableComponent from './list-details-table/list-details-table.component';
import addPatientToPatientListMenuItemComponent from './add-patient-to-patient-list-menu-item.component';

const moduleName = '@openmrs/esm-patient-list-management-app';
const moduleName = '@kenyaemr/esm-patient-list-management-app';

const options = {
featureName: 'patient list',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import React from 'react';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { usePatientListDetails, usePatientListMembers } from '../api/hooks';
import { showToast } from '@openmrs/esm-framework';
import { deletePatientList } from '../api/api-remote';
import PatientListDetailComponent from './patient-list-detail.component';

const mockedUsePatientListDetails = usePatientListDetails as jest.Mock;
const mockedUsePatientListMembers = usePatientListMembers as jest.Mock;
const mockedDeletePatientList = deletePatientList as jest.Mock;

jest.mock('../api/hooks', () => ({
usePatientListDetails: jest.fn(),
usePatientListMembers: jest.fn(),
}));

jest.mock('../api/api-remote');

jest.mock('@openmrs/esm-framework', () => ({
...jest.requireActual('@openmrs/esm-framework'),
showToast: jest.fn(),
navigate: jest.fn(),
ExtensionSlot: jest.fn(),
}));

const mockedPatientListDetails = {
name: 'Test Patient List',
description: 'This is a test patient list',
size: 5,
startDate: '2023-08-14',
};

const mockedPatientListMembers = [
{
patient: {
person: {
display: 'John Doe',
gender: 'Male',
},
identifiers: [
{
identifier: '100GEJ',
},
],
uuid: '7cd38a6d-377e-491b-8284-b04cf8b8c6d8',
},
startDate: '2023-08-10',
},
];

describe('PatientListDetailComponent', () => {
beforeEach(() => {
jest.clearAllMocks();
mockedUsePatientListDetails.mockReturnValue({
data: mockedPatientListDetails,
});

mockedUsePatientListMembers.mockReturnValue({
data: mockedPatientListMembers,
});

mockedDeletePatientList.mockResolvedValue({});
});

it('renders patient list details', async () => {
render(<PatientListDetailComponent />);

await waitFor(() => {
expect(screen.getByText('Test Patient List')).toBeInTheDocument();
expect(screen.getByText('This is a test patient list')).toBeInTheDocument();
});
});

it('displays patient list members', async () => {
render(<PatientListDetailComponent />);

await waitFor(() => {
expect(screen.getByText('John Doe')).toBeInTheDocument();
expect(screen.getByText('Male')).toBeInTheDocument();
expect(screen.getByText('100GEJ')).toBeInTheDocument();
});
});

it('opens edit overlay when "Edit Name/ Description" is clicked', () => {
render(<PatientListDetailComponent />);

userEvent.click(screen.getByText('Actions'));
const editBtn = screen.getByText('Edit Name/ Description');
userEvent.click(editBtn);
});

it('deletes patient list and navigates on successful delete', async () => {
render(<PatientListDetailComponent />);

await waitFor(() => {
userEvent.click(screen.getByText('Delete'));
});

await waitFor(() => {
expect(mockedDeletePatientList).toHaveBeenCalledTimes(1);
expect(showToast).toHaveBeenCalledTimes(1);
});
});
});
6 changes: 3 additions & 3 deletions packages/esm-patient-registration-app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@openmrs/esm-patient-registration-app",
"version": "7.0.0",
"name": "@kenyaemr/esm-patient-registration-app",
"version": "7.0.2",
"description": "Patient registration microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-registration-app.js",
"browser": "dist/kenyaemr-esm-patient-registration-app.js",
"main": "src/index.ts",
"source": true,
"license": "MPL-2.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/esm-patient-registration-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export interface FieldDefinition {
};
answerConceptSetUuid?: string;
customConceptAnswers?: Array<CustomConceptAnswer>;
showWhenExpression?: {
field: string;
value: string;
};
renderType?: string;
}
export interface CustomConceptAnswer {
uuid: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-registration-app/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const personRelationshipRepresentation =
'personB:(age,display,birthdate,uuid),' +
'relationshipType:(uuid,display,description,aIsToB,bIsToA))';

export const moduleName = '@openmrs/esm-patient-registration-app';
export const moduleName = '@kenyaemr/esm-patient-registration-app';
export const patientRegistration = 'patient-registration';

export const cacheForOfflineHeaders: OmrsOfflineHttpHeaders = {
Expand Down
10 changes: 10 additions & 0 deletions packages/esm-patient-registration-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@ export const deleteIdentifierConfirmationModal = getAsyncLifecycle(
() => import('./widgets/delete-identifier-confirmation.modal'),
options,
);

export const confirmClientRegistryModal = getAsyncLifecycle(
() => import('./patient-verification/verification-modal/confirm-prompt.component'),
options,
);

export const emptyClientRegistryModal = getAsyncLifecycle(
() => import('./patient-verification/verification-modal/empty-prompt.component'),
options,
);
Loading
Loading