-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) : Add lab manifest to KenyaEMR 3.x (#280)
* Lan manifest esm added, with summary cards and metrics * WIP * Added lab manifest table listing lab manifests * Added filtering of lab manifest based in status * Added manifest form * Added manifest detail screen but ui elements unimplemented * Lab detail Header implementation done * Implemted active request and samples * REdesigned summary cards fr lab manifest, added counties resource hjson for manifets form, used tabs for acttive request and manifest samples * Added lab manifest to nav utiles * Manifest editing working with array data source * Hooks mocking network calls * Lab manifest and detail consuming actual endpoint * Cleaned metrics, removed fhir2 deps * Listing actual manifest samples and removed unecessary hook for samples * Filtering sample at endpoint level, added extra sample information * Cleaned up styling, seperated metric value into component
- Loading branch information
Showing
43 changed files
with
3,553 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
![Node.js CI](https://github.com/palladiumkenya/kenyaemr-esm-3.x/workflows/Node.js%20CI/badge.svg) | ||
|
||
# ESM Lab manifest | ||
|
||
This is a frontend module that provides lab manifest functionality. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const rootConfig = require('../../jest.config.js'); | ||
|
||
const packageConfig = { | ||
...rootConfig, | ||
collectCoverage: false, | ||
}; | ||
|
||
module.exports = packageConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "@kenyaemr/esm-lab-manifest-app", | ||
"version": "5.2.0", | ||
"description": "lab-manifest app for KenyaEMR", | ||
"browser": "dist/kenyaemr-esm-lab-manifest-app.js", | ||
"main": "src/index.ts", | ||
"source": true, | ||
"license": "MPL-2.0", | ||
"homepage": "https://github.com/palladiumkenya/kenyaemr-esm-core#readme", | ||
"scripts": { | ||
"start": "openmrs develop", | ||
"serve": "webpack serve --mode=development", | ||
"debug": "npm run serve", | ||
"build": "webpack --mode production", | ||
"analyze": "webpack --mode=production --env.analyze=true", | ||
"lint": "eslint src --ext ts,tsx", | ||
"typescript": "tsc", | ||
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js", | ||
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests", | ||
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js", | ||
"coverage": "yarn test --coverage" | ||
}, | ||
"browserslist": [ | ||
"extends browserslist-config-openmrs" | ||
], | ||
"keywords": [ | ||
"openmrs" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/palladiumkenya/kenyaemr-esm-core#readme" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/palladiumkenya/kenyaemr-esm-core/issues" | ||
}, | ||
"dependencies": { | ||
"@carbon/react": "^1.42.1", | ||
"lodash-es": "^4.17.15", | ||
"react-to-print": "^2.14.13" | ||
}, | ||
"peerDependencies": { | ||
"@openmrs/esm-framework": "5.x", | ||
"react": "^18.1.0", | ||
"react-i18next": "11.x", | ||
"react-router-dom": "6.x", | ||
"swr": "2.x" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^5.74.0" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/esm-lab-manifest-app/src/component/lab-manifest-detail.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useParams } from 'react-router-dom'; | ||
import LabManifestDetailHeader from '../header/lab-manifest-detail-header.component'; | ||
import { LabManifestHeader } from '../header/lab-manifest-header.component'; | ||
import { LabManifestTabs } from '../tabs/lab-manifest-tabs-component'; | ||
|
||
const LabManifestDetail = () => { | ||
const { manifestUuid } = useParams(); | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div> | ||
<LabManifestHeader title={t('labManifest', 'Lab Manifest')} /> | ||
<LabManifestDetailHeader manifestUuid={manifestUuid} /> | ||
<LabManifestTabs manifestUuid={manifestUuid} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LabManifestDetail; |
18 changes: 18 additions & 0 deletions
18
packages/esm-lab-manifest-app/src/component/lab-manifest.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { LabManifestHeader } from '../header/lab-manifest-header.component'; | ||
import LabManifestMetrics from '../metrics/lab-manifest-metrics.component'; | ||
import LabManifestsTable from '../tables/lab-manifest-table.component'; | ||
|
||
const LabManifestComponent: React.FC = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className={`omrs-main-content`}> | ||
<LabManifestHeader title={t('labManifest', 'Lab Manifest')} /> | ||
<LabManifestMetrics /> | ||
<LabManifestsTable /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LabManifestComponent; |
41 changes: 41 additions & 0 deletions
41
packages/esm-lab-manifest-app/src/component/left-panel-link.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { useMemo } from 'react'; | ||
import last from 'lodash-es/last'; | ||
import { BrowserRouter, useLocation } from 'react-router-dom'; | ||
import { ConfigurableLink } from '@openmrs/esm-framework'; | ||
|
||
export interface LinkConfig { | ||
name: string; | ||
title: string; | ||
} | ||
|
||
export function LinkExtension({ config }: { config: LinkConfig }) { | ||
const { name, title } = config; | ||
const location = useLocation(); | ||
const spaBasePath = window.getOpenmrsSpaBase() + 'home'; | ||
|
||
let urlSegment = useMemo(() => decodeURIComponent(last(location.pathname.split('/'))!), [location.pathname]); | ||
|
||
const isUUID = (value) => { | ||
const regex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/; | ||
return regex.test(value); | ||
}; | ||
|
||
if (isUUID(urlSegment)) { | ||
urlSegment = 'lab-manifest'; | ||
} | ||
|
||
return ( | ||
<ConfigurableLink | ||
to={spaBasePath + '/' + name} | ||
className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}> | ||
{title} | ||
</ConfigurableLink> | ||
); | ||
} | ||
|
||
export const createLeftPanelLink = (config: LinkConfig) => () => | ||
( | ||
<BrowserRouter> | ||
<LinkExtension config={config} /> | ||
</BrowserRouter> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Type, validator } from '@openmrs/esm-framework'; | ||
|
||
export const configSchema = {}; | ||
|
||
export type Config = {}; |
Oops, something went wrong.