Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shortcult link to 2.x #9

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions src/app-menu-navigation/app-menu-navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ConfigurableLink } from "@openmrs/esm-framework";
import React from "react";
import { useTranslation } from "react-i18next";
import { versionTwoPath } from "../constants";

const VersionTwoNavigationButton = () => {
const { t } = useTranslation();

return (
<ConfigurableLink to={versionTwoPath}>
{t("rwandaEmr2", "Rwanda EMR 2.X")}
</ConfigurableLink>
);
};

export default VersionTwoNavigationButton;
63 changes: 63 additions & 0 deletions src/common.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/colors';
@use '@carbon/styles/scss/type';
@import "~@openmrs/esm-styleguide/src/vars";
@import './root.scss';

// .widgetContainer {
Expand Down Expand Up @@ -36,3 +39,63 @@
.hivStatusTag {
min-width: 80px;
}

.title {
@extend .productiveHeading03;
}

.cardTitle {
display: flex;
justify-content: space-between;
padding: spacing.$spacing-04 0 spacing.$spacing-04 spacing.$spacing-05;
}

.cardTitle>h4:after {
content: "";
display: block;
width: 2rem;
padding-top: 0.188rem;
// border-bottom: 0.375rem solid $brand-teal-01;
}

.tile {
height: 100%;
padding: 0.5rem;
margin: 0.5rem;
border: solid 1px #e0e0e0;
display: flex;
flex-direction: column;
flex: 1;
background-color: #ffffff;
}

.tileTitle {
@include type.type-style('label-01');
display: block;
}

.tileValue {
display: block;
font-size: 20px;
line-height: 1.29;
color: #161616;
display: block;
margin: 15px 65px 24px 0;
}

.tileBox {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

.tileBoxColumn {
flex: 1 1 100px;
display: flex;
flex-direction: column;
align-items: flex-start;
padding-left: 1rem;
}



8 changes: 4 additions & 4 deletions src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const configSchema = {
oiEncounterType: "2dc31190-cf0e-4ab0-a5a1-6ad601d6ecc0",
imageEncounterType: "74bf4fe6-8fdb-4228-be39-680a93a9cf6d",
problemEncounterType: "2dc31190-cf0e-4ab0-a5a1-6ad601d6ecc0",
adultReturnEncountertype: "8d5b2be0-c2cc-11de-8d13-0010c6dffd0f",
},
},
obsConcepts: {
Expand All @@ -32,11 +33,10 @@ export const configSchema = {
whoStageConcept: "3cdb3b02-26fe-102b-80cb-0017a47871b2",
criteriaConcept: "3ce6d5fc-26fe-102b-80cb-0017a47871b2",
imageOrderedConcept: "3cd937e4-26fe-102b-80cb-0017a47871b2",
oiConcept: "",
programStatusConcept: "",
viralLoadConcept: "",
oiConcept: "0ae23a5a-15f5-102d-96e4-000c29c2a5d7",
viralLoadConcept: " 3cd4a882-26fe-102b-80cb-0017a47871b2",
vlReasonConcept: "",
lastCd4CountConcept: "",
lastCd4CountConcept: "3ceda710-26fe-102b-80cb-0017a47871b2",
artCohortConcept: "",
currentRegimenConcept: "",
dsdModelConcept: "",
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const versionTwoPath = `/openmrs/`;
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
import AllEncounters from "./encounters/encounters.component";
import PatientSummary from "./patient-summary/patient-summary.component";
import CareAndTreatment from "./care-and-treatment/care-and-treatment.component";
import versionTwoNavigationButton from "./app-menu-navigation/app-menu-navigation";

const moduleName = "@ohri/openmrs-esm-rwanda-app";

const options = {
Expand Down Expand Up @@ -69,3 +71,8 @@ export const hivProgramManagementSummary = getSyncLifecycle(
CareAndTreatment,
options
);

export const versionTwoNavLink = getSyncLifecycle(
versionTwoNavigationButton,
options
);
22 changes: 11 additions & 11 deletions src/patient-summary/patient-summary-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
"encounterTypes": [
"visitEncounterType"
],
"concept": "artCohortConcept"
"concept": "15 - May - 2024"
},
{
"id": "currentRegimen",
"title": "Current Regimen",
"encounterTypes": [
"visitEncounterType"
],
"concept": "currentRegimenConcept"
"concept": "ABC + 3TC + ATVr"
},
{
"id": "dsdModel",
"title": "DSD Model",
"encounterTypes": [
"visitEncounterType"
],
"concept": "dsdModelConcept"
"concept": "Community medication distribution"
},
{
"id": "populationType",
"title": "Population Type",
"encounterTypes": [
"visitEncounterType"
],
"concept": "populationTypeConcept"
"concept": "General Population"
}
]
},
Expand All @@ -49,23 +49,23 @@
"encounterTypes": [
"visitEncounterType"
],
"concept": "viralLoadConcept"
"concept": "Undetected"
},
{
"id": "vlReason",
"title": "Reason For Current VL",
"encounterTypes": [
"visitEncounterType"
],
"concept": "vlReasonConcept"
"concept": "Routine"
},
{
"id": "lastCd4Count",
"title": "Last Cd4 Count",
"encounterTypes": [
"visitEncounterType"
],
"concept": "lastCd4CountConcept"
"concept": "252"
}
]
},
Expand All @@ -79,15 +79,15 @@
"encounterTypes": [
"visitEncounterType"
],
"concept": "tbScreeningConcept"
"concept": "Positive"
},
{
"id": "oi",
"title": "Opportunistic Infections",
"encounterTypes": [
"visitEncounterType"
],
"concept": "oiConcept"
"concept": "None"
},
{
"id": "nextVisit",
Expand All @@ -96,15 +96,15 @@
"encounterTypes": [
"visitEncounterType"
],
"concept": "nextVisitConcept"
"concept": "2024-09-01"
},
{
"id": "programStatus",
"title": "Program Status",
"encounterTypes": [
"visitEncounterType"
],
"concept": "programStatusConcept"
"concept": "Active"
}
]
}
Expand Down
21 changes: 14 additions & 7 deletions src/patient-summary/patient-summary.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,34 @@
import styles from "../common.scss";
import patientSummaryConfigWorkflow from "./patient-summary-config.json";
import {
getSummaryCardProps,

Check warning on line 6 in src/patient-summary/patient-summary.component.tsx

View workflow job for this annotation

GitHub Actions / build

'getSummaryCardProps' is defined but never used
SummaryCard,

Check warning on line 7 in src/patient-summary/patient-summary.component.tsx

View workflow job for this annotation

GitHub Actions / build

'SummaryCard' is defined but never used
} from "@ohri/openmrs-esm-ohri-commons-lib";
import { Tile } from "@carbon/react";
import { CardHeader } from "@openmrs/esm-patient-common-lib";

