From 58a5de229fe2c1e545bb6c7d81ec9fdc2fba5a22 Mon Sep 17 00:00:00 2001 From: lucille Date: Mon, 28 Oct 2024 11:16:07 +0300 Subject: [PATCH 1/2] Exclude the patient from their own children list --- .../src/components/banner-tags/usePatientFamilyNames.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts b/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts index 2a1e79835..bb5ea2773 100644 --- a/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts +++ b/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts @@ -28,11 +28,15 @@ export const usePatientFamilyNames = (patientUuid: string) => { } const childRelationships = relationships - .filter((relationship) => relationship.relationshipType?.displayBIsToA === 'Child') + .filter( + (relationship) => + relationship.relationshipType?.displayBIsToA === 'Child' && relationship.personB?.uuid !== patientUuid, + ) .map((relationship) => relationship.personB?.display); setChildrenNames(childRelationships); + // Find the mother relationship const motherRelationship = relationships.find( (relationship) => (relationship.relationshipType?.displayAIsToB === 'Mother' || From a167a299ed79ad5ea68faccd52fa7f4844862591 Mon Sep 17 00:00:00 2001 From: lucille Date: Mon, 28 Oct 2024 13:18:35 +0300 Subject: [PATCH 2/2] remove unnecessary comment --- .../src/components/banner-tags/usePatientFamilyNames.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts b/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts index bb5ea2773..f1c8c1acf 100644 --- a/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts +++ b/packages/esm-commons-lib/src/components/banner-tags/usePatientFamilyNames.ts @@ -36,7 +36,6 @@ export const usePatientFamilyNames = (patientUuid: string) => { setChildrenNames(childRelationships); - // Find the mother relationship const motherRelationship = relationships.find( (relationship) => (relationship.relationshipType?.displayAIsToB === 'Mother' ||