uhc-portal-components-react 0.1.48 → 0.1.49
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/CHANGELOG.md +10 -0
- package/dist/ClinicalBundleDraftEditor.d.ts +5 -1
- package/dist/ClinicalBundleDraftEditor.d.ts.map +1 -1
- package/dist/ClinicalBundleDraftEditor.js +29 -13
- package/dist/IpsBundleSummary.d.ts +3 -1
- package/dist/IpsBundleSummary.d.ts.map +1 -1
- package/dist/IpsBundleSummary.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.49 - 2026-10-08
|
|
6
|
+
|
|
7
|
+
- Start new clinical documents without pre-rendered empty sections. Authors add
|
|
8
|
+
a section first, then add resources from that section; a resource-type choice
|
|
9
|
+
appears only when the selected section supports more than one resource.
|
|
10
|
+
- Expose each prepared local document Bundle to host-owned download or
|
|
11
|
+
credential actions without crossing the final submission boundary.
|
|
12
|
+
- Allow the reusable IPS summary to omit sections that contain no records while
|
|
13
|
+
preserving localized terminology rendering for populated resource cards.
|
|
14
|
+
|
|
5
15
|
## 0.1.48 - 2026-10-08
|
|
6
16
|
|
|
7
17
|
- Add an opt-in V2 clinical authoring shell without changing the existing V1
|
|
@@ -30,7 +30,9 @@ export type ClinicalBundleDraftEditorCopy = Readonly<{
|
|
|
30
30
|
add: string;
|
|
31
31
|
section?: string;
|
|
32
32
|
resourceType?: string;
|
|
33
|
+
addSection?: string;
|
|
33
34
|
addEntry?: string;
|
|
35
|
+
chooseResource?: string;
|
|
34
36
|
edit: string;
|
|
35
37
|
remove: string;
|
|
36
38
|
submit: string;
|
|
@@ -51,6 +53,8 @@ export type ClinicalBundleDraftEditorProps = Readonly<{
|
|
|
51
53
|
loadTerminologySources?: ClinicalTerminologySourceSearch;
|
|
52
54
|
/** Optional claims-first document Bundle loaded into the local draft; loading it never persists. */
|
|
53
55
|
initialBundle?: ClinicalBundleDraft;
|
|
56
|
+
/** Observes the local draft only; it does not persist or submit it. */
|
|
57
|
+
onDraftChange?: (bundle: ClinicalBundleDraft | undefined) => void;
|
|
54
58
|
onSubmitDraft: (bundle: ClinicalBundleDraft) => Promise<ClinicalBundleDraftSubmitOutcome>;
|
|
55
59
|
editorVersion?: 'v1' | 'v2';
|
|
56
60
|
editorV2Copy?: ImmunizationArtifactEditorCopyV2;
|
|
@@ -66,7 +70,7 @@ type StagedArtifact = Readonly<{
|
|
|
66
70
|
* It owns no authorization or persistence: the host supplies subject and
|
|
67
71
|
* provenance and only `onSubmitDraft` may cross a persistence boundary.
|
|
68
72
|
*/
|
|
69
|
-
export declare function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, locale, timeZone, taxonomyId, fieldLabel, resourceTypeLabel, searchTerminology, loadTerminologySources, initialBundle, onSubmitDraft, editorVersion, editorV2Copy, }: ClinicalBundleDraftEditorProps): import("react").JSX.Element;
|
|
73
|
+
export declare function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, locale, timeZone, taxonomyId, fieldLabel, resourceTypeLabel, searchTerminology, loadTerminologySources, initialBundle, onDraftChange, onSubmitDraft, editorVersion, editorV2Copy, }: ClinicalBundleDraftEditorProps): import("react").JSX.Element;
|
|
70
74
|
export declare function combineClinicalDrafts(artifacts: readonly StagedArtifact[], authoringContext: ClinicalArtifactAuthoringContext, documentTitle: string): ClinicalBundleDraft;
|
|
71
75
|
export type ClinicalBundleDraftEditorV2Props = Omit<ClinicalBundleDraftEditorProps, 'editorVersion' | 'editorV2Copy'> & Readonly<{
|
|
72
76
|
editorV2Copy: ImmunizationArtifactEditorCopyV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClinicalBundleDraftEditor.d.ts","sourceRoot":"","sources":["../src/ClinicalBundleDraftEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,4DAA4D,CAAA;AACnE,OAAO,kD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AAQ,CAAC;IAC7B,MAAM,EAAE,yBAAyB,CAAA;IACjC,KAAK,EAAE,qBAAqB,CAAA;CAC7B,CAAC,CAAA;AAYF;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,gBAAgB,EAChB,IAAI,EACJ,MAAa,EACb,QAAQ,EACR,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAoB,EACpB,YAAY,GACb,EAAE,8BAA8B,+BAgIhC;AAWD,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,gBAAgB,EAAE,gCAAgC,EAClD,aAAa,EAAE,MAAM,GACpB,mBAAmB,CAsDrB;AAED,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,8BAA8B,EAAE,eAAe,GAAG,cAAc,CAAC,GAAG,QAAQ,CAAC;IAC/H,YAAY,EAAE,gCAAgC,CAAA;CAC/C,CAAC,CAAA;AAEF,kFAAkF;AAClF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,+BAElF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { BundleEditor } from 'gdc-common-utils-ts/utils/bundle-editor-core';
|
|
5
5
|
import { BundleTypes } from 'gdc-common-utils-ts/models/bundle-editor-types';
|
|
6
6
|
import { HealthcareDocumentTypes } from 'gdc-common-utils-ts/constants/healthcare';
|
|
@@ -23,17 +23,20 @@ import { ImmunizationArtifactEditorV2, } from './ImmunizationArtifactEditorV2.js
|
|
|
23
23
|
* It owns no authorization or persistence: the host supplies subject and
|
|
24
24
|
* provenance and only `onSubmitDraft` may cross a persistence boundary.
|
|
25
25
|
*/
|
|
26
|
-
export function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, locale = 'en', timeZone, taxonomyId, fieldLabel, resourceTypeLabel, searchTerminology, loadTerminologySources, initialBundle, onSubmitDraft, editorVersion = 'v1', editorV2Copy, }) {
|
|
26
|
+
export function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, locale = 'en', timeZone, taxonomyId, fieldLabel, resourceTypeLabel, searchTerminology, loadTerminologySources, initialBundle, onDraftChange, onSubmitDraft, editorVersion = 'v1', editorV2Copy, }) {
|
|
27
27
|
const [artifacts, setArtifacts] = useState(() => importedArtifacts(initialBundle, schemas));
|
|
28
28
|
const [editor, setEditor] = useState();
|
|
29
|
+
const [resourceChooser, setResourceChooser] = useState();
|
|
29
30
|
const [notice, setNotice] = useState('');
|
|
30
31
|
const [error, setError] = useState('');
|
|
31
32
|
const [submitting, setSubmitting] = useState(false);
|
|
32
33
|
const sections = useMemo(() => groupSchemas(schemas), [schemas]);
|
|
34
|
+
const [activeSections, setActiveSections] = useState(() => [...new Set(importedArtifacts(initialBundle, schemas).map(artifact => artifact.schema.sectionLabel))]);
|
|
33
35
|
const [selectedSection, setSelectedSection] = useState(() => groupSchemas(schemas)[0]?.label ?? '');
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const availableSections = sections.filter(section => !activeSections.includes(section.label));
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
onDraftChange?.(artifacts.length ? combineClinicalDrafts(artifacts, authoringContext, copy.title) : undefined);
|
|
39
|
+
}, [artifacts, authoringContext, copy.title, onDraftChange]);
|
|
37
40
|
function stageArtifact(draft) {
|
|
38
41
|
if (!editor)
|
|
39
42
|
throw new TypeError('clinical_bundle_draft_editor_schema_required');
|
|
@@ -53,6 +56,7 @@ export function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, loc
|
|
|
53
56
|
const outcome = await onSubmitDraft(combineClinicalDrafts(artifacts, authoringContext, copy.title));
|
|
54
57
|
if (outcome.state === 'confirmed') {
|
|
55
58
|
setArtifacts([]);
|
|
59
|
+
setActiveSections([]);
|
|
56
60
|
setNotice(outcome.message || '');
|
|
57
61
|
}
|
|
58
62
|
else if (outcome.state === 'rejected') {
|
|
@@ -69,18 +73,30 @@ export function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, loc
|
|
|
69
73
|
setSubmitting(false);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
|
-
return _jsxs("section", { className: "uhcp-clinical-bundle-draft", "data-clinical-bundle-draft": true, children: [_jsxs("header", { children: [_jsx("h2", { children: copy.title }), _jsx("p", { children: copy.description })] }), notice ? _jsx("p", { role: "status", children: notice }) : null, error ? _jsx("p", { role: "alert", className: "uhcp-clinical-editor-error", children: error }) : null,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
return _jsxs("section", { className: "uhcp-clinical-bundle-draft", "data-clinical-bundle-draft": true, children: [_jsxs("header", { children: [_jsx("h2", { children: copy.title }), _jsx("p", { children: copy.description })] }), notice ? _jsx("p", { role: "status", children: notice }) : null, error ? _jsx("p", { role: "alert", className: "uhcp-clinical-editor-error", children: error }) : null, availableSections.length ? _jsxs("div", { className: "uhcp-clinical-bundle-draft-create", children: [_jsxs("label", { children: [copy.section || 'Section', _jsx("select", { value: availableSections.some(section => section.label === selectedSection) ? selectedSection : availableSections[0]?.label, onChange: (event) => setSelectedSection(event.currentTarget.value), children: availableSections.map(section => _jsx("option", { value: section.label, children: section.label }, section.label)) })] }), _jsxs("button", { type: "button", onClick: () => {
|
|
77
|
+
const label = availableSections.some(section => section.label === selectedSection) ? selectedSection : availableSections[0]?.label;
|
|
78
|
+
if (!label)
|
|
79
|
+
return;
|
|
80
|
+
setActiveSections(current => [...current, label]);
|
|
81
|
+
const nextAvailable = availableSections.find(section => section.label !== label);
|
|
82
|
+
setSelectedSection(nextAvailable?.label ?? '');
|
|
83
|
+
}, children: ["+ ", copy.addSection || copy.add] })] }) : null, sections.filter(section => activeSections.includes(section.label)).map(({ label, schemas: sectionSchemas }) => {
|
|
78
84
|
const sectionArtifacts = artifacts.filter((artifact) => artifact.schema.sectionLabel === label);
|
|
79
|
-
return _jsxs("details", { open: true, children: [_jsxs("summary", { children: [label, " (", sectionArtifacts.length, ")"] }),
|
|
85
|
+
return _jsxs("details", { open: true, children: [_jsxs("summary", { children: [label, " (", sectionArtifacts.length, ")"] }), _jsxs("button", { type: "button", onClick: () => {
|
|
86
|
+
if (sectionSchemas.length === 1)
|
|
87
|
+
setEditor({ schema: sectionSchemas[0] });
|
|
88
|
+
else
|
|
89
|
+
setResourceChooser({ sectionLabel: label, schemaKey: schemaKey(sectionSchemas[0]) });
|
|
90
|
+
}, children: ["+ ", copy.addEntry || copy.add] }), resourceChooser?.sectionLabel === label ? _jsxs("div", { className: "uhcp-clinical-bundle-resource-choice", children: [_jsxs("label", { children: [copy.resourceType || 'Resource type', _jsx("select", { value: resourceChooser.schemaKey, onChange: event => setResourceChooser({ sectionLabel: label, schemaKey: event.currentTarget.value }), children: sectionSchemas.map(candidate => _jsx("option", { value: schemaKey(candidate), children: resourceTypeLabel?.(candidate.schema.resourceType) || candidate.artifactLabel }, schemaKey(candidate))) })] }), _jsx("button", { type: "button", onClick: () => {
|
|
91
|
+
const selected = sectionSchemas.find(candidate => schemaKey(candidate) === resourceChooser.schemaKey);
|
|
92
|
+
if (selected)
|
|
93
|
+
setEditor({ schema: selected });
|
|
94
|
+
setResourceChooser(undefined);
|
|
95
|
+
}, children: copy.chooseResource || copy.add })] }) : null, sectionArtifacts.length === 0 ? _jsx("p", { children: copy.empty }) : _jsx("ul", { children: sectionArtifacts.map((artifact) => {
|
|
80
96
|
const title = artifactTitle(artifact.draft);
|
|
81
97
|
return _jsxs("li", { children: [_jsxs("span", { children: [_jsx("strong", { children: title }), _jsx("small", { children: artifact.draft.resourceType })] }), _jsxs("span", { children: [_jsx(ClinicalActionButton, { kind: "edit", label: `${copy.edit} ${title}`, onClick: () => setEditor({ schema: artifact.schema, draft: artifact.draft }) }), _jsx(ClinicalActionButton, { kind: "delete", label: `${copy.remove} ${title}`, onClick: () => setArtifacts((current) => current.filter((candidate) => candidate.draft.id !== artifact.draft.id)) })] })] }, artifact.draft.id);
|
|
82
98
|
}) })] }, label);
|
|
83
|
-
}),
|
|
99
|
+
}), activeSections.length === 0 ? _jsx("p", { children: copy.empty }) : null, _jsx("footer", { children: _jsx("button", { type: "button", disabled: artifacts.length === 0 || submitting, onClick: () => void submitDraft(), children: submitting ? copy.submitting : copy.submit }) }), editor && editorVersion === 'v2' && editor.schema.schema.resourceType === 'Immunization' && editorV2Copy ? _jsx(ImmunizationArtifactEditorV2, { request: editorRequest(editor), authoringContext: authoringContext, copy: editorV2Copy, locale: locale, timeZone: timeZone, taxonomyId: taxonomyId, fieldLabel: fieldLabel, resourceTypeLabel: resourceTypeLabel?.(editor.schema.schema.resourceType) || editor.schema.artifactLabel, searchTerminology: searchTerminology, loadTerminologySources: loadTerminologySources, saveArtifact: async (draft) => stageArtifact(draft), onCancel: () => setEditor(undefined), onReadback: () => setEditor(undefined) }) : editor ? _jsx(ClinicalArtifactEditor, { request: editorRequest(editor), schema: editor.schema.schema, operationSchema: editor.schema.operationSchema, authoringContext: authoringContext, copy: copy.editor, locale: locale, timeZone: timeZone, taxonomyId: taxonomyId, fieldLabel: fieldLabel, resourceTypeLabel: resourceTypeLabel?.(editor.schema.schema.resourceType) || editor.schema.artifactLabel, searchTerminology: searchTerminology, loadTerminologySources: loadTerminologySources, saveArtifact: async (draft) => stageArtifact(draft), onCancel: () => setEditor(undefined), onReadback: () => setEditor(undefined) }) : null] });
|
|
84
100
|
}
|
|
85
101
|
function editorRequest(editor) {
|
|
86
102
|
return {
|
|
@@ -8,6 +8,8 @@ export type IpsBundleSummaryProps = Readonly<{
|
|
|
8
8
|
translateCode?: (input: ClinicalTerminologyTranslationInput) => string | undefined;
|
|
9
9
|
emptyLabel: string;
|
|
10
10
|
noSectionsLabel?: string;
|
|
11
|
+
/** Omits Composition sections that resolve to no resources. */
|
|
12
|
+
hideEmptySections?: boolean;
|
|
11
13
|
sectionTitle?: (section: ClinicalSectionView) => string;
|
|
12
14
|
resourceTypeLabel?: (resourceType: string) => string;
|
|
13
15
|
sectionActions?: (section: ClinicalSectionView) => ReactNode;
|
|
@@ -28,5 +30,5 @@ export type IpsBundleSummaryProps = Readonly<{
|
|
|
28
30
|
* native FHIR fields or canonical `resource.meta.claims` provide card content.
|
|
29
31
|
* This component performs no ingestion, persistence or GW call.
|
|
30
32
|
*/
|
|
31
|
-
export declare function IpsBundleSummary({ bundle, locale, timeZone, translateCode, emptyLabel, noSectionsLabel, sectionTitle, resourceTypeLabel, sectionActions, resourceActions, timeline, }: IpsBundleSummaryProps): import("react").JSX.Element;
|
|
33
|
+
export declare function IpsBundleSummary({ bundle, locale, timeZone, translateCode, emptyLabel, noSectionsLabel, hideEmptySections, sectionTitle, resourceTypeLabel, sectionActions, resourceActions, timeline, }: IpsBundleSummaryProps): import("react").JSX.Element;
|
|
32
34
|
//# sourceMappingURL=IpsBundleSummary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpsBundleSummary.d.ts","sourceRoot":"","sources":["../src/IpsBundleSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,mCAAmC,EACzC,MAAM,kDAAkD,CAAA;AAEzD,OAAO,EAAgD,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAEjH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,0BAA0B,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,MAAM,GAAG,SAAS,CAAA;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,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,MAAM,GAAG,SAAS,CAAA;IAClF,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,MAAM,CAAA;IACvD,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IACpD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,SAAS,CAAA;IAC5D,yFAAyF;IACzF,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,SAAS,CAAA;IACjH,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAClB,MAAM,EAAE,sBAAsB,CAAA;QAC9B,iBAAiB,EAAE,MAAM,CAAA;QACzB,sBAAsB,EAAE,MAAM,CAAA;KAC/B,CAAC,CAAA;CACH,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAA4B,EAC5B,iBAAyB,EACzB,YAAyC,EACzC,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,QAAQ,GACT,EAAE,qBAAqB,+BAsEvB"}
|
package/dist/IpsBundleSummary.js
CHANGED
|
@@ -11,8 +11,9 @@ import { ClinicalTimeline } from './ClinicalTimeline.js';
|
|
|
11
11
|
* native FHIR fields or canonical `resource.meta.claims` provide card content.
|
|
12
12
|
* This component performs no ingestion, persistence or GW call.
|
|
13
13
|
*/
|
|
14
|
-
export function IpsBundleSummary({ bundle, locale, timeZone, translateCode, emptyLabel, noSectionsLabel = emptyLabel, sectionTitle = (section) => section.title, resourceTypeLabel, sectionActions, resourceActions, timeline, }) {
|
|
15
|
-
const sections = toClinicalSectionViews(bundle, { locale, translateCode })
|
|
14
|
+
export function IpsBundleSummary({ bundle, locale, timeZone, translateCode, emptyLabel, noSectionsLabel = emptyLabel, hideEmptySections = false, sectionTitle = (section) => section.title, resourceTypeLabel, sectionActions, resourceActions, timeline, }) {
|
|
15
|
+
const sections = toClinicalSectionViews(bundle, { locale, translateCode })
|
|
16
|
+
.filter(section => !hideEmptySections || section.resources.length > 0);
|
|
16
17
|
const nativeResources = new Map((bundle.entry ?? bundle.data ?? []).flatMap((entry) => entry.fullUrl && entry.resource ? [[entry.fullUrl, entry.resource]] : []));
|
|
17
18
|
if (sections.length === 0) {
|
|
18
19
|
return _jsx("p", { className: "uhcp-clinical-empty", "data-ips-summary-empty": true, children: noSectionsLabel });
|
package/package.json
CHANGED