Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ea9a9ad
BN-49 | Creation of Front End for Lab investigation
devsingh05298 May 9, 2025
636f81c
BN-49 | Moved test details and data table in separate components
devsingh05298 May 9, 2025
bdf1601
BN-49|Removed the yarn.lock file pushed accidently
devsingh05298 May 12, 2025
bd8e5b0
BN-49 | Improve the naming conventions for LabInvestigationTable
devsingh05298 May 12, 2025
350509b
BN-49 | WIP. Code Refactor for the Components and Styling
devsingh05298 May 14, 2025
96a574f
BN-49| Set URL for Lab Investigations.
arshiyaTW2021 May 19, 2025
7a2aecb
BN-49| Add. Set lab test types and enums for FHIR R4 ServiceRequest s…
arshiyaTW2021 May 19, 2025
094f062
BN-49. Add useLabInvestigations hook to fetch and manage patient lab …
arshiyaTW2021 May 19, 2025
a957652
BN-49| add lab investigation service to fetch, format, and group pati…
arshiyaTW2021 May 19, 2025
a127e35
BN-49. Add unit tests for useLabInvestigations hook and for lab inve…
arshiyaTW2021 May 19, 2025
05f0e2f
BN-49| add LabInvestigationItem component to display formatted lab te…
arshiyaTW2021 May 19, 2025
e2f947e
BN-49|add LabInvestigationTable component with accordion view for gro…
arshiyaTW2021 May 19, 2025
8357d96
BN-49|add styles for LabInvestigation components.
arshiyaTW2021 May 19, 2025
80113a3
Add unit tests for LabInvestigationItem and LabInvestigationTable
arshiyaTW2021 May 19, 2025
78b1ee1
BN-49 | Add i18N for lab orders
devsingh05298 May 19, 2025
ecafe53
BN-49. Add number of visits parameter to PATIENT_LAB_INVESTIGATION_R…
arshiyaTW2021 May 21, 2025
29333f5
BN-49| Add. Correct date format.
arshiyaTW2021 May 21, 2025
1b044b0
BN-49 | Removed Lab test status as that's part of future story and ad…
arshiyaTW2021 May 21, 2025
f06d426
BN-49. Removed LabTests file as this is not needed.
arshiyaTW2021 May 21, 2025
84e7b22
BN-49| Add a condition when labInvestigations are null
arshiyaTW2021 May 21, 2025
82524ab
BN-49. Refactored interfaces
arshiyaTW2021 May 21, 2025
f550ad0
BN-49| Changed colours
arshiyaTW2021 May 21, 2025
2b66c5f
BN-49| Removed redundant tests.
arshiyaTW2021 May 21, 2025
e5caace
BN-49|Changed date format
arshiyaTW2021 May 21, 2025
0a82129
Merge branch 'BN-49-Frontend' of https://github.com/bahnew/bahmni-cli…
devsingh05298 May 21, 2025
a1b6ccf
BN-49| Changed Stat and Routine to lowercase as we are receiving the …
arshiyaTW2021 May 21, 2025
00a753d
BN-49| Add noOfVisits=5 as default till we fetch it from configuration.
arshiyaTW2021 May 21, 2025
defa498
BN-49 | Add integration tests for lab investigation
devsingh05298 May 21, 2025
aaf3c4a
BN-49 | Fixed integration test for lab investigation
devsingh05298 May 21, 2025
9056993
BN-49. Fix tests
arshiyaTW2021 May 21, 2025
9dba451
Merge branch and resolve yarn.lock conflict by keeping their changes
arshiyaTW2021 May 21, 2025
edcc42a
Fix linting issues in lab investigation files
arshiyaTW2021 May 21, 2025
eb5d95b
BN-49| Add integration test for Lab Investigation
devsingh05298 May 21, 2025
139762d
Merge branch 'BN-49-Frontend' of github.com:bahnew/bahmni-clinical-fr…
arshiyaTW2021 May 22, 2025
e1e86cd
Fix lab investigation tests: update integration test to check for tag…
arshiyaTW2021 May 22, 2025
d350cd1
Fix lab investigation tests: update test expectations to match actual…
arshiyaTW2021 May 22, 2025
74cebd0
Fix lab investigation tests: update test expectations for gray tags
arshiyaTW2021 May 22, 2025
d367e91
BN-49|Fix tests and case sensitivity of stat and routine.
arshiyaTW2021 May 22, 2025
174bdf1
BN-49. Add tests
arshiyaTW2021 May 22, 2025
83d7603
BN-49. Fix prettier issues.
arshiyaTW2021 May 22, 2025
abe9f3e
Add case when no lab investigations are there till date
arshiyaTW2021 May 22, 2025
75f7fe0
BN-49| Add panel or single test in LabInvestigationTable
arshiyaTW2021 May 22, 2025
11753c9
BN-49| Change variable names and limit the functionality of useLabInv…
arshiyaTW2021 May 22, 2025
a213e17
Fix AccordionItem width.
arshiyaTW2021 May 22, 2025
59d9f22
BN-49|Fix labInvestigationItem.test.tsx
arshiyaTW2021 May 23, 2025
3a7c0e5
Fix prettier issues.
arshiyaTW2021 May 23, 2025
84cbee6
BN-49| Apply translations.
arshiyaTW2021 May 23, 2025
cb66383
BN-49|Fix tests after applying translation.
arshiyaTW2021 May 23, 2025
dffeafb
BN-49 | Fix i18N file
devsingh05298 May 23, 2025
9b6649a
BN-49 | Updated import alias in DashboardSection
devsingh05298 May 23, 2025
6c425aa
BN-49. Fix integration test.
arshiyaTW2021 May 23, 2025
257576b
BN-49. Fix prettier issue.
arshiyaTW2021 May 23, 2025
f833641
BN-49|Add TODO for LAB_ORDER_TYPE_UUID.
arshiyaTW2021 May 26, 2025
6d862c8
BN-49| Add SkeletonText for loading lab tests.
arshiyaTW2021 May 26, 2025
1505734
BN-49|Add the missing SkeletonText component
arshiyaTW2021 May 27, 2025
127cb49
BN-49. Fix aliases
arshiyaTW2021 May 27, 2025
a4833ac
BN-49|Fix prettier issues
arshiyaTW2021 May 27, 2025
88899ee
BN-49 | Fix. i18n instead of mocking translation
devsingh05298 May 27, 2025
cd5b7b2
Merge branch 'BN-49-Frontend' of https://github.com/bahnew/bahmni-cli…
devsingh05298 May 27, 2025
3832edb
BN-49 | Fix. date format in constants
devsingh05298 May 27, 2025
238619f
BN-49 | Remove unused date format
devsingh05298 May 27, 2025
224308f
BN-49 | Remove unused date format
devsingh05298 May 27, 2025
4da710e
BN-49 | Fix. DATE_FORMAT for default and prefered format
devsingh05298 May 27, 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
15 changes: 15 additions & 0 deletions public/locales/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@
"EXPANDABLE_TABLE_EMPTY_STATE_MESSAGE": "No data available",
"EXPANDABLE_TABLE_ERROR_MESSAGE": "{{title}}: {{message}}",
"INVALID_RESPONSE": "Invalid response received from the server",
"LAB_TEST_ACTIONS": "Actions",
"LAB_TEST_ERROR_LOADING": "Error loading lab tests",
"LAB_TEST_LOADING": "Loading lab tests...",
"LAB_TEST_NAME": "Test Name",
"LAB_TEST_ORDERED_BY": "Ordered By",
"LAB_TEST_PANEL": "Panel",
"LAB_TEST_REFERENCE_RANGE": "Reference Range",
"LAB_TEST_REPORTED_ON": "Reported On",
"LAB_TEST_RESULT": "Result",
"LAB_TEST_RESULTS_PENDING": "Results Pending",
"LAB_TEST_ROUTINE": "Routine",
"LAB_TEST_SINGLE_TEST": "Single Test",
"LAB_TEST_STATUS": "Status",
"LAB_TEST_UNAVAILABLE": "No lab Investigations available",
"LAB_TEST_URGENT": "Urgent",
"LOADING_CLINICAL_CONFIG": "Loading clinical configuration...",
"LOADING_DASHBOARD_CONFIG": "Loading dashboard configuration...",
"LOADING_DASHBOARD_CONTENT": "Loading dashboard content...",
Expand Down
15 changes: 15 additions & 0 deletions public/locales/locale_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@
"EXPANDABLE_TABLE_EMPTY_STATE_MESSAGE": "No hay datos disponibles",
"EXPANDABLE_TABLE_ERROR_MESSAGE": "{{title}}: {{message}}",
"INVALID_RESPONSE": "Se recibió una respuesta no válida del servidor",
"LAB_TEST_ACTIONS": "Acciones",
"LAB_TEST_ERROR_LOADING": "Error al cargar pruebas de laboratorio",
"LAB_TEST_LOADING": "Loading lab tests...",
"LAB_TEST_NAME": "Nombre de la prueba",
"LAB_TEST_ORDERED_BY": "Ordenado por",
"LAB_TEST_PANEL": "Panel",
"LAB_TEST_REFERENCE_RANGE": "Rango de referencia",
"LAB_TEST_REPORTED_ON": "Reportado el",
"LAB_TEST_RESULT": "Resultado",
"LAB_TEST_RESULTS_PENDING": "Resultados pendientes",
"LAB_TEST_ROUTINE": "De rutina",
"LAB_TEST_SINGLE_TEST": "Prueba única",
"LAB_TEST_STATUS": "Estado",
"LAB_TEST_UNAVAILABLE": "No disponible",
"LAB_TEST_URGENT": "Urgente",
"LOADING_CLINICAL_CONFIG": "Cargando configuración clínica...",
"LOADING_DASHBOARD_CONFIG": "Cargando configuración del panel...",
"LOADING_DASHBOARD_CONTENT": "Cargando contenido del panel...",
Expand Down
355 changes: 355 additions & 0 deletions src/__mocks__/labInvestigationMocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
import {
FhirLabTest,
FhirLabTestBundle,
FormattedLabTest,
LabTestStatus,
LabTestPriority,
LabTestsByDate,
} from '@/types/labInvestigation';