interface PatientSummaryProps {
patientUuid: string;
}

const PatientSummary: React.FC<PatientSummaryProps> = ({ patientUuid }) => {

Check warning on line 16 in src/patient-summary/patient-summary.component.tsx

View workflow job for this annotation

GitHub Actions / build

'patientUuid' is defined but never used
const config = useConfig();

Check warning on line 17 in src/patient-summary/patient-summary.component.tsx

View workflow job for this annotation

GitHub Actions / build

'config' is assigned a value but never used
const cards = patientSummaryConfigWorkflow.cardDefinitions;

return (
<div className={styles.tabContainer}>
{cards.map((cardContent) => (
<SummaryCard
key={cardContent.cardId}
headerTitle={cardContent.cardTitle}
patientUuid={patientUuid}
columns={getSummaryCardProps(cardContent, config)}
/>
{cards.map((card) => (
<Tile key={card.cardId} className={styles.tile}>
<CardHeader title={card.cardTitle}> </CardHeader>
<div className={styles.tileBox}>
{card.columns.map((column) => (
<div key={column.id} className={styles.tileBoxColumn}>
<span className={styles.tileTitle}>{column.title}</span>
<span className={styles.tileValue}>{column.concept}</span>
</div>
))}
</div>
</Tile>
))}
</div>
);
Expand Down
12 changes: 12 additions & 0 deletions src/root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@
.explainer {
margin-bottom: 2rem;
}

.productiveHeading01 {
@include type.type-style("heading-compact-01");
}

.productiveHeading02 {
@include type.type-style("heading-compact-02");
}

.productiveHeading03 {
@include type.type-style("heading-03");
}
7 changes: 7 additions & 0 deletions src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
"name": "hiv-patient-program-ext",
"slot": "hiv-patient-program-management-slot",
"component": "hivProgramManagementSummary"
},
{
"name": "version-two-link",
"slot": "app-menu-slot",
"component": "versionTwoNavLink",
"online": true,
"offline": true
}
]
}
Loading