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

(refactor) follow up changes on the case management: discontinuity of case #520

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
38ba77e
(refactor) updating the uuids
its-kios09 Dec 11, 2024
e926ff3
(feat) added end relationship functionality
its-kios09 Dec 17, 2024
3b62701
(feat) added a ability to end relationship on case management
its-kios09 Dec 17, 2024
087818c
Merge branch 'main' into new-case-mgt
its-kios09 Dec 18, 2024
c307d8c
Merge branch 'main' into new-case-mgt
its-kios09 Dec 19, 2024
02936e8
Merge branch 'main' into new-case-mgt
its-kios09 Dec 19, 2024
84e2943
(refactor) updated PR per suggestion
its-kios09 Dec 19, 2024
e48dfcf
(feat) updated translation
its-kios09 Dec 19, 2024
b0fe70f
(feat) added the unit test
its-kios09 Dec 19, 2024
f01cd1c
Merge branch 'main' into new-case-mgt
its-kios09 Jan 7, 2025
cc40214
Merge branch 'main' into new-case-mgt
its-kios09 Jan 9, 2025
6af8746
Revert commits 38ba77e and e926ff3: Undo changes from Dec 16 and Dec 17
its-kios09 Jan 10, 2025
9e71a43
(refactor) updating the uuids
its-kios09 Dec 11, 2024
632b3f3
(feat) added end relationship functionality
its-kios09 Dec 17, 2024
53a27f5
(feat) added a ability to end relationship on case management
its-kios09 Dec 17, 2024
29e5d48
(refactor) updated PR per suggestion
its-kios09 Dec 19, 2024
8990d5a
(feat) updated translation
its-kios09 Dec 19, 2024
eb37f0a
(feat) added the unit test
its-kios09 Dec 19, 2024
c5e2a06
(refactor) updated the config schema uuids (#535)
its-kios09 Jan 9, 2025
86c22ca
Revert commits 38ba77e and e926ff3: Undo changes from Dec 16 and Dec 17
its-kios09 Jan 10, 2025
e576f5c
Revert "(feat) added end relationship functionality"
its-kios09 Jan 10, 2025
5f06452
(fix) duplicate type
its-kios09 Jan 10, 2025
6a65b2c
Merge branch 'new-case-mgt' of github.com:its-kios09/kenyaemr-esm-3.x…
its-kios09 Jan 10, 2025
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
26 changes: 7 additions & 19 deletions packages/esm-morgue-app/src/config-schema.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import { Type } from '@openmrs/esm-framework';

export const configSchema = {
autopsyEncounterUuid: {
_type: Type.String,
_description: 'Encounter UUID for autopsy',
_default: '',
},
formsList: {
_type: Type.Object,
_description: 'List of form UUIDs',
_default: {
autopsyFormUuid: '',
},
},
morgueVisitTypeUuid: {
_type: Type.String,
_description: ' UUID for morgue visit',
Expand All @@ -21,7 +9,7 @@ export const configSchema = {
morgueDepartmentServiceTypeUuid: {
_type: Type.String,
_description: ' UUID for morgue department service type',
_default: 'd7bd4cc0-90b1-4f22-90f2-ab7fde936727',
_default: '5b9e6cd1-f836-4144-91e4-401c58dd62af',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are related to morgue functions

},
insurancepaymentModeUuid: {
_type: Type.String,
Expand All @@ -36,7 +24,7 @@ export const configSchema = {
tagNumberUuid: {
_type: Type.String,
_description: 'UUID for tag number concept',
_default: '13ba9c45-c540-4f10-b915-fa3d7baeb3d1',
_default: 'f2b35679-7ba9-4619-92cb-6872b0c6bf57',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

},
morgueAdmissionEncounterType: {
_type: Type.String,
Expand All @@ -56,22 +44,22 @@ export const configSchema = {
obNumberUuid: {
_type: Type.String,
_description: 'UUID for ob number concept',
_default: 'c756d06a-22a5-4b66-933e-3d44667b72a0',
_default: '0dffecb3-2dc4-4d56-8cd4-56ba38579c69',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

},
policeNameUuid: {
_type: Type.String,
_description: 'UUID for police name concept',
_default: '6d58d9b5-6f84-4e77-941e-f5cc86d18a60',
_default: 'd889f05b-0d9b-462f-ae8e-2e9be79fd954',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

},
burialPermitNumberUuid: {
_type: Type.String,
_description: 'UUID for burial permit number concept',
_default: '29ef3df3-9845-49b0-96f2-5fb6d6240039',
_default: 'da524812-5600-4677-ba26-eb61eb925eef',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

},
policeIDNumber: {
_type: Type.String,
_description: 'UUID for police id number concept',
_default: '8d488d02-d1d8-41a5-8219-61f4fc5dbeb0',
_default: '163084AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

},
encounterProviderRoleUuid: {
_type: Type.UUID,
Expand Down Expand Up @@ -133,4 +121,4 @@ export type ConfigObject = {
dischargeAreaUuid: string;
morgueDischargeEncounterTypeUuid: string;
adminUuid: string;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
ConfigurableLink,
isDesktop,
launchWorkspace,
showModal,
showSnackbar,
useLayoutType,
useSession,
Expand All @@ -47,7 +46,7 @@ const CaseManagementListActive: React.FC<CaseManagementListActiveProps> = ({ set
const { user } = useSession();
const caseManagerPersonUuid = user?.person.uuid;

const { data: activeCasesData, error: activeCasesError } = useActivecases(caseManagerPersonUuid);
const { data: activeCasesData, error: activeCasesError, mutate: fetchCases } = useActivecases(caseManagerPersonUuid);
its-kios09 marked this conversation as resolved.
Show resolved Hide resolved

const patientChartUrl = '${openmrsSpaBase}/patient/${patientUuid}/chart/case-management-encounters';

Expand All @@ -65,10 +64,26 @@ const CaseManagementListActive: React.FC<CaseManagementListActiveProps> = ({ set
caseData.personB.display.toLowerCase().includes(searchTerm.toLowerCase())),
);
const handleDiscontinueACase = async (relationshipUuid: string) => {
const dispose = showModal('end-relationship-dialog', {
relationshipUuid,
closeModal: () => dispose(),
});
try {
await updateRelationship(relationshipUuid, { endDate: new Date() });
await fetchCases();

showSnackbar({
kind: 'success',
title: t('endRlship', 'End relationship'),
subtitle: t('savedRlship', 'Relationship ended successfully'),
timeoutInMs: 3000,
isLowContrast: true,
});
} catch (error) {
showSnackbar({
kind: 'error',
title: t('RlshipError', 'Relationship Error'),
subtitle: t('RlshipError', 'Request Failed.......'),
timeoutInMs: 2500,
isLowContrast: true,
});
}
};

const tableRows = filteredCases
Expand All @@ -87,12 +102,12 @@ const CaseManagementListActive: React.FC<CaseManagementListActiveProps> = ({ set
dateofend: caseData.endDate ? (
new Date(caseData.endDate).toLocaleDateString()
) : (
<Tag type="green" size={responsiveSize}>
<Tag type="green" size="lg">
{t('enrolled', 'Enrolled')}
</Tag>
),
actions: (
<OverflowMenu size={responsiveSize}>
<OverflowMenu size="md">
<OverflowMenuItem
isDelete
itemText={t('discontinue', 'Discontinue')}
Expand Down
Loading