// Mock patient UUID
export const mockPatientUUID = 'test-patient-uuid';

// Mock FHIR lab tests
export const mockFhirLabTests: FhirLabTest[] = [
{
resourceType: 'ServiceRequest',
id: 'lab-test-1',
meta: {
versionId: '1',
lastUpdated: '2025-03-25T06:48:32.000+00:00',
},
text: {
status: 'generated',
div: '<div>Complete Blood Count</div>',
},
extension: [
{
url: 'http://fhir.bahmni.org/lab-order-concept-type-extension',
valueString: 'Panel',
},
],
status: 'Pending',
intent: 'order',
category: [
{
coding: [
{
system: 'http://terminology.hl7.org/CodeSystem/service-category',
code: 'lab',
display: 'Laboratory',
},
],
text: 'Laboratory',
},
],
priority: 'Routine',
code: {
coding: [
{
system: 'http://loinc.org',
code: '58410-2',
display:
'Complete blood count (CBC) panel - Blood by Automated count',
},
],
text: 'Complete Blood Count',
},
subject: {
reference: `Patient/${mockPatientUUID}`,
type: 'Patient',
display: 'Test Patient',
},
encounter: {
reference: 'Encounter/test-encounter',
type: 'Encounter',
},
occurrencePeriod: {
start: '2025-03-25T06:48:32.000+00:00',
end: '2025-03-25T06:48:32.000+00:00',
},
requester: {
reference: 'Practitioner/test-practitioner',
type: 'Practitioner',
identifier: {
value: 'test-practitioner',
},
display: 'Dr. John Doe',
},
},
{
resourceType: 'ServiceRequest',
id: 'lab-test-2',
meta: {
versionId: '1',
lastUpdated: '2025-03-25T06:48:32.000+00:00',
},
text: {
status: 'generated',
div: '<div>Lipid Panel</div>',
},
extension: [
{
url: 'http://fhir.bahmni.org/lab-order-concept-type-extension',
valueString: 'Panel',
},
],
status: 'Pending',
intent: 'order',
category: [
{
coding: [
{
system: 'http://terminology.hl7.org/CodeSystem/service-category',
code: 'lab',
display: 'Laboratory',
},
],
text: 'Laboratory',
},
],
priority: 'Stat',
code: {
coding: [
{
system: 'http://loinc.org',
code: '24331-1',
display: 'Lipid Panel',
},
],
text: 'Lipid Panel',
},
subject: {
reference: `Patient/${mockPatientUUID}`,
type: 'Patient',
display: 'Test Patient',
},
encounter: {
reference: 'Encounter/test-encounter',
type: 'Encounter',
},
occurrencePeriod: {
start: '2025-03-25T06:48:32.000+00:00',
end: '2025-03-25T06:48:32.000+00:00',
},
requester: {
reference: 'Practitioner/test-practitioner',
type: 'Practitioner',
identifier: {
value: 'test-practitioner',
},
display: 'Dr. Jane Smith',
},
},
{
resourceType: 'ServiceRequest',
id: 'lab-test-3',
meta: {
versionId: '1',
lastUpdated: '2025-03-24T06:48:32.000+00:00',
},
text: {
status: 'generated',
div: '<div>Glucose Test</div>',
},
extension: [
{
url: 'http://fhir.bahmni.org/lab-order-concept-type-extension',
valueString: 'Test',
},
],
status: 'Pending',
intent: 'order',
category: [
{
coding: [
{
system: 'http://terminology.hl7.org/CodeSystem/service-category',
code: 'lab',
display: 'Laboratory',
},
],
text: 'Laboratory',
},
],
priority: 'Routine',
code: {
coding: [
{
system: 'http://loinc.org',
code: '2339-0',
display: 'Glucose',
},
],
text: 'Glucose Test',
},
subject: {
reference: `Patient/${mockPatientUUID}`,
type: 'Patient',
display: 'Test Patient',
},
encounter: {
reference: 'Encounter/test-encounter',
type: 'Encounter',
},
occurrencePeriod: {
start: '2025-03-24T06:48:32.000+00:00',
end: '2025-03-24T06:48:32.000+00:00',
},
requester: {
reference: 'Practitioner/test-practitioner',
type: 'Practitioner',
identifier: {
value: 'test-practitioner',
},
display: 'Dr. John Doe',
},
},
];

