Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
virajwathsalag authored Dec 18, 2024
2 parents 742c34c + 1935156 commit aface66
Show file tree
Hide file tree
Showing 69 changed files with 1,499 additions and 273 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@openmrs/esm-patient-chart",
"private": true,
"version": "8.2.0",
"version": "9.0.0",
"workspaces": [
"packages/*"
],
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-form-engine-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-form-engine-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Wrapper ESM for the O3 React Form Engine",
"browser": "dist/openmrs-esm-form-engine-app.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
},
"peerDependencies": {
"@openmrs/esm-framework": "6.x",
"@openmrs/esm-patient-common-lib": "8.x",
"@openmrs/esm-patient-common-lib": "9.x",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-form-entry-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-form-entry-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Angular form engine for O3",
"browser": "dist/openmrs-esm-form-entry-app.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-generic-patient-widgets-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-generic-patient-widgets-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Generic widgets for the patient chart",
"browser": "dist/openmrs-esm-generic-patient-widgets-app.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
},
"peerDependencies": {
"@openmrs/esm-framework": "6.x",
"@openmrs/esm-patient-common-lib": "8.x",
"@openmrs/esm-patient-common-lib": "9.x",
"dayjs": "1.x",
"react": "^18.2.0",
"react-i18next": "11.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-patient-allergies-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-allergies-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Patient allergies microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-allergies-app.js",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"peerDependencies": {
"@openmrs/esm-framework": "6.x",
"@openmrs/esm-patient-common-lib": "8.x",
"@openmrs/esm-patient-common-lib": "9.x",
"dayjs": "1.x",
"react": "^18.2.0",
"react-i18next": "11.x",
Expand Down
90 changes: 45 additions & 45 deletions packages/esm-patient-allergies-app/translations/pt_BR.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
"add": "Add",
"allergen": "Allergen",
"allergies": "Allergies",
"Allergies": "Allergies",
"allergyDeleted": "Allergy deleted",
"allergyIntolerances": "allergy intolerances",
"allergyNowVisible": "It is now visible on the Allergies page",
"allergySaved": "Allergy saved",
"allergySaveError": "Error saving allergy",
"allergyUpdated": "Allergy updated",
"cancel": "Cancel",
"dateOfOnsetAndComments": "Date of onset and comments",
"delete": "Delete",
"deleteModalConfirmationText": "Are you sure you want to delete this allergy?",
"deletePatientAllergy": "Delete allergy",
"deleting": "Deleting",
"discard": "Discard",
"edit": "Edit",
"editAllergy": "Edit an Allergy",
"editOrDeleteAllergy": "Edit or delete allergy",
"errorDeletingAllergy": "Error deleting allergy",
"invalidComment": "Invalid comment, try again",
"loading": "Loading",
"mild": "Mild",
"moderate": "Moderate",
"name": "Name",
"nonCodedAllergenWarningDescription": "Adding a custom allergen may impact system-wide allergy notifications. It's recommended to choose from the provided list for accurate alerts. Custom entries may not trigger notifications in all relevant contexts.",
"nonCodedAllergenWarningTitle": "Warning: Custom Allergen Entry",
"onsetDateAndComments": "Onset date and comments",
"other": "Other",
"otherNonCodedAllergen": "Other non-coded allergen",
"otherNonCodedAllergicReaction": "Other non-coded allergic reaction",
"reaction": "Reaction",
"reactions": "Reactions",
"recordNewAllergy": "Record a new allergy",
"saveAndClose": "Save and close",
"seeAll": "See all",
"selectAllergen": "Select the allergen",
"selectReactions": "Select the reactions",
"severe": "Severe",
"severityandReaction": "Severity",
"severityOfWorstReaction": "Severity of worst reaction",
"typeAdditionalComments": "Type any additional comments here",
"typeAllergenName": "Please type in the name of the allergen",
"typeAllergicReactionName": "Please type in the name of the allergic reaction"
"add": "Adicionar",
"allergen": "Alérgeno",
"allergies": "Alergias",
"Allergies": "Alergias",
"allergyDeleted": "Alergia excluída",
"allergyIntolerances": "intolerâncias alérgicas",
"allergyNowVisible": "Agora está visível na página de Alergias",
"allergySaved": "Alergia gravada",
"allergySaveError": "Erro ao gravar alergia",
"allergyUpdated": "Alergia atualizada",
"cancel": "Cancelar",
"dateOfOnsetAndComments": "Data de início e comentários",
"delete": "Apagar",
"deleteModalConfirmationText": "Tem certeza de que deseja remover esta alergia?",
"deletePatientAllergy": "Apagar alergia",
"deleting": "Removendo",
"discard": "Descartar",
"edit": "Editar",
"editAllergy": "Editar uma Alergia",
"editOrDeleteAllergy": "Editar ou apagar alergia",
"errorDeletingAllergy": "Erro ao apagar alergia",
"invalidComment": "Comentário inválido, tente novamente",
"loading": "Carregando",
"mild": "Leve",
"moderate": "Moderado",
"name": "Nome",
"nonCodedAllergenWarningDescription": "Adicionar um alérgeno personalizado pode afetar as notificações de alergia em todo o sistema. É recomendado escolher na lista correta fornecida para melhores alertas. As entradas personalizadas podem não acionar notificações em todos os contextos relevantes.",
"nonCodedAllergenWarningTitle": "Aviso: Entrada personalizada de alérgenos",
"onsetDateAndComments": "Data de início e comentários",
"other": "Outro",
"otherNonCodedAllergen": "Outro alergeno não codificado",
"otherNonCodedAllergicReaction": "Outra reação alérgica não codificada",
"reaction": "Reação",
"reactions": "Reações",
"recordNewAllergy": "Registar nova alergia",
"saveAndClose": "Salvar e fechar",
"seeAll": "Ver tudo",
"selectAllergen": "Selecione o alérgeno",
"selectReactions": "Selecione as reações",
"severe": "Severa",
"severityandReaction": "Gravidade",
"severityOfWorstReaction": "Gravidade da pior reação",
"typeAdditionalComments": "Descreva qualquer comentário adicional aqui",
"typeAllergenName": "Por favor digite o nome do alérgeno",
"typeAllergicReactionName": "Por favor digite o nome da reação alérgica"
}
6 changes: 3 additions & 3 deletions packages/esm-patient-attachments-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-attachments-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Patient attachments microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-attachments-app.js",
Expand Down Expand Up @@ -38,14 +38,14 @@
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@openmrs/esm-patient-common-lib": "^8.2.0",
"@openmrs/esm-patient-common-lib": "^9.0.0",
"lodash-es": "^4.17.21",
"react-grid-gallery": "^0.5.6",
"react-html5-camera-photo": "^1.5.11"
},
"peerDependencies": {
"@openmrs/esm-framework": "6.x",
"@openmrs/esm-patient-common-lib": "8.x",
"@openmrs/esm-patient-common-lib": "9.x",
"dayjs": "1.x",
"react": "^18.2.0",
"react-i18next": "11.x",
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-patient-banner-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-banner-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Patient banner microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-banner-app.js",
Expand Down Expand Up @@ -38,12 +38,12 @@
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@openmrs/esm-patient-common-lib": "^8.2.0",
"@openmrs/esm-patient-common-lib": "^9.0.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
"@openmrs/esm-framework": "6.x",
"@openmrs/esm-patient-common-lib": "8.x",
"@openmrs/esm-patient-common-lib": "9.x",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-chart-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/esm-patient-chart-app",
"version": "8.2.0",
"version": "9.0.0",
"license": "MPL-2.0",
"description": "Patient dashboard microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-chart-app.js",
Expand Down
18 changes: 18 additions & 0 deletions packages/esm-patient-chart-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ export const esmPatientChartSchema = {
_default: '/etl-latest/etl/patient/',
_description: 'Custom URL to load resources required for showing recommended visit types',
},
trueConceptUuid: {
_type: Type.String,
_description: 'Default concept uuid for true in forms',
_default: '1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
},
falseConceptUuid: {
_type: Type.String,
_description: 'Default concept uuid for false in forms',
_default: '1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
},
otherConceptUuid: {
_type: Type.String,
_description: 'Default concept uuid for other in forms',
_default: '5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
},
};

