uhc-portal-components-react 0.1.23 → 0.1.25

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.25
4
+
5
+ - Render every labelled quantity component of a composite FHIR `Observation` in the shared IPS card, including systolic and diastolic blood-pressure values and units.
6
+
7
+ ## 0.1.24
8
+
9
+ - Reopen an existing vital-sign measurement with its typed values intact, including both systolic and diastolic blood-pressure components.
10
+
3
11
  ## 0.1.23
4
12
 
5
13
  - Add a shared vital-sign editor with an explicit measurement-type selector.
@@ -4,6 +4,11 @@ export type ClinicalSummaryCard = Readonly<{
4
4
  title: string;
5
5
  resourceType: string;
6
6
  date?: string;
7
+ details?: readonly Readonly<{
8
+ label: string;
9
+ value: string;
10
+ unit?: string;
11
+ }>[];
7
12
  }>;
8
13
  export type ClinicalSectionSummaryProps = Readonly<{
9
14
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ClinicalSectionSummary.d.ts","sourceRoot":"","sources":["../src/ClinicalSectionSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IACpD,OAAO,CAAC,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B,EAAE,2BAA2B,+BAiC7B"}
@@ -10,5 +10,5 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
10
10
  export function ClinicalSectionSummary({ code, title, resources, emptyLabel, resourceTypeLabel = (resourceType) => resourceType, actions, showHeader = true, }) {
11
11
  return (_jsxs("section", { className: "uhcp-clinical-section", "data-ips-section": code, ...(showHeader ? { 'aria-labelledby': `uhcp-section-${code}` } : { 'aria-label': title }), children: [showHeader && (_jsxs("header", { children: [_jsxs("h3", { id: `uhcp-section-${code}`, children: [title, " ", _jsxs("span", { children: ["(", resources.length, ")"] })] }), actions] })), resources.length === 0
12
12
  ? _jsx("p", { className: "uhcp-clinical-empty", children: emptyLabel })
13
- : (_jsx("div", { className: "uhcp-clinical-grid", children: resources.map((resource) => (_jsxs("article", { className: "uhcp-clinical-card", "data-resource-type": resource.resourceType, children: [_jsx("p", { className: "uhcp-clinical-title", dir: "auto", children: _jsx("bdi", { children: resource.title }) }), _jsx("p", { className: "uhcp-clinical-type", children: resourceTypeLabel(resource.resourceType) }), resource.date && _jsx("p", { className: "uhcp-clinical-date", children: resource.date })] }, resource.key))) }))] }));
13
+ : (_jsx("div", { className: "uhcp-clinical-grid", children: resources.map((resource) => (_jsxs("article", { className: "uhcp-clinical-card", "data-resource-type": resource.resourceType, children: [_jsx("p", { className: "uhcp-clinical-title", dir: "auto", children: _jsx("bdi", { children: resource.title }) }), _jsx("p", { className: "uhcp-clinical-type", children: resourceTypeLabel(resource.resourceType) }), resource.date && _jsx("p", { className: "uhcp-clinical-date", children: resource.date }), resource.details?.length ? _jsx("dl", { className: "uhcp-clinical-details", children: resource.details.map((detail) => _jsxs("div", { children: [_jsx("dt", { children: detail.label }), _jsxs("dd", { children: [detail.value, detail.unit ? ` ${detail.unit}` : ''] })] }, `${detail.label}:${detail.value}:${detail.unit ?? ''}`)) }) : null] }, resource.key))) }))] }));
14
14
  }
@@ -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;AAGzD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,0BAA0B,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,MAAM,GAAG,SAAS,CAAA;IAClF,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,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;CAC7D,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,aAAa,EACb,UAAU,EACV,eAA4B,EAC5B,YAAyC,EACzC,iBAAiB,EACjB,cAAc,GACf,EAAE,qBAAqB,+BA2BvB"}
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;AAGzD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,0BAA0B,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,MAAM,GAAG,SAAS,CAAA;IAClF,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,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;CAC7D,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,aAAa,EACb,UAAU,EACV,eAA4B,EAC5B,YAAyC,EACzC,iBAAiB,EACjB,cAAc,GACf,EAAE,qBAAqB,+BA+BvB"}
@@ -12,6 +12,7 @@ import { ClinicalSectionSummary } from './ClinicalSectionSummary.js';
12
12
  */
13
13
  export function IpsBundleSummary({ bundle, locale, translateCode, emptyLabel, noSectionsLabel = emptyLabel, sectionTitle = (section) => section.title, resourceTypeLabel, sectionActions, }) {
14
14
  const sections = toClinicalSectionViews(bundle, { locale, translateCode });
15
+ const nativeResources = new Map((bundle.entry ?? bundle.data ?? []).flatMap((entry) => entry.fullUrl && entry.resource ? [[entry.fullUrl, entry.resource]] : []));
15
16
  if (sections.length === 0) {
16
17
  return _jsx("p", { className: "uhcp-clinical-empty", "data-ips-summary-empty": true, children: noSectionsLabel });
17
18
  }
@@ -20,5 +21,20 @@ export function IpsBundleSummary({ bundle, locale, translateCode, emptyLabel, no
20
21
  title: resource.title,
21
22
  resourceType: resource.resourceType,
22
23
  date: resource.date,
24
+ details: observationComponentDetails(nativeResources.get(resource.fullUrl ?? '')),
23
25
  })), emptyLabel: emptyLabel, resourceTypeLabel: resourceTypeLabel, actions: sectionActions?.(section) }, section.code ?? `${section.title}:${sectionIndex}`))) }));