// Mock FHIR lab test bundle
export const mockFhirLabTestBundle: FhirLabTestBundle = {
resourceType: 'Bundle',
id: 'test-bundle',
meta: {
lastUpdated: '2025-03-25T06:48:32.000+00:00',
},
type: 'searchset',
total: mockFhirLabTests.length,
link: [
{
relation: 'self',
url: `https://example.org/fhir/ServiceRequest?patient=${mockPatientUUID}`,
},
],
entry: mockFhirLabTests.map((resource) => ({
fullUrl: `https://example.org/fhir/ServiceRequest/${resource.id}`,
resource,
})),
};

// Mock formatted lab tests
export const mockFormattedLabTests: FormattedLabTest[] = [
{
id: 'lab-test-1',
testName: 'Complete Blood Count',
status: LabTestStatus.Pending,
priority: LabTestPriority.routine,
orderedBy: 'Dr. John Doe',
orderedDate: '2025-03-25T06:48:32.000+00:00',
formattedDate: 'Mar 25, 2025',
testType: 'Panel',
},
{
id: 'lab-test-2',
testName: 'Lipid Panel',
status: LabTestStatus.Pending,
priority: LabTestPriority.stat,
orderedBy: 'Dr. Jane Smith',
orderedDate: '2025-03-25T06:48:32.000+00:00',
formattedDate: 'Mar 25, 2025',
testType: 'Panel',
},
{
id: 'lab-test-3',
testName: 'Glucose Test',
status: LabTestStatus.Pending,
priority: LabTestPriority.routine,
orderedBy: 'Dr. John Doe',
orderedDate: '2025-03-24T06:48:32.000+00:00',
formattedDate: 'Mar 24, 2025',
testType: 'Single Test',
},
];