export interface ChartConfig {
Expand Down Expand Up @@ -161,4 +176,7 @@ export interface ChartConfig {
uuid: string;
}>;
visitDiagnosisConceptUuid: string;
trueConceptUuid: string;
falseConceptUuid: string;
otherConceptUuid: string;
}
2 changes: 2 additions & 0 deletions packages/esm-patient-chart-app/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const clinicalFormsWorkspace = 'clinical-forms-workspace';
export const formEntryWorkspace = 'patient-form-entry-workspace';
export const spaRoot = window['getOpenmrsSpaBase']();
export const basePath = '/patient/:patientUuid/chart';
export const dashboardPath = `${basePath}/:view/*`;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React, { useMemo } from 'react';
import { useConfig, usePatient, useVisit } from '@openmrs/esm-framework';
import { useTranslation } from 'react-i18next';
import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
import { EncounterList } from './encounter-list.component';
import { getMenuItemTabsConfiguration } from '../utils/encounter-list-config-builder';
import styles from './encounter-list-tabs.scss';
import { filter } from '../utils/helpers';
import { type Encounter } from '../types';

interface EncounterListTabsComponentProps {
patientUuid: string;
}

const EncounterListTabsComponent: React.FC<EncounterListTabsComponentProps> = ({ patientUuid }) => {
const config = useConfig();
const { tabDefinitions = [] } = config;
const configConcepts = {
trueConceptUuid: config.trueConceptUuid,
falseConceptUuid: config.falseConceptUuid,
otherConceptUuid: config.otherConceptUuid,
};
const { t } = useTranslation();
const tabsConfig = getMenuItemTabsConfiguration(tabDefinitions, configConcepts);
const patient = usePatient(patientUuid);
const { currentVisit } = useVisit(patientUuid);
const tabFilters = useMemo(() => {
return tabsConfig.map((tab) => ({
name: tab.name,
filter: tab.hasFilter ? (encounter: Encounter) => filter(encounter, tab.formList?.[0]?.uuid) : null,
}));
}, [tabsConfig]);

return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained>
{tabsConfig.map((tab) => (
<Tab key={tab.name}>{t(tab.name)}</Tab>
))}
</TabList>
<TabPanels>
{tabsConfig.map((tab) => {
const tabFilter = tabFilters.find((t) => t.name === tab.name)?.filter;

return (
<TabPanel key={tab.name}>
<EncounterList
filter={tabFilter}
patientUuid={patientUuid}
formList={tab.formList}
columns={tab.columns}
encounterType={tab.encounterType}
launchOptions={tab.launchOptions}
headerTitle={tab.headerTitle}
description={tab.description}
currentVisit={currentVisit}
deathStatus={patient?.patient?.deceasedBoolean}
/>
</TabPanel>
);
})}
</TabPanels>
</Tabs>
</div>
);
};

export default EncounterListTabsComponent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.tabContainer div[role='tabpanel'] {
padding: 0 !important;
}

.tabContainer li button {
width: 100% !important;
}
Loading

0 comments on commit aface66

Please sign in to comment.