Skip to content

Commit

Permalink
Merge pull request #117 from Rugute/main
Browse files Browse the repository at this point in the history
Added esm patient clinical view app
  • Loading branch information
Rugute authored Jul 16, 2024
2 parents 5355df2 + 2ea122b commit a892655
Showing 121 changed files with 10,751 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/esm-billing-app/src/billing.resource.ts
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ export const processBillPayment = (payload, billUuid: string) => {

export function useDefaultFacility() {
const { authenticated } = useSession();
const url = '/ws/rest/v1/kenyaemr/default-facility';
const url = '/ws/rest/v1/amrs/default-facility';
const { data, isLoading } = useSWR<{ data: FacilityDetail }>(authenticated ? url : null, openmrsFetch, {});
return { data: data?.data, isLoading: isLoading };
}
2 changes: 1 addition & 1 deletion packages/esm-billing-app/src/routes.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.openmrs.org/routes.schema.json",
"backendDependencies": {
"amrs": "^1.0.0",
"ampathemr": "^1.0.0",
"amrsreporting": "^1.0.0"
},
"pages": [
2 changes: 1 addition & 1 deletion packages/esm-care-panel-app/src/routes.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.openmrs.org/routes.schema.json",
"backendDependencies": {
"amrs": "^1.0.0"
"ampathemr": "^1.0.0"
},
"pages": [],
"extensions": [
3 changes: 3 additions & 0 deletions packages/esm-patient-clinical-view-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const rootConfig = require('../../jest.config.js');

module.exports = rootConfig;
54 changes: 54 additions & 0 deletions packages/esm-patient-clinical-view-app/package.json
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"
}
}
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);
}
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}>&middot;</span>
<Calendar size={16} />
<span className={styles.value}>{formatDate(new Date(), { mode: 'standard' })}</span>
</div>
</div>
</div>
);
};
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;
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;
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;
}
Loading

0 comments on commit a892655

Please sign in to comment.