// Mock lab tests grouped by date
export const mockLabTestsByDate: LabTestsByDate[] = [
{
date: 'Mar 25, 2025',
rawDate: '2025-03-25T06:48:32.000+00:00',
tests: [mockFormattedLabTests[0], mockFormattedLabTests[1]],
},
{
date: 'Mar 24, 2025',
rawDate: '2025-03-24T06:48:32.000+00:00',
tests: [mockFormattedLabTests[2]],
},
];

// Mock lab test with missing optional fields
export const mockLabTestWithMissingFields: FhirLabTest = {
resourceType: 'ServiceRequest',
id: 'lab-test-incomplete',
meta: {
versionId: '1',
lastUpdated: '2025-03-25T06:48:32.000+00:00',
},
extension: [
{
url: 'http://fhir.bahmni.org/lab-order-concept-type-extension',
valueString: 'Test',
},
],
status: 'Pending',
intent: 'order',
category: [
{
coding: [
{
system: 'http://terminology.hl7.org/CodeSystem/service-category',
code: 'lab',
display: 'Laboratory',
},
],
text: 'Laboratory',
},
],
priority: 'Routine',
code: {
coding: [
{
code: 'incomplete-test',
},
],
text: 'Incomplete Test',
},
subject: {
reference: `Patient/${mockPatientUUID}`,
type: 'Patient',
display: 'Test Patient',
},
encounter: {
reference: 'Encounter/test-encounter',
type: 'Encounter',
},
occurrencePeriod: {
start: '2025-03-25T06:48:32.000+00:00',
end: '2025-03-25T06:48:32.000+00:00',
},
requester: {
reference: 'Practitioner/test-practitioner',
type: 'Practitioner',
display: 'Unknown Doctor',
},
};

// Mock formatted lab test with missing fields
export const mockFormattedLabTestWithMissingFields: FormattedLabTest = {
id: 'lab-test-incomplete',
testName: 'Incomplete Test',
status: LabTestStatus.Pending,
priority: LabTestPriority.routine,
orderedBy: 'Unknown Doctor',
orderedDate: '2025-03-25T06:48:32.000+00:00',
formattedDate: 'Mar 25, 2025',
testType: 'Single Test',
};

// Mock lab tests by date with incomplete test
export const mockLabTestsByDateWithIncomplete: LabTestsByDate[] = [
{
date: 'Mar 25, 2025',
rawDate: '2025-03-25T06:48:32.000+00:00',
tests: [mockFormattedLabTestWithMissingFields],
},
];
Loading
Loading