-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from Rugute/main
Added esm patient clinical view app
- Loading branch information
Showing
121 changed files
with
10,751 additions
and
8 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
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
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
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,3 @@ | ||
const rootConfig = require('../../jest.config.js'); | ||
|
||
module.exports = rootConfig; |
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": "@ampath/esm-patient-clinical-view-app", | ||
"version": "5.2.0", | ||
"description": "Patient clinical view microfrontend for the OpenMRS SPA", | ||
"browser": "dist/ampath-esm-patient-clinical-view-app.js", | ||
"main": "src/index.ts", | ||
"source": true, | ||
"license": "MPL-2.0", | ||
"homepage": "https://github.com/palladiumkenya/ampath-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/ampath-esm-core#readme" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/palladiumkenya/ampath-esm-core/issues" | ||
}, | ||
"dependencies": { | ||
"@carbon/charts-react": "^1.5.2", | ||
"@carbon/react": "^1.12.0", | ||
"d3": "^7.6.1", | ||
"lodash-es": "^4.17.21" | ||
}, | ||
"peerDependencies": { | ||
"@openmrs/esm-framework": "5.x", | ||
"react": "^18.1.0", | ||
"react-i18next": "11.x", | ||
"react-router-dom": "6.x" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^5.74.0" | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
...ages/esm-patient-clinical-view-app/src/case-management/header/case-management-header.scss
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,71 @@ | ||
@use '@carbon/styles/scss/spacing'; | ||
@use '@carbon/styles/scss/type'; | ||
@import '~@openmrs/esm-styleguide/src/vars'; | ||
|
||
.header { | ||
@include type.type-style('body-compact-02'); | ||
color: $text-02; | ||
height: spacing.$spacing-12; | ||
background-color: $ui-02; | ||
border: 1px solid $ui-03; | ||
border-left: 0px; | ||
display: flex; | ||
justify-content: space-between; | ||
margin-bottom: 2rem; | ||
} | ||
|
||
.left-justified-items { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
margin-left: 0.75rem; | ||
} | ||
|
||
.right-justified-items { | ||
@include type.type-style('body-compact-02'); | ||
color: $text-02; | ||
padding-top: 1rem; | ||
} | ||
|
||
.page-name { | ||
@include type.type-style('heading-04'); | ||
} | ||
|
||
.page-labels { | ||
margin-left: 1rem; | ||
|
||
p:first-of-type { | ||
margin-bottom: 0.25rem; | ||
} | ||
} | ||
|
||
.date-and-location { | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
margin-right: 1rem; | ||
} | ||
|
||
.value { | ||
margin-left: 0.25rem; | ||
} | ||
|
||
.middot { | ||
margin: 0 0.5rem; | ||
} | ||
|
||
.view { | ||
@include type.type-style('label-01'); | ||
} | ||
|
||
svg.iconOverrides { | ||
width: 72 !important; | ||
height: 72 !important; | ||
fill: var(--brand-03); | ||
} | ||
|
||
.svgContainer svg { | ||
width: 72px; | ||
height: 72px; | ||
fill: var(--brand-03); | ||
} |
37 changes: 37 additions & 0 deletions
37
packages/esm-patient-clinical-view-app/src/case-management/header/case-management-header.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,37 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Calendar, Location } from '@carbon/react/icons'; | ||
import { useSession, formatDate } from '@openmrs/esm-framework'; | ||
import styles from './case-management-header.scss'; | ||
import CaseManagementIllustration from './case-management-illustration'; | ||
|
||
interface ClaimManagementHeaderProps { | ||
title: string; | ||
} | ||
|
||
export const ClaimManagementHeader: React.FC<ClaimManagementHeaderProps> = ({ title }) => { | ||
const { t } = useTranslation(); | ||
const userSession = useSession(); | ||
const userLocation = userSession?.sessionLocation?.display; | ||
|
||
return ( | ||
<div className={styles.header}> | ||
<div className={styles['left-justified-items']}> | ||
<CaseManagementIllustration /> | ||
<div className={styles['page-labels']}> | ||
<p>{t('caseManagemet', 'Case Management')}</p> | ||
<p className={styles['page-name']}>{title}</p> | ||
</div> | ||
</div> | ||
<div className={styles['right-justified-items']}> | ||
<div className={styles['date-and-location']}> | ||
<Location size={16} /> | ||
<span className={styles.value}>{userLocation}</span> | ||
<span className={styles.middot}>·</span> | ||
<Calendar size={16} /> | ||
<span className={styles.value}>{formatDate(new Date(), { mode: 'standard' })}</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
...esm-patient-clinical-view-app/src/case-management/header/case-management-illustration.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,13 @@ | ||
import React from 'react'; | ||
import { ChartRelationship } from '@carbon/react/icons'; | ||
import styles from './case-management-header.scss'; | ||
|
||
const CaseManagementIllustration: React.FC = () => { | ||
return ( | ||
<div className={styles.svgContainer}> | ||
<ChartRelationship className={styles.iconOverrides} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CaseManagementIllustration; |
32 changes: 32 additions & 0 deletions
32
...atient-clinical-view-app/src/case-management/metrics/case-management-header.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,32 @@ | ||
import React, { useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { WatsonHealthStressBreathEditor } from '@carbon/react/icons'; | ||
import { Button } from '@carbon/react'; | ||
import styles from './case-management-header.scss'; | ||
import { launchWorkspace, navigate, useSession } from '@openmrs/esm-framework'; | ||
|
||
const MetricsHeader = () => { | ||
const { t } = useTranslation(); | ||
const { user } = useSession(); | ||
const metricsTitle = t(' ', 'Case Manager'); | ||
const handleAddCase = () => { | ||
launchWorkspace('case-management-form', { | ||
workspaceTitle: 'Case Management Form', | ||
}); | ||
}; | ||
return ( | ||
<div className={styles.metricsContainer}> | ||
<div className={styles.actionBtn}> | ||
<Button | ||
kind="tertiary" | ||
renderIcon={(props) => <WatsonHealthStressBreathEditor size={16} {...props} />} | ||
iconDescription={t('addCase', 'Add case')} | ||
onClick={handleAddCase}> | ||
{t('addCase', 'Add case')} | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MetricsHeader; |
18 changes: 18 additions & 0 deletions
18
...ges/esm-patient-clinical-view-app/src/case-management/metrics/case-management-header.scss
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 @@ | ||
@use '@carbon/layout'; | ||
@use '@carbon/type'; | ||
@import '~@openmrs/esm-styleguide/src/vars'; | ||
|
||
.metricsContainer { | ||
display: flex; | ||
justify-content: space-between; | ||
background-color: $ui-02; | ||
height: layout.$spacing-10; | ||
align-items: center; | ||
padding: 0 layout.$spacing-06; | ||
float: right; | ||
} | ||
|
||
.metricsTitle { | ||
@include type.type-style('heading-03'); | ||
color: $ui-05; | ||
} |
Oops, something went wrong.