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 bug that fails starting a visit #264

Merged
merged 3 commits into from
Oct 31, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@carbon/react": "^1.64.1",
"@openmrs/esm-framework": "next",
"@openmrs/esm-framework": "5.8.2-pre.2417",
"@openmrs/esm-patient-common-lib": "next",
"@openmrs/esm-styleguide": "next",
"@swc/cli": "^0.1.57",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react-to-print": "^2.14.13"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-framework": "5.8.2-pre.2417",
"@openmrs/esm-patient-common-lib": "5.x",
"react": "^18.1.0",
"react-i18next": "11.x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
formInfo: {
encounterUuid: '',
formUuid,
additionalProps: { enrollmenrDetails: careProgram.enrollmentDetails } ?? {},
additionalProps: { enrollmentDetails: careProgram.enrollmentDetails },
},
})
: launchStartVisitPrompt();
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-queues-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"swr": "^2.1.1"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-framework": "5.8.2-pre.2417",
"react": "18.x",
"react-i18next": "11.x",
"react-router-dom": "6.x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import {
import { addQueueEntry, getCareProvider, updateQueueEntry } from './active-visits-table.resource';
import { useQueueRoomLocations } from '../hooks/useQueueRooms';
import styles from './change-status-dialog.scss';
import { first } from 'rxjs/operators';
import { QueueStatus, extractErrorMessagesFromResponse } from '../utils/utils';
import { getCurrentPatientQueueByPatientUuid, useProviders } from './visit-form/queue.resource';
import { first } from 'rxjs/operators';

interface ChangeStatusDialogProps {
patientUuid: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { openmrsFetch } from '@openmrs/esm-framework';
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
import useSWR from 'swr';
import { Appointment, ProviderResponse } from '../../types';

export async function saveAppointment(appointment: Appointment) {
const abortController = new AbortController();

await openmrsFetch(`/ws/rest/v1/appointment`, {
await openmrsFetch(`${restBaseUrl}/appointment`, {
method: 'POST',
signal: abortController.signal,
headers: {
Expand All @@ -29,7 +29,7 @@ export async function saveAppointment(appointment: Appointment) {

// fetch providers of a service point
export function useProviders() {
const apiUrl = `/ws/rest/v1/provider?q=&v=full`;
const apiUrl = `${restBaseUrl}/provider?q=&v=full`;
const { data, error, isLoading, isValidating } = useSWR<{ data: { results: Array<ProviderResponse> } }, Error>(
apiUrl,
openmrsFetch,
Expand All @@ -44,7 +44,7 @@ export function useProviders() {
}

export async function getCurrentPatientQueueByPatientUuid(patientUuid: string, currentLocation: string) {
const apiUrl = `/ws/rest/v1/incompletequeue?queueRoom=${currentLocation}&patient=${patientUuid}&v=full`;
const apiUrl = `${restBaseUrl}/incompletequeue?queueRoom=${currentLocation}&patient=${patientUuid}&v=full`;

const abortController = new AbortController();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import {
import dayjs from 'dayjs';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { first } from 'rxjs/operators';
import styles from './visit-form.scss';
import { useProviders } from './queue.resource';
import { NewVisitPayload, SearchTypes } from '../../types';
import { amPm, convertTime12to24 } from '../../helpers/time-helpers';
import { useQueueRoomLocations } from '../../hooks/useQueueRooms';
import { addQueueEntry } from '../active-visits-table.resource';
import { first } from 'rxjs/operators';

interface VisitFormProps {
toggleSearchType: (searchMode: SearchTypes, patientUuid) => void;
Expand Down Expand Up @@ -142,7 +142,6 @@ const StartVisitForm: React.FC<VisitFormProps> = ({ patientUuid, toggleSearchTyp
};

const abortController = new AbortController();

saveVisit(payload, abortController)
.pipe(first())
.subscribe(
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-ugandaemr-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"lodash-es": "^4.17.15"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-framework": "5.8.2-pre.2417",
"react": "18.x",
"react-i18next": "11.x"
},
Expand Down
Loading
Loading