From 58a5de229fe2c1e545bb6c7d81ec9fdc2fba5a22 Mon Sep 17 00:00:00 2001 From: lucille Date: Mon, 28 Oct 2024 11:16:07 +0300 Subject: [PATCH] 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' ||