@pucp-gidis-hiisc/esm-fua-app 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-extract-translations.log +11 -0
- package/.turbo/turbo-lint.log +0 -0
- package/.turbo/turbo-test.log +1 -0
- package/.turbo/turbo-typescript.log +0 -0
- package/README.md +9 -0
- package/dist/@pucp-gidis-hiisc/esm-dyaku-app.3156ff9f6a47f657.hot-update.js +11 -0
- package/dist/@pucp-gidis-hiisc/esm-dyaku-app.3156ff9f6a47f657.hot-update.js.map +1 -0
- package/dist/@pucp-gidis-hiisc/esm-dyaku-app.52df2f9ab9342568.hot-update.js +11 -0
- package/dist/@pucp-gidis-hiisc/esm-dyaku-app.52df2f9ab9342568.hot-update.js.map +1 -0
- package/dist/@pucp-gidis-hiisc/esm-dyaku-app.670ae221c7eb0597.hot-update.js +11 -0
- package/dist/@pucp-gidis-hiisc/esm-dyaku-app.670ae221c7eb0597.hot-update.js.map +1 -0
- package/dist/_pucp-gidis-hiisc_esm-dyaku-app.3156ff9f6a47f657.hot-update.json +1 -0
- package/dist/_pucp-gidis-hiisc_esm-dyaku-app.52df2f9ab9342568.hot-update.json +1 -0
- package/dist/_pucp-gidis-hiisc_esm-dyaku-app.670ae221c7eb0597.hot-update.json +1 -0
- package/dist/main.3156ff9f6a47f657.hot-update.js +11 -0
- package/dist/main.3156ff9f6a47f657.hot-update.js.map +1 -0
- package/dist/main.3156ff9f6a47f657.hot-update.json +1 -0
- package/dist/main.52df2f9ab9342568.hot-update.js +11 -0
- package/dist/main.52df2f9ab9342568.hot-update.js.map +1 -0
- package/dist/main.52df2f9ab9342568.hot-update.json +1 -0
- package/dist/main.670ae221c7eb0597.hot-update.js +11 -0
- package/dist/main.670ae221c7eb0597.hot-update.js.map +1 -0
- package/dist/main.670ae221c7eb0597.hot-update.json +1 -0
- package/dist/main.js +5012 -0
- package/dist/main.js.map +1 -0
- package/dist/node_modules_babel_runtime_helpers_esm_objectWithoutPropertiesLoose_js.js +28 -0
- package/dist/node_modules_babel_runtime_helpers_esm_objectWithoutPropertiesLoose_js.js.map +1 -0
- package/dist/node_modules_client-only_index_js-node_modules_use-sync-external-store_shim_index_js-_e121-_afc40.js +137 -0
- package/dist/node_modules_client-only_index_js-node_modules_use-sync-external-store_shim_index_js-_e121-_afc40.js.map +1 -0
- package/dist/node_modules_client-only_index_js-node_modules_use-sync-external-store_shim_index_js-_e121-_afc41.js +137 -0
- package/dist/node_modules_client-only_index_js-node_modules_use-sync-external-store_shim_index_js-_e121-_afc41.js.map +1 -0
- package/dist/node_modules_dayjs_dayjs_min_js.js +14 -0
- package/dist/node_modules_dayjs_dayjs_min_js.js.map +1 -0
- package/dist/pucp-gidis-hiisc-esm-dyaku-app.js +4902 -0
- package/dist/pucp-gidis-hiisc-esm-dyaku-app.js.buildmanifest.json +705 -0
- package/dist/pucp-gidis-hiisc-esm-dyaku-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/dist/src_dyaku-patients_dyaku-patients-link_component_tsx.js +46 -0
- package/dist/src_dyaku-patients_dyaku-patients-link_component_tsx.js.map +1 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.3156ff9f6a47f657.hot-update.js +309 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.3156ff9f6a47f657.hot-update.js.map +1 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.52df2f9ab9342568.hot-update.js +309 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.52df2f9ab9342568.hot-update.js.map +1 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.670ae221c7eb0597.hot-update.js +309 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.670ae221c7eb0597.hot-update.js.map +1 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.js +2520 -0
- package/dist/src_dyaku-patients_dyaku_main_component_tsx.js.map +1 -0
- package/dist/src_index_ts.js +146 -0
- package/dist/src_index_ts.js.map +1 -0
- package/dist/translations_en_json.js +14 -0
- package/dist/translations_es_json.js +14 -0
- package/dist/vendors-node_modules_carbon_react_es_index_js.js +121758 -0
- package/dist/vendors-node_modules_carbon_react_es_index_js.js.map +1 -0
- package/dist/vendors-node_modules_openmrs_esm-framework_src_internal_ts.js +4256 -0
- package/dist/vendors-node_modules_openmrs_esm-framework_src_internal_ts.js.map +1 -0
- package/dist/vendors-node_modules_openmrs_esm-patient-common-lib_src_index_ts.js +4200 -0
- package/dist/vendors-node_modules_openmrs_esm-patient-common-lib_src_index_ts.js.map +1 -0
- package/dist/vendors-node_modules_openmrs_esm-styleguide_src_internal_ts.js +119007 -0
- package/dist/vendors-node_modules_openmrs_esm-styleguide_src_internal_ts.js.map +1 -0
- package/dist/vendors-node_modules_react-dom_index_js.js +30632 -0
- package/dist/vendors-node_modules_react-dom_index_js.js.map +1 -0
- package/dist/vendors-node_modules_react-i18next_dist_es_index_js.js +1392 -0
- package/dist/vendors-node_modules_react-i18next_dist_es_index_js.js.map +1 -0
- package/dist/vendors-node_modules_react-router-dom_dist_index_js.js +8221 -0
- package/dist/vendors-node_modules_react-router-dom_dist_index_js.js.map +1 -0
- package/dist/vendors-node_modules_react_index_js.js +2772 -0
- package/dist/vendors-node_modules_react_index_js.js.map +1 -0
- package/dist/vendors-node_modules_rxjs__esm5_index_js.js +6245 -0
- package/dist/vendors-node_modules_rxjs__esm5_index_js.js.map +1 -0
- package/dist/vendors-node_modules_swr_dist__internal_index_mjs.js +732 -0
- package/dist/vendors-node_modules_swr_dist__internal_index_mjs.js.map +1 -0
- package/dist/vendors-node_modules_swr_dist_immutable_index_mjs.js +572 -0
- package/dist/vendors-node_modules_swr_dist_immutable_index_mjs.js.map +1 -0
- package/dist/vendors-node_modules_swr_dist_infinite_index_mjs.js +815 -0
- package/dist/vendors-node_modules_swr_dist_infinite_index_mjs.js.map +1 -0
- package/jest.config.js +3 -0
- package/package.json +68 -0
- package/src/config-schema.ts +61 -0
- package/src/constant.ts +1 -0
- package/src/dashboard.meta.tsx +8 -0
- package/src/declarations.d.ts +6 -0
- package/src/fua/case-management-header.tsx +37 -0
- package/src/fua/case-management-illustration.tsx +13 -0
- package/src/fua/fua-request-table.scss +173 -0
- package/src/fua/fuaRequestTable.tsx +147 -0
- package/src/fua/solicitudes/.gitkeep +0 -0
- package/src/hooks/useFuaRequests.ts +48 -0
- package/src/index.ts +27 -0
- package/src/left-panel-link.component.tsx +42 -0
- package/src/root.scss +102 -0
- package/src/routes.json +28 -0
- package/translations/en.json +0 -0
- package/translations/es.json +0 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
3
|
+
import { ModuleFuaRestURL } from '../constant';
|
|
4
|
+
|
|
5
|
+
export interface FuaEstado {
|
|
6
|
+
uuid: string;
|
|
7
|
+
id: number;
|
|
8
|
+
nombre: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface FuaRequest {
|
|
12
|
+
uuid: string;
|
|
13
|
+
id: number;
|
|
14
|
+
visitUuid: string;
|
|
15
|
+
name: string;
|
|
16
|
+
payload: string;
|
|
17
|
+
fuaEstado: FuaEstado;
|
|
18
|
+
fechaCreacion: number;
|
|
19
|
+
fechaActualizacion: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function useFuaRequests() {
|
|
23
|
+
const [data, setData] = useState<FuaRequest[]>([]);
|
|
24
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
25
|
+
const [error, setError] = useState<Error | null>(null);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const fetchData = async () => {
|
|
29
|
+
setIsLoading(true);
|
|
30
|
+
setError(null);
|
|
31
|
+
try {
|
|
32
|
+
const { data: response } = await openmrsFetch(`${ModuleFuaRestURL}/list`);
|
|
33
|
+
setData(response as FuaRequest[]);
|
|
34
|
+
} catch (err: any) {
|
|
35
|
+
console.error('Error fetching FUA list:', err);
|
|
36
|
+
setError(err);
|
|
37
|
+
} finally {
|
|
38
|
+
setIsLoading(false);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
fetchData();
|
|
43
|
+
}, []);
|
|
44
|
+
|
|
45
|
+
return { data, isLoading, error };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default useFuaRequests;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
|
|
2
|
+
import { createDashboardLink } from '@openmrs/esm-patient-common-lib';
|
|
3
|
+
import { configSchema } from './config-schema';
|
|
4
|
+
import { createLeftPanelLink } from './left-panel-link.component';
|
|
5
|
+
import FuaRequestTable from './fua/fuaRequestTable';
|
|
6
|
+
import { FuaRequestDashboardMeta } from './dashboard.meta';
|
|
7
|
+
|
|
8
|
+
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
9
|
+
|
|
10
|
+
const moduleName = '@pucp-gidis-hiisc/esm-fua-app';
|
|
11
|
+
const options = {
|
|
12
|
+
featureName: 'patient-clinical-view-app',
|
|
13
|
+
moduleName,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// ================================================================================
|
|
17
|
+
// CONFIGURATION
|
|
18
|
+
// ================================================================================
|
|
19
|
+
export function startupApp(): void {
|
|
20
|
+
defineConfigSchema(moduleName, configSchema);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ================================================================================
|
|
24
|
+
// FUA REQUEST EXPORTS
|
|
25
|
+
// ================================================================================
|
|
26
|
+
export const fuaRequestDashboardLink = getSyncLifecycle(createLeftPanelLink(FuaRequestDashboardMeta), options);
|
|
27
|
+
export const fuaRequestTable = getSyncLifecycle(FuaRequestTable, options);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import last from 'lodash-es/last';
|
|
3
|
+
import { BrowserRouter, useLocation } from 'react-router-dom';
|
|
4
|
+
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
5
|
+
|
|
6
|
+
export interface LinkConfig {
|
|
7
|
+
name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function LinkExtension({ config }: { config: LinkConfig }): JSX.Element {
|
|
12
|
+
const { name, title } = config;
|
|
13
|
+
const location = useLocation();
|
|
14
|
+
const spaBasePath = window.getOpenmrsSpaBase() + 'home';
|
|
15
|
+
|
|
16
|
+
let urlSegment = useMemo(() => decodeURIComponent(last(location.pathname.split('/'))), [location.pathname]);
|
|
17
|
+
|
|
18
|
+
const isUUID = (value) => {
|
|
19
|
+
const regex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;
|
|
20
|
+
return regex.test(value);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
if (isUUID(urlSegment)) {
|
|
24
|
+
urlSegment = location.pathname.split('/').at(-2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ConfigurableLink
|
|
29
|
+
to={spaBasePath + '/' + name}
|
|
30
|
+
className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}>
|
|
31
|
+
{title}
|
|
32
|
+
</ConfigurableLink>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const createLeftPanelLink =
|
|
37
|
+
(config: LinkConfig): (() => JSX.Element) =>
|
|
38
|
+
() => (
|
|
39
|
+
<BrowserRouter>
|
|
40
|
+
<LinkExtension config={config} />
|
|
41
|
+
</BrowserRouter>
|
|
42
|
+
);
|
package/src/root.scss
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
|
+
|
|
5
|
+
.productiveHeading01 {
|
|
6
|
+
@include type.type-style('heading-compact-01');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.productiveHeading02 {
|
|
10
|
+
@include type.type-style('heading-compact-02');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.productiveHeading03 {
|
|
14
|
+
@include type.type-style('heading-03');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.productiveHeading04 {
|
|
18
|
+
@include type.type-style('heading-04');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.productiveHeading05 {
|
|
22
|
+
@include type.type-style('heading-05');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.productiveHeading06 {
|
|
26
|
+
@include type.type-style('heading-06');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.bodyShort01 {
|
|
30
|
+
@include type.type-style('body-compact-01');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.helperText01 {
|
|
34
|
+
@include type.type-style('helper-text-01');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bodyShort02 {
|
|
38
|
+
@include type.type-style('body-compact-02');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bodyLong01 {
|
|
42
|
+
@include type.type-style('body-01');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.bodyLong02 {
|
|
46
|
+
@include type.type-style('body-02');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.label01 {
|
|
50
|
+
@include type.type-style('label-01');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.text02 {
|
|
54
|
+
color: $text-02;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
aside {
|
|
58
|
+
background-color: $ui-02 !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Login Overrides
|
|
62
|
+
|
|
63
|
+
div[class*='-esm-login__styles__center'] > img {
|
|
64
|
+
width: 140px; // design has 120px
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:global(.tab-12rem) > button {
|
|
68
|
+
width: 12rem !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:global(.tab-14rem) > button {
|
|
72
|
+
width: 14rem !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:global(.tab-16rem) > button {
|
|
76
|
+
width: 16rem !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:global(.cds--overflow-menu) > div {
|
|
80
|
+
width: 15rem !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
nav :global(.cds--accordion__title) {
|
|
84
|
+
color: #525252;
|
|
85
|
+
font-weight: 600 !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
nav :global(.cds--accordion__content) {
|
|
89
|
+
padding-bottom: 0 !important;
|
|
90
|
+
padding-top: 0 !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
nav :global(.cds--accordion__content) > a {
|
|
94
|
+
background-color: #cecece !important;
|
|
95
|
+
color: #161616 !important;
|
|
96
|
+
border-left-color: var(--brand-01) !important;
|
|
97
|
+
font: bolder;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:global(.cds--tab--list) button {
|
|
101
|
+
max-width: 16rem !important;
|
|
102
|
+
}
|
package/src/routes.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.openmrs.org/routes.schema.json",
|
|
3
|
+
"backendDependencies": {
|
|
4
|
+
"fhir2": ">=1.2",
|
|
5
|
+
"webservices.rest": "^2.24.0"
|
|
6
|
+
},
|
|
7
|
+
"extensions": [
|
|
8
|
+
{
|
|
9
|
+
"name": "fua-request-dashboard-link",
|
|
10
|
+
"component": "fuaRequestDashboardLink",
|
|
11
|
+
"slot": "homepage-dashboard-slot",
|
|
12
|
+
"meta": {
|
|
13
|
+
"name": "fua-request",
|
|
14
|
+
"title": "Manejo de FUA",
|
|
15
|
+
"slot": "fua-request-dashboard-slot",
|
|
16
|
+
"path": "/fua-request"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "fua-request-table",
|
|
21
|
+
"slot": "fua-request-dashboard-slot",
|
|
22
|
+
"component": "fuaRequestTable",
|
|
23
|
+
"order": 0,
|
|
24
|
+
"online": true,
|
|
25
|
+
"offline": false
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
File without changes
|
|
File without changes
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('openmrs/default-webpack-config');
|