@openmrs/esm-fast-data-entry-app 1.0.0-pre.21 → 1.0.0-pre.23
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/dist/508.js +1 -0
- package/dist/574.js +1 -1
- package/dist/671.js +1 -0
- package/dist/804.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +40 -40
- package/dist/openmrs-esm-fast-data-entry-app.old +1 -1
- package/package.json +1 -1
- package/src/FormBootstrap.tsx +142 -0
- package/src/Root.tsx +4 -4
- package/src/form-entry-workflow/FormEntryWorkflow.tsx +98 -0
- package/src/form-entry-workflow/index.ts +3 -0
- package/src/form-entry-workflow/styles.scss +59 -0
- package/src/forms-page/FormsPage.tsx +54 -0
- package/src/forms-page/index.ts +3 -0
- package/src/forms-page/styles.scss +11 -0
- package/src/{forms → forms-table}/FormsTable.tsx +37 -26
- package/src/forms-table/index.ts +3 -0
- package/src/forms-table/styles.scss +20 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useGetAllForms.ts +31 -0
- package/src/{forms → hooks}/useGetPatient.ts +0 -0
- package/src/{forms/PatientInfo.test.tsx → patient-banner/PatientBanner.test.tsx} +3 -3
- package/src/{forms/PatientInfo.tsx → patient-banner/PatientBanner.tsx} +2 -2
- package/src/patient-banner/index.ts +3 -0
- package/src/{forms/patient-info.scss → patient-banner/styles.scss} +0 -0
- package/src/{forms → patient-card}/PatientCard.tsx +1 -1
- package/src/patient-card/index.ts +3 -0
- package/src/patient-search-header/PatientSearchHeader.tsx +49 -0
- package/src/patient-search-header/index.ts +3 -0
- package/src/patient-search-header/styles.scss +17 -0
- package/translations/en.json +13 -4
- package/dist/852.js +0 -1
- package/dist/947.js +0 -1
- package/src/FormEntry.tsx +0 -42
- package/src/Loader.tsx +0 -16
- package/src/forms/FormWorkflow.tsx +0 -135
- package/src/forms/FormsRoot.tsx +0 -79
- package/src/forms/mockData.ts +0 -20
- package/src/forms/styles.scss +0 -13
- package/src/loader.scss +0 -9
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Add20, Close20 } from "@carbon/icons-react";
|
|
2
|
+
import { ExtensionSlot } from "@openmrs/esm-framework";
|
|
3
|
+
import { Button } from "carbon-components-react";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import { Link, useHistory, useParams } from "react-router-dom";
|
|
6
|
+
import FormBootstrap from "../FormBootstrap";
|
|
7
|
+
import PatientCard from "../patient-card/PatientCard";
|
|
8
|
+
import PatientBanner from "../patient-banner";
|
|
9
|
+
import styles from "./styles.scss";
|
|
10
|
+
import PatientSearchHeader from "../patient-search-header";
|
|
11
|
+
import { useTranslation } from "react-i18next";
|
|
12
|
+
|
|
13
|
+
interface ParamTypes {
|
|
14
|
+
formUuid: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const FormEntryWorkflow = () => {
|
|
18
|
+
const { formUuid } = useParams() as ParamTypes;
|
|
19
|
+
const history = useHistory();
|
|
20
|
+
const [patientUuids, setPatientUuids] = useState([]);
|
|
21
|
+
const [activePatientUuid, setActivePatientUuid] = useState(null);
|
|
22
|
+
const [encounterUuids, setEncounterUuids] = useState([]);
|
|
23
|
+
const { t } = useTranslation();
|
|
24
|
+
|
|
25
|
+
const saveEncounter = (uuid) => {
|
|
26
|
+
setEncounterUuids((encounterUuids) => [...encounterUuids, uuid]);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handlePostResponse = (encounter) => {
|
|
30
|
+
if (
|
|
31
|
+
encounter &&
|
|
32
|
+
encounter.uuid &&
|
|
33
|
+
!encounterUuids.includes(encounter.uuid)
|
|
34
|
+
) {
|
|
35
|
+
saveEncounter(encounter.uuid);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<div className={styles.breadcrumbsContainer}>
|
|
42
|
+
<ExtensionSlot extensionSlotName="breadcrumbs-slot" />
|
|
43
|
+
</div>
|
|
44
|
+
{!activePatientUuid && (
|
|
45
|
+
<PatientSearchHeader
|
|
46
|
+
{...{ patientUuids, setPatientUuids, setActivePatientUuid }}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
{activePatientUuid && <PatientBanner patientUuid={activePatientUuid} />}
|
|
50
|
+
<div className={styles.workspaceWrapper}>
|
|
51
|
+
<div className={styles.workspace}>
|
|
52
|
+
{!patientUuids.length && (
|
|
53
|
+
<div className={styles.selectPatientMessage}>
|
|
54
|
+
{t("selectPatientFirst", "Please select a patient first")}
|
|
55
|
+
</div>
|
|
56
|
+
)}
|
|
57
|
+
{!!patientUuids.length && (
|
|
58
|
+
<div className={styles.formMainContent}>
|
|
59
|
+
<div className={styles.formContainer}>
|
|
60
|
+
<FormBootstrap
|
|
61
|
+
patientUuid={activePatientUuid}
|
|
62
|
+
{...{
|
|
63
|
+
formUuid,
|
|
64
|
+
handlePostResponse,
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<div className={styles.rightPanel}>
|
|
69
|
+
<h4>Forms filled</h4>
|
|
70
|
+
<div className={styles.patientCardsSection}>
|
|
71
|
+
{patientUuids.map((patientUuid) => (
|
|
72
|
+
<PatientCard patientUuid={patientUuid} key={patientUuid} />
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
<div className={styles.rightPanelActionButtons}>
|
|
76
|
+
<Button
|
|
77
|
+
kind="primary"
|
|
78
|
+
onClick={() => setActivePatientUuid(null)}
|
|
79
|
+
>
|
|
80
|
+
{t("nextPatient", "Next Patient")}
|
|
81
|
+
</Button>
|
|
82
|
+
<Button kind="secondary" disabled>
|
|
83
|
+
{t("reviewSave", "Review & Save")}
|
|
84
|
+
</Button>
|
|
85
|
+
<Button kind="tertiary" onClick={() => history.push("/")}>
|
|
86
|
+
{t("cancel", "Cancel")}
|
|
87
|
+
</Button>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export default FormEntryWorkflow;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@import "~@openmrs/esm-styleguide/src/vars";
|
|
2
|
+
@import "~carbon-components/src/globals/scss/vars";
|
|
3
|
+
@import "~carbon-components/src/globals/scss/mixins";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
.breadcrumbsContainer > div > div > nav {
|
|
7
|
+
background-color: white;
|
|
8
|
+
padding: 0.5rem;
|
|
9
|
+
border-bottom: 1px solid $openmrs-background-grey;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.workspaceWrapper {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.workspace {
|
|
18
|
+
width: 1100px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.selectPatientMessage {
|
|
22
|
+
@include carbon--type-style('productive-heading-03');
|
|
23
|
+
margin: $spacing-07;
|
|
24
|
+
text-align: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.formMainContent {
|
|
28
|
+
display: flex;
|
|
29
|
+
text-align: center;
|
|
30
|
+
margin-top: 1rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.formContainer {
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
max-height: calc(100vh - 14rem);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.rightPanel {
|
|
39
|
+
width: 13rem;
|
|
40
|
+
text-align: left;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.patientCardsSection {
|
|
44
|
+
margin: 1rem 0;
|
|
45
|
+
border-bottom: 1px solid $carbon--gray-10;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.rightPanelActionButtons {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
row-gap: 0.5rem;
|
|
52
|
+
& button {
|
|
53
|
+
width: 100%;
|
|
54
|
+
text-decoration: "none";
|
|
55
|
+
& :hover {
|
|
56
|
+
background-color: $carbon--gray-30;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useConfig } from "@openmrs/esm-framework";
|
|
2
|
+
import { Tab, Tabs } from "carbon-components-react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Config } from "../config-schema";
|
|
5
|
+
import { useGetAllForms } from "../hooks";
|
|
6
|
+
import FormsTable from "../forms-table";
|
|
7
|
+
import styles from "./styles.scss";
|
|
8
|
+
import { useTranslation } from "react-i18next";
|
|
9
|
+
|
|
10
|
+
const cleanForms = (rawFormData) => {
|
|
11
|
+
if (rawFormData) {
|
|
12
|
+
return rawFormData?.map((form) => ({
|
|
13
|
+
...form,
|
|
14
|
+
id: form.uuid,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const FormsPage = () => {
|
|
21
|
+
const config = useConfig() as Config;
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const { formCategories, formCategoriesToShow } = config;
|
|
24
|
+
const { forms, isLoading, error } = useGetAllForms();
|
|
25
|
+
const cleanRows = cleanForms(forms);
|
|
26
|
+
|
|
27
|
+
const categoryRows = formCategoriesToShow.map((name) => {
|
|
28
|
+
const category = formCategories.find((category) => category.name === name);
|
|
29
|
+
let rows = [];
|
|
30
|
+
if (category && cleanRows && cleanRows.length) {
|
|
31
|
+
const uuids = category.forms?.map((form) => form.formUUID);
|
|
32
|
+
rows = cleanRows.filter((row) => uuids.includes(row.uuid));
|
|
33
|
+
}
|
|
34
|
+
return { ...{ name, rows } };
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className={styles.mainContent}>
|
|
39
|
+
<h3 className={styles.pageTitle}>{t("forms", "Forms")}</h3>
|
|
40
|
+
<Tabs type="container">
|
|
41
|
+
<Tab label={t("allForms", "All Forms")}>
|
|
42
|
+
<FormsTable rows={cleanRows} {...{ error, isLoading }} />
|
|
43
|
+
</Tab>
|
|
44
|
+
{categoryRows?.map((category, index) => (
|
|
45
|
+
<Tab label={category.name} key={index}>
|
|
46
|
+
<FormsTable rows={category.rows} {...{ error, isLoading }} />
|
|
47
|
+
</Tab>
|
|
48
|
+
))}
|
|
49
|
+
</Tabs>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default FormsPage;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ErrorState } from "@openmrs/esm-framework";
|
|
2
1
|
import {
|
|
3
2
|
DataTable,
|
|
4
3
|
DataTableSkeleton,
|
|
@@ -14,40 +13,59 @@ import {
|
|
|
14
13
|
TableToolbarSearch,
|
|
15
14
|
} from "carbon-components-react";
|
|
16
15
|
import React from "react";
|
|
16
|
+
import { useTranslation } from "react-i18next";
|
|
17
17
|
import { Link } from "react-router-dom";
|
|
18
18
|
import EmptyState from "../empty-state/EmptyState";
|
|
19
|
-
|
|
20
|
-
const formsHeader = [
|
|
21
|
-
{
|
|
22
|
-
key: "name",
|
|
23
|
-
header: "Form name",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
key: "actions",
|
|
27
|
-
header: "Actions",
|
|
28
|
-
},
|
|
29
|
-
];
|
|
19
|
+
import styles from "./styles.scss";
|
|
30
20
|
|
|
31
21
|
const FormsTable = ({ rows, error, isLoading }) => {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
|
|
24
|
+
const formsHeader = [
|
|
25
|
+
{
|
|
26
|
+
key: "name",
|
|
27
|
+
header: t("formName", "Form Name"),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "actions",
|
|
31
|
+
header: t("actions", "Actions"),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "actions2",
|
|
35
|
+
header: "",
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
32
39
|
const augmenteRows = rows?.map((row) => ({
|
|
33
40
|
...row,
|
|
34
|
-
actions: <Link to={row.uuid}>Fill Form</Link>,
|
|
41
|
+
actions: <Link to={row.uuid}>{t("fillForm", "Fill Form")}</Link>,
|
|
42
|
+
actions2: (
|
|
43
|
+
<Link to="#" className={styles.inactiveLink}>
|
|
44
|
+
{t("startGroupSession", "Start Group Session")}
|
|
45
|
+
</Link>
|
|
46
|
+
),
|
|
35
47
|
}));
|
|
36
48
|
|
|
37
49
|
if (isLoading) return <DataTableSkeleton />;
|
|
38
50
|
if (error) {
|
|
39
51
|
return (
|
|
40
52
|
<EmptyState
|
|
41
|
-
headerTitle="Error Loading Data"
|
|
42
|
-
displayText={
|
|
53
|
+
headerTitle={t("errorLoadingData", "Error Loading Data")}
|
|
54
|
+
displayText={`${t(
|
|
55
|
+
"dataErrorMessage",
|
|
56
|
+
"Something went wrong loading data from the server."
|
|
57
|
+
)} "${error?.response?.status}: ${error?.response?.statusText}"`}
|
|
43
58
|
/>
|
|
44
59
|
);
|
|
45
60
|
}
|
|
46
61
|
if (augmenteRows.length === 0) {
|
|
47
62
|
return (
|
|
48
63
|
<EmptyState
|
|
49
|
-
headerTitle="No Forms To Show"
|
|
50
|
-
displayText=
|
|
64
|
+
headerTitle={t("noFormsFound", "No Forms To Show")}
|
|
65
|
+
displayText={t(
|
|
66
|
+
"noFormsFoundMessage",
|
|
67
|
+
"No forms could be found for this category. Please double check the form concept uuids and access permissions."
|
|
68
|
+
)}
|
|
51
69
|
/>
|
|
52
70
|
);
|
|
53
71
|
}
|
|
@@ -63,15 +81,8 @@ const FormsTable = ({ rows, error, isLoading }) => {
|
|
|
63
81
|
}) => {
|
|
64
82
|
return (
|
|
65
83
|
<TableContainer>
|
|
66
|
-
<div
|
|
67
|
-
|
|
68
|
-
position: "relative",
|
|
69
|
-
display: "flex",
|
|
70
|
-
height: "3rem",
|
|
71
|
-
justifyContent: "flex-end",
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
<TableToolbar style={{ width: "20%", minWidth: "200px" }}>
|
|
84
|
+
<div className={styles.toolbarWrapper}>
|
|
85
|
+
<TableToolbar className={styles.tableToolbar}>
|
|
75
86
|
<TableToolbarContent>
|
|
76
87
|
<TableToolbarSearch onChange={onInputChange} />
|
|
77
88
|
</TableToolbarContent>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "~@openmrs/esm-styleguide/src/vars";
|
|
2
|
+
@import "~carbon-components/src/globals/scss/vars";
|
|
3
|
+
@import "~carbon-components/src/globals/scss/mixins";
|
|
4
|
+
|
|
5
|
+
.toolbarWrapper {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
height: $spacing-09;
|
|
9
|
+
justify-content: flex-end;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.tableToolbar {
|
|
13
|
+
width: 20%;
|
|
14
|
+
min-width: 12.5rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.inactiveLink {
|
|
18
|
+
color: $carbon--gray-40;
|
|
19
|
+
cursor: not-allowed;
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { openmrsFetch } from "@openmrs/esm-framework";
|
|
2
|
+
import useSWR from "swr";
|
|
3
|
+
|
|
4
|
+
const customFormRepresentation =
|
|
5
|
+
"(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))";
|
|
6
|
+
|
|
7
|
+
const formEncounterUrl = `/ws/rest/v1/form?v=custom:${customFormRepresentation}`;
|
|
8
|
+
const formEncounterUrlPoc = `/ws/rest/v1/form?v=custom:${customFormRepresentation}&q=poc`;
|
|
9
|
+
|
|
10
|
+
export function useGetAllForms(cachedOfflineFormsOnly = false) {
|
|
11
|
+
const showHtmlFormEntryForms = true;
|
|
12
|
+
const url = showHtmlFormEntryForms ? formEncounterUrl : formEncounterUrlPoc;
|
|
13
|
+
const { data, error } = useSWR([url, cachedOfflineFormsOnly], async () => {
|
|
14
|
+
const res = await openmrsFetch(url);
|
|
15
|
+
// show published forms and hide component forms
|
|
16
|
+
const forms =
|
|
17
|
+
res.data?.results?.filter(
|
|
18
|
+
(form) => form.published && !/component/i.test(form.name)
|
|
19
|
+
) ?? [];
|
|
20
|
+
|
|
21
|
+
return forms;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
forms: data,
|
|
26
|
+
isLoading: !error && !data,
|
|
27
|
+
error,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default useGetAllForms;
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
|
-
import
|
|
3
|
+
import PatientBanner from "./PatientBanner";
|
|
4
4
|
|
|
5
|
-
describe("
|
|
5
|
+
describe("PatientBanner", () => {
|
|
6
6
|
it("renders placeholder information when no data is present", () => {
|
|
7
|
-
render(<
|
|
7
|
+
render(<PatientBanner patientUuid={null} />);
|
|
8
8
|
});
|
|
9
9
|
});
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
SkeletonText,
|
|
11
11
|
} from "carbon-components-react";
|
|
12
12
|
import React, { useState } from "react";
|
|
13
|
-
import styles from "./
|
|
13
|
+
import styles from "./styles.scss";
|
|
14
14
|
import ChevronDown16 from "@carbon/icons-react/es/chevron--down/16";
|
|
15
15
|
import ChevronUp16 from "@carbon/icons-react/es/chevron--up/16";
|
|
16
16
|
import { useTranslation } from "react-i18next";
|
|
17
|
-
import useGetPatient from "
|
|
17
|
+
import useGetPatient from "../hooks/useGetPatient";
|
|
18
18
|
interface PatientInfoProps {
|
|
19
19
|
patientUuid: string;
|
|
20
20
|
}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SkeletonText } from "carbon-components-react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import useGetPatient from "
|
|
3
|
+
import useGetPatient from "../hooks/useGetPatient";
|
|
4
4
|
|
|
5
5
|
const CardContainer = ({ children }) => {
|
|
6
6
|
return <div style={{ padding: "1rem" }}>{children}</div>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Add20, Close20 } from "@carbon/icons-react";
|
|
2
|
+
import { ExtensionSlot } from "@openmrs/esm-framework";
|
|
3
|
+
import { Button } from "carbon-components-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Link } from "react-router-dom";
|
|
6
|
+
import styles from "./styles.scss";
|
|
7
|
+
|
|
8
|
+
const PatientSearchHeader = ({
|
|
9
|
+
patientUuids,
|
|
10
|
+
setPatientUuids,
|
|
11
|
+
setActivePatientUuid,
|
|
12
|
+
}) => {
|
|
13
|
+
const handleSelectPatient = (uuid) => {
|
|
14
|
+
setPatientUuids([...patientUuids, uuid]), setActivePatientUuid(uuid);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className={styles.searchHeaderContainer}>
|
|
19
|
+
<span className={styles.padded}>Next patient:</span>
|
|
20
|
+
<span className={styles.searchBarWrapper}>
|
|
21
|
+
<ExtensionSlot
|
|
22
|
+
extensionSlotName="patient-search-bar-slot"
|
|
23
|
+
state={{
|
|
24
|
+
selectPatientAction: handleSelectPatient,
|
|
25
|
+
buttonProps: {
|
|
26
|
+
kind: "primary",
|
|
27
|
+
},
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
</span>
|
|
31
|
+
<span className={styles.padded}>or</span>
|
|
32
|
+
<span>
|
|
33
|
+
<Button disabled>
|
|
34
|
+
Create new patient <Add20 />
|
|
35
|
+
</Button>
|
|
36
|
+
</span>
|
|
37
|
+
<span style={{ flexGrow: 1 }} />
|
|
38
|
+
<span>
|
|
39
|
+
<Link to="">
|
|
40
|
+
<Button kind="ghost">
|
|
41
|
+
Cancel <Close20 />
|
|
42
|
+
</Button>
|
|
43
|
+
</Link>
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default PatientSearchHeader;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import "~@openmrs/esm-styleguide/src/vars";
|
|
2
|
+
@import "~carbon-components/src/globals/scss/vars";
|
|
3
|
+
@import "~carbon-components/src/globals/scss/mixins";
|
|
4
|
+
|
|
5
|
+
.searchHeaderContainer {
|
|
6
|
+
display: flex;
|
|
7
|
+
background-color: white;
|
|
8
|
+
padding: $spacing-07 $spacing-05;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.searchBarWrapper {
|
|
12
|
+
min-width: 35rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.padded {
|
|
16
|
+
padding: $spacing-05;
|
|
17
|
+
}
|
package/translations/en.json
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
1
|
+
{
|
|
2
|
+
"actions": "Actions",
|
|
3
|
+
"casualGreeting": "hey",
|
|
4
|
+
"dataErrorMessage": "Something went wrong loading data from the server.",
|
|
5
|
+
"errorLoadingData": "Error Loading Data",
|
|
6
|
+
"fillForm": "Fill Form",
|
|
7
|
+
"formalGreeting": "hello",
|
|
8
|
+
"formName": "Form Name",
|
|
9
|
+
"noFormsFound": "No Forms To Show",
|
|
10
|
+
"noFormsFoundMessage": "No forms could be found for this category. Please double check the form concept uuids and access permissions.",
|
|
11
|
+
"selectPatientFirst": "Please select a patient first",
|
|
12
|
+
"startGroupSession": "Start Group Session"
|
|
13
|
+
}
|
package/dist/852.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[852],{4131:(e,t,r)=>{r.r(t),r.d(t,{FormsRoot:()=>te,customFormRepresentation:()=>K,default:()=>re,formEncounterUrl:()=>Y,formEncounterUrlPoc:()=>$,useFormEncounters:()=>ee});var n=r(5666),a=r.n(n),o=r(311),i=r(622),l=r(751),s=r(4211),c=r.n(s),m=r(8100),f=r(5393),d=r(2370),u=r(5566),p=r(2302),g=r(3567),h=r(5185),_=r(8529),y=r(8722),b=r(9758),v=r(4525),w=r(7450),E=r(7188),O=r(2221),P=r(4116),j=r(3379),k=r.n(j),z=r(7795),x=r.n(z),C=r(569),H=r.n(C),F=r(3565),Z=r.n(F),X=r(9216),T=r.n(X),D=r(4589),L=r.n(D),S=r(8772),q={};q.styleTagTransform=L(),q.setAttributes=Z(),q.insert=H().bind(null,"head"),q.domAPI=x(),q.insertStyleElement=T(),k()(S.Z,q);const M=S.Z&&S.Z.locals?S.Z.locals:void 0;var V=function(e){var t=e.width,r=void 0===t?"64":t,n=e.height,a=void 0===n?"64":n;return c().createElement("svg",{width:r,height:a,viewBox:"0 0 64 64"},c().createElement("title",null,"Empty data illustration"),c().createElement("g",{fill:"none",fillRule:"evenodd"},c().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),c().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),c().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),c().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),c().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),c().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),c().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),c().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),c().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),c().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))};const R=function(e){var t=e.headerTitle,r=e.displayText,n="tablet"===(0,o.useLayoutType)();return c().createElement(P.n9,{light:!0,className:M.tile},c().createElement("div",{className:n?M.tabletHeading:M.desktopHeading},c().createElement("h4",null,t)),c().createElement(V,null),c().createElement("p",{className:M.content},r))};function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B(){return B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},B.apply(this,arguments)}var N=[{key:"name",header:"Form name"},{key:"actions",header:"Actions"}];const I=function(e){var t,r,n=e.rows,a=e.error,o=e.isLoading,i=null==n?void 0:n.map((function(e){return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){A(e,t,r[t])}))}return e}({},e),r=null!=(r={actions:c().createElement(O.Link,{to:e.uuid},"Fill Form")})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})),t;var t,r}));return o?c().createElement(f.Z,null):a?c().createElement(R,{headerTitle:"Error Loading Data",displayText:'Something went wrong loading data from the server. "'.concat(null==a||null===(t=a.response)||void 0===t?void 0:t.status,": ").concat(null==a||null===(r=a.response)||void 0===r?void 0:r.statusText,'"')}):0===i.length?c().createElement(R,{headerTitle:"No Forms To Show",displayText:"No forms could be found for this category. Please double check the form concept uuids and access permissions."}):c().createElement(d.ZP,{rows:i,headers:N,isSortable:!0},(function(e){var t=e.rows,r=e.headers,n=e.getTableProps,a=e.getHeaderProps,o=e.getRowProps,i=e.onInputChange;return c().createElement(u.Z,null,c().createElement("div",{style:{position:"relative",display:"flex",height:"3rem",justifyContent:"flex-end"}},c().createElement(p.Z,{style:{width:"20%",minWidth:"200px"}},c().createElement(g.Z,null,c().createElement(h.Z,{onChange:i})))),c().createElement(_.Z,B({},n()),c().createElement(y.Z,null,c().createElement(b.Z,null,r.map((function(e){return c().createElement(v.Z,B({},a({header:e})),e.header)})))),c().createElement(w.Z,null,null==t?void 0:t.map((function(e){return c().createElement(b.Z,B({},o({row:e})),e.cells.map((function(e){return c().createElement(E.Z,{key:e.id},e.value)})))})))))}))};function Q(e,t,r,n,a,o,i){try{var l=e[o](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,a)}function U(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Q(o,n,a,i,l,"next",e)}function l(e){Q(o,n,a,i,l,"throw",e)}i(void 0)}))}}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G(){return G=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},G.apply(this,arguments)}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){W(e,t,r[t])}))}return e}var K="(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))",Y="/ws/rest/v1/form?v=custom:".concat(K),$="/ws/rest/v1/form?v=custom:".concat(K,"&q=poc");function ee(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!0,r=t?Y:$,n=(0,m.ZP)([r,e],U(a().mark((function e(){var t,n,i,l,s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,(0,o.openmrsFetch)(r);case 3:return i=e.sent,s=null!==(l=null===(t=i.data)||void 0===t||null===(n=t.results)||void 0===n?void 0:n.filter((function(e){return e.published&&!/component/i.test(e.name)})))&&void 0!==l?l:[],e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})))),i=n.data,l=n.error;return{forms:i,isLoading:!l&&!i,error:l}}var te=function(){var e,t=(0,o.useConfig)(),r=t.formCategories,n=t.formCategoriesToShow,a=ee(),s=a.forms,m=a.isLoading,f=a.error,d=(e=s)?null==e?void 0:e.map((function(e){return t=J({},e),r=null!=(r={id:e.uuid})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})),t;var t,r})):null,u=n.map((function(e){var t=r.find((function(t){return t.name===e})),n=[];if(t&&d&&d.length){var a,o=null===(a=t.forms)||void 0===a?void 0:a.map((function(e){return e.formUUID}));n=d.filter((function(e){return o.includes(e.uuid)}))}return J({},{name:e,rows:n})}));return c().createElement("div",{style:{padding:"2rem"}},c().createElement("h3",{style:{marginBottom:"1.5rem"}},"Forms"),c().createElement(i.Z,{type:"container"},c().createElement(l.Z,{label:"All Forms"},c().createElement(I,G({rows:d},{error:f,isLoading:m}))),null==u?void 0:u.map((function(e){return c().createElement(l.Z,{label:e.name},c().createElement(I,G({rows:e.rows},{error:f,isLoading:m})))}))))};const re=te},8772:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;font:inherit;font-size:100%;vertical-align:baseline;border:0}button,select,input,textarea{font-family:inherit;border-radius:0}input[type=text]::-ms-clear{display:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}body{line-height:1}sup{vertical-align:super}sub{vertical-align:sub}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:\"\"}table{border-collapse:collapse;border-spacing:0}*{box-sizing:border-box}button{margin:0}html{font-size:100%}body{font-weight:400;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace}strong{font-weight:600}@media screen and (-ms-high-contrast: active){svg{fill:ButtonText}}h1{font-size:2.625rem;font-weight:300;line-height:1.199;letter-spacing:0}h2{font-size:2rem;font-weight:400;line-height:1.25;letter-spacing:0}h3{font-size:1.75rem;font-weight:400;line-height:1.29;letter-spacing:0}h4{font-size:1.25rem;font-weight:400;line-height:1.4;letter-spacing:0}h5{font-size:1rem;font-weight:600;line-height:1.375;letter-spacing:0}h6{font-size:.875rem;font-weight:600;line-height:1.29;letter-spacing:.16px}p{font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:0}a{color:#0f62fe}em{font-style:italic}@keyframes -esm-fast-data-entry__styles__skeleton___OigVX{0%{transform:scaleX(0);transform-origin:left;opacity:.3}20%{transform:scaleX(1);transform-origin:left;opacity:1}28%{transform:scaleX(1);transform-origin:right}51%{transform:scaleX(0);transform-origin:right}58%{transform:scaleX(0);transform-origin:right}82%{transform:scaleX(1);transform-origin:right}83%{transform:scaleX(1);transform-origin:left}96%{transform:scaleX(0);transform-origin:left}100%{transform:scaleX(0);transform-origin:left;opacity:.3}}.-esm-fast-data-entry__styles__action___ei5aj{margin-bottom:.5rem}.-esm-fast-data-entry__styles__content___7TnbC{font-size:.875rem;font-weight:600;line-height:1.29;letter-spacing:.16px;color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-fast-data-entry__styles__desktopHeading___z4QwX h4{font-size:1rem;font-weight:600;line-height:1.375;letter-spacing:0;color:#525252}.-esm-fast-data-entry__styles__tabletHeading___XCRdE h4{font-size:1.25rem;font-weight:400;line-height:1.4;letter-spacing:0;color:#525252}.-esm-fast-data-entry__styles__desktopHeading___z4QwX,.-esm-fast-data-entry__styles__tabletHeading___XCRdE{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-fast-data-entry__styles__desktopHeading___z4QwX h4:after,.-esm-fast-data-entry__styles__tabletHeading___XCRdE h4:after{content:\"\";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-fast-data-entry__styles__heading___C0rzi:after{content:\"\";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-fast-data-entry__styles__tile___szqEV{text-align:center;border:1px solid #e0e0e0}",""]),a.locals={action:"-esm-fast-data-entry__styles__action___ei5aj",content:"-esm-fast-data-entry__styles__content___7TnbC",desktopHeading:"-esm-fast-data-entry__styles__desktopHeading___z4QwX",tabletHeading:"-esm-fast-data-entry__styles__tabletHeading___XCRdE",heading:"-esm-fast-data-entry__styles__heading___C0rzi",tile:"-esm-fast-data-entry__styles__tile___szqEV",skeleton:"-esm-fast-data-entry__styles__skeleton___OigVX"};const o=a}}]);
|
package/dist/947.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[947],{7947:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_e});var r=n(7114),a=n(7103),i=n(311),o=n(8663),l=n(4211),s=n.n(l),c=n(2221),f=n(5666),u=n.n(f);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n,r,a,i,o){try{var l=e[i](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,a)}const p=function(e){var t,n,r=(t=(0,l.useState)(null),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(t,n)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=r[0],o=r[1];(0,l.useEffect)((function(){e?f(e):o(null)}),[e]);var s,c,f=(s=u().mark((function e(t){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.fetchCurrentPatient)(t);case 2:n=e.sent,o(null==n?void 0:n.data);case 4:case"end":return e.stop()}}),e)})),c=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=s.apply(e,t);function i(e){d(a,n,r,i,o,"next",e)}function o(e){d(a,n,r,i,o,"throw",e)}i(void 0)}))},function(e){return c.apply(this,arguments)});return a},_=function(e){var t=e.formUuid,n=e.patientUuid,r=e.visitUuid,a=e.visitTypeUuid,o=e.encounterUuid,l=p(n);return s().createElement("div",null,t&&n&&l&&s().createElement(i.ExtensionSlot,{extensionSlotName:"form-widget-slot",state:{view:"form",formUuid:t,visitUuid:null!=r?r:"",visitTypeUuid:null!=a?a:"",patientUuid:n,patient:l,encounterUuid:null!=o?o:"",closeWorkspace:function(){}}}))};var h=n(5697),y=n.n(h),g=n(4184),v=n.n(g),b=n(9033);function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(this,arguments)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=b.Z.prefix,I=[.973051493507435,.15334737213558558,.5671034553053769];function S(e,t,n){return Math.floor(I[n%3]*(t-e+1))+e}var k=function(e){var t,n=e.paragraph,r=e.lineCount,a=e.width,i=e.heading,o=e.className,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["paragraph","lineCount","width","heading","className"]),c=v()((w(t={},"".concat(x,"--skeleton__text"),!0),w(t,"".concat(x,"--skeleton__heading"),i),w(t,o,o),t)),f=parseInt(a,10),u=a.includes("px");if(a.includes("%")&&n){for(var m=[],d=0;d<r;d++){var p=S(0,75,d)+"px";m.push(s().createElement("p",E({className:c,style:{width:"calc(".concat(a," - ").concat(p,")")},key:d},l)))}return s().createElement("div",null,m)}if(u&&n){for(var _=[],h=0;h<r;h++){var y=S(f-75,f,h)+"px";_.push(s().createElement("p",E({className:c,style:{width:y},key:h},l)))}return s().createElement("div",null,_)}return s().createElement("p",E({className:c,style:{width:a}},l))};k.propTypes={className:y().string,heading:y().bool,lineCount:y().number,paragraph:y().bool,width:y().string},k.defaultProps={paragraph:!1,width:"100%",heading:!1,lineCount:3};const C=k;var N=function(e){var t=e.children;return s().createElement("div",{style:{padding:"1rem"}},t)};const A=function(e){var t,n,r,a,i,o,l,c=e.patientUuid,f=p(c),u=null==f||null===(t=f.name)||void 0===t||null===(n=t[0])||void 0===n||null===(r=n.given)||void 0===r?void 0:r[0],m=null==f||null===(a=f.name)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.family,d=null==f||null===(o=f.identifier)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.value;return f?s().createElement(N,null,s().createElement("div",{style:{fontWeight:300,fontSize:"0.8rem",lineHeight:"0.9rem"}},d),s().createElement("div",{style:{fontWeight:"bold"}},u," ",m)):s().createElement(N,null,s().createElement(C,{style:{maxWidth:"8rem"}}))};function O(){return O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=b.Z.prefix,U=function(e){var t,n=e.className,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["className"]),a=v()((P(t={},"".concat(j,"--skeleton__placeholder"),!0),P(t,n,n),t));return s().createElement("div",O({className:a},r))};U.propTypes={className:y().string};const Z=U;var T=n(3379),z=n.n(T),R=n(7795),M=n.n(R),B=n(569),X=n.n(B),q=n(3565),D=n.n(q),W=n(9216),H=n.n(W),L=n(4589),Q=n.n(L),F=n(8407),G={};G.styleTagTransform=Q(),G.setAttributes=D(),G.insert=X().bind(null,"head"),G.domAPI=M(),G.insertStyleElement=H(),z()(F.Z,G);const V=F.Z&&F.Z.locals?F.Z.locals:void 0;var $,J,K=n(3346),Y=["children"],ee=s().forwardRef((function(e,t){var n=e.children,r=(0,K._)(e,Y);return s().createElement(K.I,(0,K.a)({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},r),$||($=s().createElement("path",{d:"M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"})),n)})),te=["children"],ne=s().forwardRef((function(e,t){var n=e.children,r=(0,K._)(e,te);return s().createElement(K.I,(0,K.a)({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},r),J||(J=s().createElement("path",{d:"M8 5L13 10 12.3 10.7 8 6.4 3.7 10.7 3 10z"})),n)})),re=n(3397);function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ie=function(){return s().createElement("div",{className:V.container},s().createElement("div",{className:V.patientInfoContainer},s().createElement(Z,null),s().createElement("div",{className:V.patientInfoContent},s().createElement("div",{className:V.patientInfoRow},s().createElement("span",{className:V.patientName},s().createElement(C,null))),s().createElement("div",{className:V.patientInfoRow},s().createElement("div",{className:V.demographics},s().createElement("span",null,s().createElement(C,null)),s().createElement("span",null,s().createElement(C,null)),s().createElement("span",null,s().createElement(C,null)))),s().createElement("div",{className:V.patientInfoRow},s().createElement("span",{className:V.identifier},s().createElement(C,null))))))};const oe=function(e){var t,n,r,a,c,f,u,m=e.patientUuid,d=p(m),_=(0,re.useTranslation)().t,h=(f=(0,l.useState)(!1),u=2,function(e){if(Array.isArray(e))return e}(f)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(f,u)||function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(f,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=h[0],g=h[1],v="".concat(null===(n=null==d||null===(t=d.name)||void 0===t?void 0:t[0].given)||void 0===n?void 0:n.join(" ")," ").concat(null==d||null===(r=d.name)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.family),b=s().useMemo((function(){return{patientUuid:null==d?void 0:d.id,patientName:v}}),[null==d?void 0:d.id,v]);return d?s().createElement("div",{className:V.container},s().createElement("div",{className:"".concat(y?V.activePatientInfoContainer:V.patientInfoContainer)},s().createElement(i.ExtensionSlot,{extensionSlotName:"patient-photo-slot",state:b}),s().createElement("div",{className:V.patientInfoContent},s().createElement("div",{className:V.patientInfoRow},s().createElement("span",{className:V.patientName},v)),s().createElement("div",{className:V.patientInfoRow},s().createElement("div",{className:V.demographics},s().createElement("span",null,(null!==(c=d.gender)&&void 0!==c?c:_("unknown","Unknown")).replace(/^\w/,(function(e){return e.toUpperCase()}))," ","·"," "),s().createElement("span",null,(0,i.age)(d.birthDate)," · "),s().createElement("span",null,(0,i.formatDate)((0,i.parseDate)(d.birthDate),{mode:"wide",time:!1})))),s().createElement("div",{className:V.patientInfoRow},s().createElement("span",{className:V.identifier},d.identifier.length?d.identifier.map((function(e){return e.value})).join(", "):"--"),s().createElement(o.Z,{kind:"ghost",renderIcon:y?ne:ee,iconDescription:"Toggle contact details",onClick:function(e){return function(e){e.stopPropagation(),g((function(e){return!e}))}(e)},disabled:!0},y?_("showLess","Show less"):_("showAllDetails","Show all details")))))):s().createElement(ie,null)};var le=n(2275),se={};se.styleTagTransform=Q(),se.setAttributes=D(),se.insert=X().bind(null,"head"),se.domAPI=M(),se.insertStyleElement=H(),z()(le.Z,se);const ce=le.Z&&le.Z.locals?le.Z.locals:void 0;function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ue(){return ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ue.apply(this,arguments)}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||de(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e,t){if(e){if("string"==typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}var pe=function(e){var t=e.patientUuids,n=e.setPatientUuids,l=e.setActivePatientUuid;return s().createElement("div",{style:{display:"flex",backgroundColor:"white",padding:"2rem 1rem"}},s().createElement("span",{style:{padding:"1rem"}},"Next patient:"),s().createElement("span",{style:{minWidth:"35rem"}},s().createElement(i.ExtensionSlot,{extensionSlotName:"patient-search-bar-slot",state:{selectPatientAction:function(e){var r;n((r=t,function(e){if(Array.isArray(e))return fe(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||de(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e])),l(e)},buttonProps:{kind:"primary"}}})),s().createElement("span",{style:{padding:"1rem"}},"or"),s().createElement("span",null,s().createElement(o.Z,{disabled:!0},"Create new patient ",s().createElement(r.RVU,null))),s().createElement("span",{style:{flexGrow:1}}),s().createElement("span",null,s().createElement(o.Z,{kind:"ghost",href:"".concat(window.spaBase,"/forms")},"Cancel ",s().createElement(a.dOq,null))))};const _e=function(){var e=(0,c.useParams)().formUuid,t=me((0,l.useState)([]),2),n=t[0],r=t[1],a=me((0,l.useState)(null),2),f=a[0],u=a[1];return s().createElement("div",null,s().createElement("div",{className:ce.breadcrumbsContainer},s().createElement(i.ExtensionSlot,{extensionSlotName:"breadcrumbs-slot"})),!f&&s().createElement(pe,ue({},{patientUuids:n,setPatientUuids:r,setActivePatientUuid:u})),f&&s().createElement(oe,{patientUuid:f}),s().createElement("div",{style:{display:"flex",justifyContent:"center"}},s().createElement("div",{style:{width:"1100px"}},!n.length&&s().createElement("div",{style:{margin:"2rem",textAlign:"center"}},"Please select a patient first"),!!n.length&&s().createElement("div",{className:ce.formContainer},s().createElement("div",{style:{flexGrow:1}},s().createElement(_,ue({patientUuid:f},{formUuid:e}))),s().createElement("div",{style:{width:"13rem",textAlign:"left"}},s().createElement("h4",null,"Forms filled"),s().createElement("div",{style:{margin:"1rem 0",borderBottom:"1px solid #f4f4f4"}},n.map((function(e){return s().createElement(A,{patientUuid:e,key:e})}))),s().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"0.5rem"}},s().createElement(o.Z,{kind:"primary",onClick:function(){return u(null)},style:{width:"100%"}},"Next Patient"),s().createElement(o.Z,{kind:"secondary",disabled:!0,style:{width:"100%"}},"Review & Save"),s().createElement(o.Z,{kind:"tertiary",disabled:!0,style:{width:"100%"}},"Cancel")))))))}},8407:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(3645),a=n.n(r)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;font:inherit;font-size:100%;vertical-align:baseline;border:0}button,select,input,textarea{font-family:inherit;border-radius:0}input[type=text]::-ms-clear{display:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}body{line-height:1}sup{vertical-align:super}sub{vertical-align:sub}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:\"\"}table{border-collapse:collapse;border-spacing:0}*{box-sizing:border-box}button{margin:0}html{font-size:100%}body{font-weight:400;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace}strong{font-weight:600}@media screen and (-ms-high-contrast: active){svg{fill:ButtonText}}h1{font-size:2.625rem;font-weight:300;line-height:1.199;letter-spacing:0}h2{font-size:2rem;font-weight:400;line-height:1.25;letter-spacing:0}h3{font-size:1.75rem;font-weight:400;line-height:1.29;letter-spacing:0}h4{font-size:1.25rem;font-weight:400;line-height:1.4;letter-spacing:0}h5{font-size:1rem;font-weight:600;line-height:1.375;letter-spacing:0}h6{font-size:.875rem;font-weight:600;line-height:1.29;letter-spacing:.16px}p{font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:0}a{color:#0f62fe}em{font-style:italic}@keyframes -esm-fast-data-entry__patient-info__skeleton___SIgE4{0%{transform:scaleX(0);transform-origin:left;opacity:.3}20%{transform:scaleX(1);transform-origin:left;opacity:1}28%{transform:scaleX(1);transform-origin:right}51%{transform:scaleX(0);transform-origin:right}58%{transform:scaleX(0);transform-origin:right}82%{transform:scaleX(1);transform-origin:right}83%{transform:scaleX(1);transform-origin:left}96%{transform:scaleX(0);transform-origin:left}100%{transform:scaleX(0);transform-origin:left;opacity:.3}}.-esm-fast-data-entry__patient-info__container___TUAaR{border-bottom:.0125rem solid #c6c6c6;background-color:#fff;padding:0}.-esm-fast-data-entry__patient-info__patientInfoContainer___A-vPU{padding:0 0 0 1rem;display:flex;align-items:center;min-height:7rem}.-esm-fast-data-entry__patient-info__activePatientInfoContainer___F5QkZ{background-color:#edf5ff;padding:0 0 0 1rem;display:flex;align-items:center;min-height:7rem}.-esm-fast-data-entry__patient-info__patientName___jlZOP{font-size:1.25rem;font-weight:400;line-height:1.4;letter-spacing:0}.-esm-fast-data-entry__patient-info__patientInfoContent___AdJAM{margin:1rem 0 0 1rem;width:100%}.-esm-fast-data-entry__patient-info__demographics___jDIQX{font-size:1rem;font-weight:400;line-height:1.375;letter-spacing:0;color:#525252;margin-top:.25rem}.-esm-fast-data-entry__patient-info__identifier___g\\+HbB{font-size:1rem;font-weight:400;line-height:1.375;letter-spacing:0;color:#8d8d8d}.-esm-fast-data-entry__patient-info__patientInfoRow___4rtW5{display:flex;justify-content:space-between;align-items:center}.-esm-fast-data-entry__patient-info__patientInfoRow___4rtW5>button{min-height:2rem}.-esm-fast-data-entry__patient-info__patientEditBtn___lP3pm{color:#161616;margin:.5rem}",""]),a.locals={container:"-esm-fast-data-entry__patient-info__container___TUAaR",patientInfoContainer:"-esm-fast-data-entry__patient-info__patientInfoContainer___A-vPU",activePatientInfoContainer:"-esm-fast-data-entry__patient-info__activePatientInfoContainer___F5QkZ",patientName:"-esm-fast-data-entry__patient-info__patientName___jlZOP",patientInfoContent:"-esm-fast-data-entry__patient-info__patientInfoContent___AdJAM",demographics:"-esm-fast-data-entry__patient-info__demographics___jDIQX",identifier:"-esm-fast-data-entry__patient-info__identifier___g+HbB",patientInfoRow:"-esm-fast-data-entry__patient-info__patientInfoRow___4rtW5",patientEditBtn:"-esm-fast-data-entry__patient-info__patientEditBtn___lP3pm",skeleton:"-esm-fast-data-entry__patient-info__skeleton___SIgE4"};const i=a},2275:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(3645),a=n.n(r)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__styles__breadcrumbsContainer___ToO0y>div>div>nav{background-color:#fff;padding:.5rem;border-bottom:1px solid #f4f4f4}.-esm-fast-data-entry__styles__formContainer___KZsne{display:flex;text-align:center;margin-top:1rem}",""]),a.locals={breadcrumbsContainer:"-esm-fast-data-entry__styles__breadcrumbsContainer___ToO0y",formContainer:"-esm-fast-data-entry__styles__formContainer___KZsne"};const i=a}}]);
|