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

resolve backend dependence #133

Merged
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
3 changes: 1 addition & 2 deletions packages/esm-care-panel-app/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
![Node.js CI](https://github.com/palladiumkenya/kenyaemr-esm-3.x/workflows/Node.js%20CI/badge.svg)

# ESM Care Panel App

This repository provides a starting point for creating Kenyaemr patient care panels
This repository provides a starting point for creating UgandaEMR patient care programs
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/src/hooks/useCarePrograms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type PatientCarePrograms = {
};

export const useCarePrograms = (patientUuid: string) => {
const url = `/ws/rest/v1/kenyaemr/eligiblePrograms?patientUuid=${patientUuid}`;
const url = `/ws/rest/v1/eligiblePrograms?patientUuid=${patientUuid}`;
const { data, error, isLoading, isValidating } = useSWR<{ data: Array<PatientCarePrograms> }>(url, openmrsFetch);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import groupBy from 'lodash/groupBy';
import { openmrsFetch } from '@openmrs/esm-framework';

export const useEnrollmentHistory = (patientUuid: string) => {
const enrollmentHistoryUrl = `/ws/rest/v1/kenyaemr/patientHistoricalEnrollment?patientUuid=${patientUuid}`;
const enrollmentHistoryUrl = `/ws/rest/v1/patientHistoricalEnrollment?patientUuid=${patientUuid}`;
const { data, isValidating, error, isLoading } = useSWR<{ data: Array<Record<string, any>> }>(
enrollmentHistoryUrl,
openmrsFetch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface nonStandardRegimen {
}

export const useNonStandardRegimen = () => {
const nonStandardRegimenUrl = `/ws/rest/v1/kenyaemr/arvDrugs`;
const nonStandardRegimenUrl = `/ws/rest/v1/arvDrugs`;
const { data, mutate, error, isLoading } = useSWR<{ data: { results: Array<nonStandardRegimen> } }>(
nonStandardRegimenUrl,
openmrsFetch,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/src/hooks/usePatientSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useSWR from 'swr';
import { PatientSummary } from '../types/index';

export const usePatientSummary = (patientUuid: string) => {
const programSummaryUrl = `/ws/rest/v1/kenyaemr/patientSummary?patientUuid=${patientUuid}`;
const programSummaryUrl = `/ws/rest/v1/patientSummary?patientUuid=${patientUuid}`;
const { data, mutate, error, isLoading } = useSWR<{ data: PatientSummary }>(programSummaryUrl, openmrsFetch);

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/src/hooks/useProgramSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useSWR from 'swr';
import { ProgramSummary } from '../types/index';

export const useProgramSummary = (patientUuid: string) => {
const programSummaryUrl = `/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=${patientUuid}`;
const programSummaryUrl = `/ws/rest/v1/currentProgramDetails?patientUuid=${patientUuid}`;
const { data, mutate, error, isLoading } = useSWR<{ data: ProgramSummary }>(programSummaryUrl, openmrsFetch);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useSWR from 'swr';
import { RegimenEncounter } from '../types';

export const useRegimenEncounter = (category: string, patientUuid: string) => {
const regimenEncounterUrl = `/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=${patientUuid}&category=${category}`;
const regimenEncounterUrl = `/ws/rest/v1/lastRegimenEncounter?patientUuid=${patientUuid}&category=${category}`;
const { data, mutate, error, isLoading } = useSWR<{ data: { results } }>(regimenEncounterUrl, openmrsFetch);

const regimenEncounter = data?.data?.results ? data?.data?.results : '';
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/src/hooks/useRegimenHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface RegimenHistory {
}

export const useRegimenHistory = (patientUuid: string, category: string) => {
const regimenHistoryHistoryUrl = `/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=${patientUuid}&category=${category}`;
const regimenHistoryHistoryUrl = `/ws/rest/v1/regimenHistory?patientUuid=${patientUuid}&category=${category}`;
const { data, mutate, error, isLoading } = useSWR<{ data: { results: Array<RegimenHistory> } }>(
regimenHistoryHistoryUrl,
openmrsFetch,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/src/hooks/useRegimenReason.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Reason {
}

export const useRegimenReason = () => {
const regimenReasonUrl = `/ws/rest/v1/kenyaemr/regimenReason`;
const regimenReasonUrl = `/ws/rest/v1/regimenReason`;
const { data, mutate, error, isLoading } = useSWR<{ data: { results: Array<RegimenReason> } }>(
regimenReasonUrl,
openmrsFetch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Regimen {
}

export const useStandardRegimen = () => {
const standardRegimenUrl = `/ws/rest/v1/kenyaemr/standardRegimen`;
const standardRegimenUrl = `/ws/rest/v1/standardRegimen`;
const { data, mutate, error, isLoading } = useSWR<{ data: { results: Array<StandardRegimen> } }>(
standardRegimenUrl,
openmrsFetch,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-care-panel-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 { dashboardMeta } from './dashboard.meta';
import { createDashboardLink, registerWorkspace } from '@openmrs/esm-patient-common-lib';

const moduleName = '@kenyaemr/esm-care-panel-app';
const moduleName = '@ugandaemr/esm-care-panel-app';

const options = {
featureName: 'patient-care-panels',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ const DeleteRegimenModal: React.FC<DeleteRegimenModalProps> = ({
description: t('regimenDeletedSuccessfully', 'Regimen successfully'),
title: t('regimenDeleted', 'Regimen deleted'),
});
mutate(`/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=${patientUuid}&category=${category}`);
mutate(`/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/kenyaemr/patientSummary?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=${patientUuid}&category=${category}`);
mutate(`/ws/rest/v1/regimenHistory?patientUuid=${patientUuid}&category=${category}`);
mutate(`/ws/rest/v1/currentProgramDetails?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/patientSummary?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/lastRegimenEncounter?patientUuid=${patientUuid}&category=${category}`);
closeWorkspace?.();
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ const RegimenForm: React.FC<RegimenFormProps> = ({
description: t('regimenUpdatedSuccessfully', `Regimen updated successfully.`),
});
setIsSubmitting(false);
mutate(`/ws/rest/v1/kenyaemr/currentProgramDetails?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/kenyaemr/patientSummary?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/kenyaemr/regimenHistory?patientUuid=${patientUuid}&category=${category}`);
mutate(`/ws/rest/v1/kenyaemr/lastRegimenEncounter?patientUuid=${patientUuid}&category=${category}`);
mutate(`/ws/rest/v1/currentProgramDetails?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/patientSummary?patientUuid=${patientUuid}`);
mutate(`/ws/rest/v1/regimenHistory?patientUuid=${patientUuid}&category=${category}`);
mutate(`/ws/rest/v1/lastRegimenEncounter?patientUuid=${patientUuid}&category=${category}`);

closeWorkspace();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-care-panel-app/src/routes.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.openmrs.org/routes.schema.json",
"backendDependencies": {
"kenyaemr": "^18.2.0"
"webservices.rest": "^2.24.0"
},
"pages": [],
"extensions": [
Expand Down Expand Up @@ -41,4 +41,4 @@
"component": "deleteRegimenConfirmationDialog"
}
]
}
}
2 changes: 1 addition & 1 deletion packages/esm-patient-queues-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const configSchema = {
},
defaultFacilityUrl: {
_type: Type.String,
_default: '/ws/rest/v1/kenyaemr/default-facility',
_default: '/ws/rest/v1/default-facility',
_description: 'Custom URL to load default facility if it is not in the session',
},
customPatientChartText: {
Expand Down