24
26
  }
27
+ function observationComponentDetails(resource) {
28
+ const candidate = resource;
29
+ if (candidate?.resourceType !== 'Observation' || !Array.isArray(candidate.component))
30
+ return undefined;
31
+ const details = candidate.component.flatMap((value) => {
32
+ const component = value;
33
+ const label = component.code?.text ?? component.code?.coding?.find((coding) => coding.display)?.display;
34
+ const quantity = component.valueQuantity;
35
+ if (!label || !Number.isFinite(quantity?.value))
36
+ return [];
37
+ return [{ label, value: String(quantity.value), ...(quantity?.unit ? { unit: quantity.unit } : {}) }];
38
+ });
39
+ return details.length ? details : undefined;
40
+ }
@@ -18,6 +18,7 @@ export type VitalSignKindLabels = Readonly<Record<VitalSignKind, string>>;
18
18
  export type VitalSignArtifactEditorProps = Readonly<{
19
19
  entryId: string;
20
20
  subjectReference: string;
21
+ initialMeasurement?: VitalSignMeasurement;
21
22
  copy: VitalSignArtifactEditorCopy;
22
23
  kindLabels: VitalSignKindLabels;
23
24
  saveMeasurement: (measurement: VitalSignMeasurement) => Promise<ClinicalResourceBundleLike | undefined>;
@@ -25,5 +26,5 @@ export type VitalSignArtifactEditorProps = Readonly<{
25
26
  onReadback: (bundle: ClinicalResourceBundleLike) => void;
26
27
  }>;
27
28
  /** Shared vital-sign capture. Composite values remain one typed measurement. */
28
- export declare function VitalSignArtifactEditor({ entryId, subjectReference, copy, kindLabels, saveMeasurement, onCancel, onReadback, }: VitalSignArtifactEditorProps): import("react").JSX.Element;
29
+ export declare function VitalSignArtifactEditor({ entryId, subjectReference, initialMeasurement, copy, kindLabels, saveMeasurement, onCancel, onReadback, }: VitalSignArtifactEditorProps): import("react").JSX.Element;
29
30
  //# sourceMappingURL=VitalSignArtifactEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VitalSignArtifactEditor.d.ts","sourceRoot":"","sources":["../src/VitalSignArtifactEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAA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eze([
11
11
  'body-weight',
12
12
  ]);
13
13
  /** Shared vital-sign capture. Composite values remain one typed measurement. */
14
- export function VitalSignArtifactEditor({ entryId, subjectReference, copy, kindLabels, saveMeasurement, onCancel, onReadback, }) {
14
+ export function VitalSignArtifactEditor({ entryId, subjectReference, initialMeasurement, copy, kindLabels, saveMeasurement, onCancel, onReadback, }) {
15
15
  const titleId = useId();
16
16
  const descriptionId = useId();
17
- const [kind, setKind] = useState('oxygen-saturation');
18
- const [measuredAt, setMeasuredAt] = useState('');
19
- const [value, setValue] = useState('');
20
- const [systolic, setSystolic] = useState('');
21
- const [diastolic, setDiastolic] = useState('');
17
+ const [kind, setKind] = useState(initialMeasurement?.kind ?? 'oxygen-saturation');
18
+ const [measuredAt, setMeasuredAt] = useState(initialMeasurement?.measuredAt ?? '');
19
+ const [value, setValue] = useState(initialMeasurement && initialMeasurement.kind !== 'blood-pressure' ? String(initialMeasurement.value) : '');
20
+ const [systolic, setSystolic] = useState(initialMeasurement?.kind === 'blood-pressure' ? String(initialMeasurement.systolic) : '');
21
+ const [diastolic, setDiastolic] = useState(initialMeasurement?.kind === 'blood-pressure' ? String(initialMeasurement.diastolic) : '');
22
22
  const [saving, setSaving] = useState(false);
23
23
  const [error, setError] = useState('');
24
24
  async function submit() {
package/dist/styles.css CHANGED
@@ -409,6 +409,10 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
409
409
  .uhcp-clinical-title { font-weight: 800; margin: 0; }
410
410
  .uhcp-clinical-type { color: var(--uhcp-muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; margin: .35rem 0 0; text-transform: uppercase; }
411
411
  .uhcp-clinical-date, .uhcp-clinical-empty { color: var(--uhcp-muted); margin: .35rem 0 0; }
412
+ .uhcp-clinical-details { display: grid; gap: .3rem; margin: .6rem 0 0; }
413
+ .uhcp-clinical-details div { align-items: baseline; display: flex; gap: .75rem; justify-content: space-between; }
414
+ .uhcp-clinical-details dt { color: var(--uhcp-muted); font-size: .78rem; }
415
+ .uhcp-clinical-details dd { font-size: .9rem; font-weight: 800; margin: 0; }
412
416
  .uhcp-access-panel { color: var(--uhcp-text); display: grid; gap: 1rem; }
413
417
  .uhcp-access-panel h2, .uhcp-access-panel p { margin: 0; }
414
418
  .uhcp-access-panel > p { color: var(--uhcp-muted); line-height: 1.5; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uhc-portal-components-react",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "Brand-neutral React portal shell, account preferences and protected-profile UI for UHC and VetChain portals.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",