Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
arodidev authored May 13, 2024
2 parents 3871aa2 + 0fbbc6e commit 4ecf712
Show file tree
Hide file tree
Showing 28 changed files with 457 additions and 97 deletions.
57 changes: 28 additions & 29 deletions frontend/spa-build-config.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
{
"frontendModules": {
"@ohri/openmrs-esm-ohri-core-app": "next",
"@ohri/openmrs-esm-ohri-form-render-app": "next",
"@ohri/openmrs-esm-ohri-hiv-app": "next",
"@ohri/openmrs-esm-ohri-covid-app": "next",
"@ohri/openmrs-esm-ohri-pmtct": "next",
"@ohri/openmrs-esm-ohri-tb-app": "next",
"@ohri/openmrs-esm-ohri-cervical-cancer-app": "next",
"@openmrs/esm-appointments-app": "next",
"@openmrs/esm-dispensing-app": "next",
"@openmrs/esm-form-builder-app": "next",
"@openmrs/esm-home-app": "next",
"@openmrs/esm-devtools-app": "next",
"@openmrs/esm-implementer-tools-app": "next",
"@openmrs/esm-login-app": "next",
"@openmrs/esm-outpatient-app": "next",
"@openmrs/esm-primary-navigation-app": "next",
"@openmrs/esm-home-app": "next",
"@openmrs/esm-form-engine-app": "next",
"@openmrs/esm-generic-patient-widgets-app": "next",
"@openmrs/esm-patient-allergies-app": "next",
"@openmrs/esm-patient-appointments-app": "next",
"@openmrs/esm-patient-attachments-app": "next",
"@openmrs/esm-patient-banner-app": "next",
"@openmrs/esm-patient-chart-app": "next",
"@ohri/esm-patient-chart-app": "next",
"@openmrs/esm-patient-conditions-app": "next",
"@openmrs/esm-patient-forms-app": "next",
"@openmrs/esm-patient-immunizations-app": "next",
"@openmrs/esm-patient-list-app": "next",
"@openmrs/esm-patient-flags-app": "next",
"@openmrs/esm-patient-labs-app": "next",
"@openmrs/esm-patient-lists-app": "next",
"@openmrs/esm-patient-medications-app": "next",
"@openmrs/esm-patient-notes-app": "next",
"@openmrs/esm-patient-orders-app": "next",
"@openmrs/esm-patient-programs-app": "next",
"@openmrs/esm-patient-search-app": "next",
"@openmrs/esm-patient-test-results-app": "next",
"@openmrs/esm-patient-vitals-app": "next",
"@openmrs/esm-primary-navigation-app": "next",
"@openmrs/esm-active-visits-app": "next",
"@openmrs/esm-appointments-app": "next",
"@openmrs/esm-service-queues-app": "next",
"@openmrs/esm-patient-list-management-app": "next",
"@openmrs/esm-patient-registration-app": "next",
"@openmrs/esm-devtools-app": "next",
"@openmrs/esm-patient-search-app": "next",
"@openmrs/esm-openconceptlab-app": "next",
"@openmrs/esm-generic-patient-widgets-app": "next",
"@openmrs/esm-patient-lists-app": "next",
"@openmrs/esm-cohort-builder-app": "next",
"@openmrs/esm-patient-list-management-app": "next",
"@openmrs/esm-service-queues-app": "next",
"@openmrs/esm-form-entry-app": "next",
"@openmrs/esm-patient-labs-app": "next",
"@openmrs/esm-system-admin-app": "next",
"@openmrs/esm-dispensing-app": "next",
"@openmrs/esm-fast-data-entry-app": "next",
"@openmrs/esm-patient-orders-app": "next",
"@openmrs/esm-system-admin-app": "next"
"@openmrs/esm-cohort-builder-app": "next",
"@ohri/openmrs-esm-ohri-core-app": "next",
"@ohri/openmrs-esm-ohri-hiv-app": "next",
"@ohri/openmrs-esm-ohri-covid-app": "next",
"@ohri/openmrs-esm-ohri-pmtct": "next",
"@ohri/openmrs-esm-ohri-tb-app": "next",
"@ohri/openmrs-esm-ohri-cervical-cancer-app": "next",
"@ohri/openmrs-esm-ohri-form-render-app": "next",
"@openmrs/esm-stock-management-app": "next",
"@openmrs/esm-billing-app": "next",
"@ohri/openmrs-esm-ohri-opd-app": "next"
},
"spaPath": "$SPA_PATH",
"apiUrl": "$API_URL",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"start:pmtct": "openmrs develop --backend https://ohri-namibia-dev.globalhealthapp.net --sources 'packages/esm-ohri-pmtct-app/'",
"start:form-render": "openmrs develop --backend https://ohri-dev.globalhealthapp.net --sources packages/esm-form-render-app",
"start:tb": "openmrs develop --backend https://ohri-dev.globalhealthapp.net --sources packages/esm-tb-app",
"start:opd": "openmrs develop --backend https://ohri-dev.globalhealthapp.net --sources packages/esm-opd-app",
"prettier": "prettier --fix --config prettier.config.js --write \"packages/**/*.{ts,tsx}\"",
"prepare": "husky install",
"test": "jest --config jest.config.js --verbose false --passWithNoTests",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-commons-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@carbon/react": "^1.13.0",
"@openmrs/openmrs-form-engine-lib": "next",
"@openmrs/openmrs-form-engine-lib": "1.1.0-pre.723",
"fuzzy": "^0.1.3",
"lodash-es": "^4.17.15",
"systemjs-webpack-interop": "^2.3.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { navigate, showModal, showSnackbar } from '@openmrs/esm-framework';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { EmptyState } from '../empty-state/empty-state.component';
import { OHRIFormLauncherWithIntent } from '../ohri-form-launcher/ohri-form-launcher.component';
import { FormLauncherWithIntent } from '../ohri-form-launcher/ohri-form-launcher.component';
import styles from './encounter-list.scss';
import { OTable } from '../data-table/o-table.component';
import { Button, Link, OverflowMenu, OverflowMenuItem, Pagination, DataTableSkeleton } from '@carbon/react';
import { Add } from '@carbon/react/icons';
import { OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib';
import { FormSchema } from '@openmrs/openmrs-form-engine-lib';
import { deleteEncounter, launchEncounterForm } from './helpers';
import { useEncounterRows } from '../../hooks/useEncounterRows';
import { OpenmrsEncounter } from '../../api/types';
Expand Down Expand Up @@ -56,7 +56,7 @@ export const EncounterList: React.FC<EncounterListProps> = ({
}) => {
const { t } = useTranslation();
const [paginatedRows, setPaginatedRows] = useState([]);
const [forms, setForms] = useState<OHRIFormSchema[]>([]);
const [forms, setForms] = useState<FormSchema[]>([]);
const [currentPage, setCurrentPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [isLoadingForms, setIsLoadingForms] = useState(true);
Expand Down Expand Up @@ -265,7 +265,7 @@ export const EncounterList: React.FC<EncounterListProps> = ({
if (forms.length == 1 && !forms[0]['availableIntents']?.length) {
// we only have one form with no intents
// just return the "Add" button
return (
return (
<Button
kind="ghost"
renderIcon={Add}
Expand All @@ -288,8 +288,8 @@ export const EncounterList: React.FC<EncounterListProps> = ({
</Button>
);
} else if (forms.length && !(hideFormLauncher ?? isDead)) {
return () => (
<OHRIFormLauncherWithIntent
return (
<FormLauncherWithIntent
formJsonList={forms}
launchForm={(formJson, intent) =>
launchEncounterForm(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jest.mock('@openmrs/esm-patient-common-lib', () => ({
}));

jest.mock('@openmrs/openmrs-form-engine-lib', () => ({
OHRIForm: jest
FormEngine: jest
.fn()
.mockImplementation(() => React.createElement('div', { 'data-testid': 'openmrs form' }, 'FORM ENGINE LIB')),
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib';
import { OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib';
import { FormSchema } from '@openmrs/openmrs-form-engine-lib';

type LaunchAction = 'add' | 'view' | 'edit' | 'embedded-view';

export function launchEncounterForm(
form: OHRIFormSchema,
form: FormSchema,
moduleName: string,
action: LaunchAction = 'add',
onFormSave: () => void,
Expand All @@ -21,7 +21,7 @@ export function launchEncounterForm(
mutateform: mutateform,
formInfo: {
encounterUuid,
formUuid: form.uuid,
formUuid: form.name,
patientUuid: patientUuid,
visitTypeUuid: '',
visitUuid: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button } from '@carbon/react';
import { Add } from '@carbon/react/icons';
import { useTranslation } from 'react-i18next';

export const OHRIFormLauncherEmpty: React.FC<{
export const FormLauncherEmpty: React.FC<{
launchForm: (formJson?: any) => void;
}> = ({ launchForm }) => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from './launcher-with-intent.scss';
import { useTranslation } from 'react-i18next';
import { OHRIOverflowMenu } from '../overflow-menu-button/ohri-overflow-menu.component';

export const OHRIFormLauncherWithIntent: React.FC<{
export const FormLauncherWithIntent: React.FC<{
launchForm: (formJson?: any, intent?: string) => void;
title?: string;
formJsonList?: Array<any>;
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-commons-lib/src/utils/ohri-forms-commons.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { OHRIFormSchema, SessionMode } from '@openmrs/openmrs-form-engine-lib';
import { FormSchema, SessionMode } from '@openmrs/openmrs-form-engine-lib';
import { launchOHRIWorkSpace } from '../workspace/ohri-workspace-utils';

export const launchForm = (
form: OHRIFormSchema,
form: FormSchema,
mode: SessionMode = 'enter',
moduleName: string,
title?: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getSyncLifecycle } from '@openmrs/esm-framework';
import { BehaviorSubject } from 'rxjs';
import { closeWorkspace, launchPatientWorkspace, registerWorkspace } from '@openmrs/esm-patient-common-lib';
import { OHRIForm, SessionMode } from '@openmrs/openmrs-form-engine-lib';
import { FormEngine, SessionMode } from '@openmrs/openmrs-form-engine-lib';
export interface WorkspaceContextProps {
title: string;
encounterUuid?: string;
Expand Down Expand Up @@ -30,7 +30,7 @@ export const launchOHRIWorkSpace = (props: WorkspaceContextProps) => {
name: workspaceName,
title: props.title,
preferredWindowSize: <any>props.screenSize,
load: getSyncLifecycle(OHRIForm, {
load: getSyncLifecycle(FormEngine, {
featureName: 'ohri-forms-workspace-item',
moduleName: props.moduleName,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-form-render-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@carbon/react": "^1.13.0",
"@openmrs/openmrs-form-engine-lib": "next",
"@openmrs/openmrs-form-engine-lib": "1.1.0-pre.723",
"ace-builds": "^1.4.12",
"react-ace": "^9.4.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from './form-render.scss';
import { Run, Maximize, UserData } from '@carbon/react/icons';
import AceEditor from 'react-ace';
import 'ace-builds/webpack-resolver';
import { applyFormIntent, loadSubforms, OHRIForm, OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib';
import { applyFormIntent, loadSubforms, FormEngine, FormSchema } from '@openmrs/openmrs-form-engine-lib';
import { useTranslation } from 'react-i18next';
import { ConfigObject, useConfig, openmrsFetch } from '@openmrs/esm-framework';
import { handleFormValidation } from '../form-validator';
Expand All @@ -13,7 +13,7 @@ function FormRenderTest() {
const { t } = useTranslation();
const headerTitle = t('formRenderTestTitle', 'Form Render Test');
const { patientUuid, dataTypeToRenderingMap } = useConfig() as ConfigObject;
const [formInput, setFormInput] = useState<OHRIFormSchema>();
const [formInput, setFormInput] = useState<FormSchema>();
const [formIntents, setFormIntents] = useState([]);
const [isIntentsDropdownDisabled, setIsIntentsDropdownDisabled] = useState(true);
const [selectedFormIntent, setSelectedFormIntent] = useState('');
Expand Down Expand Up @@ -267,7 +267,7 @@ function FormRenderTest() {
<TabPanel className={styles.renderTab}>
{isSchemaLoaded ? (
<div className={styles.formRenderDisplay}>
<OHRIForm
<FormEngine
formJson={formInput}
patientUUID={patientUuid}
mode={encounterUuid ? 'edit' : 'enter'}
Expand Down
3 changes: 1 addition & 2 deletions packages/esm-ohri-pmtct-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"url": "https://github.com/UCSF-IGHS/openmrs-esm-ohri/issues"
},
"dependencies": {
"@carbon/react": "^1.13.0",
"@openmrs/openmrs-form-engine-lib": "next"
"@carbon/react": "^1.13.0"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-ohri-pmtct-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const configSchema = {
_type: Type.Object,
_description: 'List of uuids for PMTCT forms.',
_default: {
antenatal: '',
antenatal: '5255a535-2acb-3f44-bd0a-3f80595dece1',
labourAndDelivery: '1e5614d6-5306-11e6-beb8-9e71128cae77',
motherPostnatal: 'e6b67aa4-6c59-4470-8ad5-b994efeda553',
infantPostnatal: '5022c5d7-ea45-47ce-bd65-1ba1d8ad2467',
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-ohri-pmtct-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import {
OHRIHome,
OHRIWelcomeSection,
createConditionalDashboardGroup,
createDashboardLink,
} from '@ohri/openmrs-esm-ohri-commons-lib';
import { generateInfantPTrackerId } from './utils/pmtct-helpers';
import { configSchema } from './config-schema';
import rootComponent from './root.component';
import { createDashboardLink } from '@openmrs/esm-patient-common-lib';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');

Expand Down
55 changes: 55 additions & 0 deletions packages/esm-opd-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@ohri/openmrs-esm-ohri-opd-app",
"version": "2.2.0",
"description": "opd active visits",
"browser": "dist/openmrs-esm-ohri-opd-app.js",
"main": "src/index.ts",
"license": "MIT",
"homepage": "https://github.com/UCSF-IGHS/openmrs-esm-ohri#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 tsx",
"typescript": "tsc",
"prepublishOnly": "npm run build",
"extract-translations": "i18next 'src/**/*.component.tsx'"
},
"browserslist": [
"extends browserslist-config-openmrs"
],
"keywords": [
"openmrs",
"ohri",
"opd"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/UCSF-IGHS/openmrs-esm-ohri.git"
},
"bugs": {
"url": "https://github.com/UCSF-IGHS/openmrs-esm-ohri/issues"
},
"dependencies": {
"@carbon/react": "^1.13.0",
"@ohri/esm-patient-chart-app": "7.1.0-5"
},
"peerDependencies": {
"@ohri/esm-patient-chart-app": "7.1.0-5",
"@openmrs/esm-framework": "5.x",
"@openmrs/esm-patient-common-lib": "6.x",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
"swr": "2.x"
},
"devDependencies": {
"@ohri/esm-patient-chart-app": "7.1.0-5",
"webpack": "^5.88.2"
}
}
1 change: 1 addition & 0 deletions packages/esm-opd-app/src/config-schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const configSchema = {};
12 changes: 12 additions & 0 deletions packages/esm-opd-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const opdFolderMeta = {
title: 'OPD',
slotName: 'opd-slot',
isExpanded: false,
};

export const activeVisitDashboardMeta = {
slot: 'patient-chart-active-visit-dashboard-slot',
columns: 1,
path: 'Active Visits',
title: 'Active Visits',
};
21 changes: 21 additions & 0 deletions packages/esm-opd-app/src/dashboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@import "./root.scss";

.noMarker {
list-style-type: none;
}

.noMarker ul li a {
padding-left: 40px !important;
font: lighter;
}

.currentNavItem > a {
background-color: #cecece !important;
color: #161616 !important;
border-left-color: var(--brand-01) !important;
font: bolder;
}

.hide {
display: none;
}
2 changes: 2 additions & 0 deletions packages/esm-opd-app/src/declarations.d.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '*.css';
declare module '*.scss';
Loading

0 comments on commit 4ecf712

Please sign in to comment.