UNPKG

hi-profiles

Version:

React components for the ABDM Health Information Profiles

1,228 lines 51.8 kB
var ye = Object.defineProperty; var je = (n, t, r) => t in n ? ye(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r; var te = (n, t, r) => je(n, typeof t != "symbol" ? t + "" : t, r); import w, { createContext as ve, useContext as se } from "react"; var ne = { exports: {} }, U = {}; /** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var oe; function Ne() { if (oe) return U; oe = 1; var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment"); function r(e, l, s) { var c = null; if (s !== void 0 && (c = "" + s), l.key !== void 0 && (c = "" + l.key), "key" in l) { s = {}; for (var d in l) d !== "key" && (s[d] = l[d]); } else s = l; return l = s.ref, { $$typeof: n, type: e, key: c, ref: l !== void 0 ? l : null, props: s }; } return U.Fragment = t, U.jsx = r, U.jsxs = r, U; } var V = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ce; function be() { return ce || (ce = 1, process.env.NODE_ENV !== "production" && function() { function n(i) { if (i == null) return null; if (typeof i == "function") return i.$$typeof === K ? null : i.displayName || i.name || null; if (typeof i == "string") return i; switch (i) { case D: return "Fragment"; case H: return "Profiler"; case F: return "StrictMode"; case J: return "Suspense"; case G: return "SuspenseList"; case Q: return "Activity"; } if (typeof i == "object") switch (typeof i.tag == "number" && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), i.$$typeof) { case A: return "Portal"; case q: return (i.displayName || "Context") + ".Provider"; case W: return (i._context.displayName || "Context") + ".Consumer"; case Z: var m = i.render; return i = i.displayName, i || (i = m.displayName || m.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i; case X: return m = i.displayName || null, m !== null ? m : n(i.type) || "Memo"; case k: m = i._payload, i = i._init; try { return n(i(m)); } catch { } } return null; } function t(i) { return "" + i; } function r(i) { try { t(i); var m = !1; } catch { m = !0; } if (m) { m = console; var g = m.error, h = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object"; return g.call( m, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", h ), t(i); } } function e(i) { if (i === D) return "<>"; if (typeof i == "object" && i !== null && i.$$typeof === k) return "<...>"; try { var m = n(i); return m ? "<" + m + ">" : "<...>"; } catch { return "<...>"; } } function l() { var i = S.A; return i === null ? null : i.getOwner(); } function s() { return Error("react-stack-top-frame"); } function c(i) { if (B.call(i, "key")) { var m = Object.getOwnPropertyDescriptor(i, "key").get; if (m && m.isReactWarning) return !1; } return i.key !== void 0; } function d(i, m) { function g() { $ || ($ = !0, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", m )); } g.isReactWarning = !0, Object.defineProperty(i, "key", { get: g, configurable: !0 }); } function o() { var i = n(this.type); return I[i] || (I[i] = !0, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )), i = this.props.ref, i !== void 0 ? i : null; } function u(i, m, g, h, R, b, O, E) { return g = b.ref, i = { $$typeof: N, type: i, key: m, props: b, _owner: R }, (g !== void 0 ? g : null) !== null ? Object.defineProperty(i, "ref", { enumerable: !1, get: o }) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(i, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.defineProperty(i, "_debugStack", { configurable: !1, enumerable: !1, writable: !0, value: O }), Object.defineProperty(i, "_debugTask", { configurable: !1, enumerable: !1, writable: !0, value: E }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i; } function p(i, m, g, h, R, b, O, E) { var j = m.children; if (j !== void 0) if (h) if (ee(j)) { for (h = 0; h < j.length; h++) f(j[h]); Object.freeze && Object.freeze(j); } else console.error( "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." ); else f(j); if (B.call(m, "key")) { j = n(i); var T = Object.keys(m).filter(function(he) { return he !== "key"; }); h = 0 < T.length ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}", z[j + h] || (T = 0 < T.length ? "{" + T.join(": ..., ") + ": ...}" : "{}", console.error( `A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, h, j, T, j ), z[j + h] = !0); } if (j = null, g !== void 0 && (r(g), j = "" + g), c(m) && (r(m.key), j = "" + m.key), "key" in m) { g = {}; for (var ie in m) ie !== "key" && (g[ie] = m[ie]); } else g = m; return j && d( g, typeof i == "function" ? i.displayName || i.name || "Unknown" : i ), u( i, j, b, R, l(), g, O, E ); } function f(i) { typeof i == "object" && i !== null && i.$$typeof === N && i._store && (i._store.validated = 1); } var y = w, N = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), D = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), W = Symbol.for("react.consumer"), q = Symbol.for("react.context"), Z = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), S = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, ee = Array.isArray, P = console.createTask ? console.createTask : function() { return null; }; y = { "react-stack-bottom-frame": function(i) { return i(); } }; var $, I = {}, L = y["react-stack-bottom-frame"].bind( y, s )(), M = P(e(s)), z = {}; V.Fragment = D, V.jsx = function(i, m, g, h, R) { var b = 1e4 > S.recentlyCreatedOwnerStacks++; return p( i, m, g, !1, h, R, b ? Error("react-stack-top-frame") : L, b ? P(e(i)) : M ); }, V.jsxs = function(i, m, g, h, R) { var b = 1e4 > S.recentlyCreatedOwnerStacks++; return p( i, m, g, !0, h, R, b ? Error("react-stack-top-frame") : L, b ? P(e(i)) : M ); }; }()), V; } var de; function Re() { return de || (de = 1, process.env.NODE_ENV === "production" ? ne.exports = Ne() : ne.exports = be()), ne.exports; } var a = Re(); class Ae { constructor(t) { te(this, "_bundle"); te(this, "_composition"); te(this, "_entries"); this._bundle = t, this._composition = this.composition, this._entries = this.entries; } get bundle() { return this._bundle; } get composition() { var t, r; if (!this._composition) { const e = (r = (t = this.bundle.entry) == null ? void 0 : t.find( (l) => { var s; return ((s = l.resource) == null ? void 0 : s.resourceType.toLowerCase()) === "composition"; } )) == null ? void 0 : r.resource; if (!e) throw new Error("No composition found in bundle"); this._composition = e; } return this._composition; } get entries() { return this._entries || (this._entries = this.bundle.entry ?? []), this._entries; } get details() { var t, r; return { title: this.composition.title, date: this.composition.date ?? ((t = this.composition.meta) == null ? void 0 : t.lastUpdated) ?? this.bundle.timestamp, authors: (r = this.composition.author) == null ? void 0 : r.map((e) => this.getResource(e.reference)).filter((e) => e), status: this.composition.status }; } parseHumanName(t) { return t ? [ t.prefix ?? "", t.text ?? [t.given ?? "", t.family ?? ""].join(" ").trim(), t.suffix ?? "" ].join(" ").trim() : ""; } getAuthorName(t) { var r, e, l, s; if (!t) return null; switch (t.resourceType) { case "Patient": return this.parseHumanName((r = t.name) == null ? void 0 : r[0]); case "Practitioner": return this.parseHumanName((e = t.name) == null ? void 0 : e[0]); case "PractitionerRole": return `${(l = t.practitioner) == null ? void 0 : l.display}`; case "Organization": return `${t.name}`; case "Device": return `${t.deviceName}`; case "RelatedPerson": return this.parseHumanName((s = t.name) == null ? void 0 : s[0]); default: return ""; } } getConceptDisplay(t) { if (!t) return null; if (t.text) return t.text; if (t.coding) for (const r of t.coding) { const e = this.getCodingDisplay(r); if (e) return e; } return ""; } getCodingDisplay(t) { return t.display ?? t.code ?? ""; } getObservationValue(t) { var r, e, l, s, c, d, o, u, p, f, y, N, A, D, F, H, W, q, Z, J, G, X, k, Q, K, S, B, ee, P, $, I, L, M, z, i, m, g, h, R, b, O, E; return "valueString" in t ? t.valueString ?? "" : "valueQuantity" in t ? ((e = (r = t.valueQuantity) == null ? void 0 : r.value) == null ? void 0 : e.toString()) + " " + ((l = t.valueQuantity) == null ? void 0 : l.unit) : "valueCodeableConcept" in t ? this.getConceptDisplay(t.valueCodeableConcept) ?? "" : "valueBoolean" in t ? ((s = t.valueBoolean) == null ? void 0 : s.toString()) ?? "" : "valueInteger" in t ? ((c = t.valueInteger) == null ? void 0 : c.toString()) ?? "" : "valueDateTime" in t ? ((d = t.valueDateTime) == null ? void 0 : d.toString()) ?? "" : "valueTime" in t ? ((o = t.valueTime) == null ? void 0 : o.toString()) ?? "" : "valueRange" in t ? ((f = (p = (u = t.valueRange) == null ? void 0 : u.low) == null ? void 0 : p.value) == null ? void 0 : f.toString()) ?? " " + ((N = (y = t.valueRange) == null ? void 0 : y.low) == null ? void 0 : N.unit) ?? " - " + ((F = (D = (A = t.valueRange) == null ? void 0 : A.high) == null ? void 0 : D.value) == null ? void 0 : F.toString()) ?? " " + ((W = (H = t.valueRange) == null ? void 0 : H.high) == null ? void 0 : W.unit) ?? "" : "valueRatio" in t ? ((J = (Z = (q = t.valueRatio) == null ? void 0 : q.numerator) == null ? void 0 : Z.value) == null ? void 0 : J.toString()) ?? " " + ((X = (G = t.valueRatio) == null ? void 0 : G.numerator) == null ? void 0 : X.unit) ?? " : " + ((K = (Q = (k = t.valueRatio) == null ? void 0 : k.denominator) == null ? void 0 : Q.value) == null ? void 0 : K.toString()) ?? " " + ((B = (S = t.valueRatio) == null ? void 0 : S.denominator) == null ? void 0 : B.unit) ?? "" : "valueSampledData" in t ? (($ = (P = (ee = t.valueSampledData) == null ? void 0 : ee.origin) == null ? void 0 : P.value) == null ? void 0 : $.toString()) ?? " " + ((L = (I = t.valueSampledData) == null ? void 0 : I.origin) == null ? void 0 : L.unit) ?? " : " + ((z = (M = t.valueSampledData) == null ? void 0 : M.period) == null ? void 0 : z.toString()) ?? " " + ((m = (i = t.valueSampledData) == null ? void 0 : i.dimensions) == null ? void 0 : m.toString()) ?? " " + ((h = (g = t.valueSampledData) == null ? void 0 : g.data) == null ? void 0 : h.toString()) ?? "" : "valuePeriod" in t ? ((b = (R = t.valuePeriod) == null ? void 0 : R.start) == null ? void 0 : b.toString()) ?? " " + ((E = (O = t.valuePeriod) == null ? void 0 : O.end) == null ? void 0 : E.toString()) ?? "" : ""; } getResource(t) { var r; return t ? ((r = this.entries.find((e) => e.fullUrl === t)) == null ? void 0 : r.resource) ?? null : null; } get encounter() { var t; return this.getResource( (t = this.composition.encounter) == null ? void 0 : t.reference ) ?? null; } } const le = ve({ profile: null }); function v() { if (!se(le)) throw new Error("useProfile must be used within a ProfileProvider"); return se(le); } function we({ bundle: n, downloadable: t, children: r }) { return /* @__PURE__ */ a.jsx( le.Provider, { value: { profile: new Ae(n), downloadable: t }, children: r } ); } var pe = { color: void 0, size: void 0, className: void 0, style: void 0, attr: void 0 }, me = w.createContext && /* @__PURE__ */ w.createContext(pe), Ce = ["attr", "size", "title"]; function De(n, t) { if (n == null) return {}; var r = Se(n, t), e, l; if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(n); for (l = 0; l < s.length; l++) e = s[l], !(t.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(n, e) && (r[e] = n[e]); } return r; } function Se(n, t) { if (n == null) return {}; var r = {}; for (var e in n) if (Object.prototype.hasOwnProperty.call(n, e)) { if (t.indexOf(e) >= 0) continue; r[e] = n[e]; } return r; } function ae() { return ae = Object.assign ? Object.assign.bind() : function(n) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t]; for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (n[e] = r[e]); } return n; }, ae.apply(this, arguments); } function ue(n, t) { var r = Object.keys(n); if (Object.getOwnPropertySymbols) { var e = Object.getOwnPropertySymbols(n); t && (e = e.filter(function(l) { return Object.getOwnPropertyDescriptor(n, l).enumerable; })), r.push.apply(r, e); } return r; } function re(n) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t] != null ? arguments[t] : {}; t % 2 ? ue(Object(r), !0).forEach(function(e) { Pe(n, e, r[e]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(r)) : ue(Object(r)).forEach(function(e) { Object.defineProperty(n, e, Object.getOwnPropertyDescriptor(r, e)); }); } return n; } function Pe(n, t, r) { return t = Oe(t), t in n ? Object.defineProperty(n, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : n[t] = r, n; } function Oe(n) { var t = Ee(n, "string"); return typeof t == "symbol" ? t : t + ""; } function Ee(n, t) { if (typeof n != "object" || !n) return n; var r = n[Symbol.toPrimitive]; if (r !== void 0) { var e = r.call(n, t); if (typeof e != "object") return e; throw new TypeError("@@toPrimitive must return a primitive value."); } return (t === "string" ? String : Number)(n); } function fe(n) { return n && n.map((t, r) => /* @__PURE__ */ w.createElement(t.tag, re({ key: r }, t.attr), fe(t.child))); } function Y(n) { return (t) => /* @__PURE__ */ w.createElement(Te, ae({ attr: re({}, n.attr) }, t), fe(n.child)); } function Te(n) { var t = (r) => { var { attr: e, size: l, title: s } = n, c = De(n, Ce), d = l || r.size || "1em", o; return r.className && (o = r.className), n.className && (o = (o ? o + " " : "") + n.className), /* @__PURE__ */ w.createElement("svg", ae({ stroke: "currentColor", fill: "currentColor", strokeWidth: "0" }, r.attr, e, c, { className: o, style: re(re({ color: n.color || r.color }, r.style), n.style), height: d, width: d, xmlns: "http://www.w3.org/2000/svg" }), s && /* @__PURE__ */ w.createElement("title", null, s), n.children); }; return me !== void 0 ? /* @__PURE__ */ w.createElement(me.Consumer, null, (r) => t(r)) : t(pe); } function _e(n) { return Y({ attr: { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M12 2.25a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V3a.75.75 0 0 1 .75-.75Zm-9 13.5a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z", clipRule: "evenodd" }, child: [] }] })(n); } function ke(n) { return Y({ attr: { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M6.75 2.25A.75.75 0 0 1 7.5 3v1.5h9V3A.75.75 0 0 1 18 3v1.5h.75a3 3 0 0 1 3 3v11.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V7.5a3 3 0 0 1 3-3H6V3a.75.75 0 0 1 .75-.75Zm13.5 9a1.5 1.5 0 0 0-1.5-1.5H5.25a1.5 1.5 0 0 0-1.5 1.5v7.5a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5v-7.5Z", clipRule: "evenodd" }, child: [] }] })(n); } function ge(n) { return Y({ attr: { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M18.97 3.659a2.25 2.25 0 0 0-3.182 0l-10.94 10.94a3.75 3.75 0 1 0 5.304 5.303l7.693-7.693a.75.75 0 0 1 1.06 1.06l-7.693 7.693a5.25 5.25 0 1 1-7.424-7.424l10.939-10.94a3.75 3.75 0 1 1 5.303 5.304L9.097 18.835l-.008.008-.007.007-.002.002-.003.002A2.25 2.25 0 0 1 5.91 15.66l7.81-7.81a.75.75 0 0 1 1.061 1.06l-7.81 7.81a.75.75 0 0 0 1.054 1.068L18.97 6.84a2.25 2.25 0 0 0 0-3.182Z", clipRule: "evenodd" }, child: [] }] })(n); } function Be(n) { return Y({ attr: { fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z" }, child: [] }] })(n); } function $e(n) { return Y({ attr: { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M15.621 4.379a3 3 0 0 0-4.242 0l-7 7a3 3 0 0 0 4.241 4.243h.001l.497-.5a.75.75 0 0 1 1.064 1.057l-.498.501-.002.002a4.5 4.5 0 0 1-6.364-6.364l7-7a4.5 4.5 0 0 1 6.368 6.36l-3.455 3.553A2.625 2.625 0 1 1 9.52 9.52l3.45-3.451a.75.75 0 1 1 1.061 1.06l-3.45 3.451a1.125 1.125 0 0 0 1.587 1.595l3.454-3.553a3 3 0 0 0 0-4.242Z", clipRule: "evenodd" }, child: [] }] })(n); } function _(...n) { return n.filter(Boolean).join(" "); } function x(n, t = !1) { return n ? new Date(n).toLocaleDateString("en-US", { day: "numeric", month: "short", year: "numeric", ...t && { hour: "numeric", minute: "numeric", hour12: !0 } }) : null; } function Ie() { const { profile: n, downloadable: t } = v(), { title: r, authors: e, date: l, status: s } = n.details; return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [ /* @__PURE__ */ a.jsx("h2", { className: "text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight", children: r }), /* @__PURE__ */ a.jsxs("div", { className: "flex items-end justify-between", children: [ /* @__PURE__ */ a.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a.jsxs("div", { className: "mt-1 flex flex-col sm:mt-0 sm:flex-row sm:flex-wrap sm:gap-x-6", children: [ /* @__PURE__ */ a.jsxs("div", { className: "mt-2 flex items-center text-sm text-gray-500", children: [ /* @__PURE__ */ a.jsx( Be, { className: "mr-1.5 h-5 w-5 shrink-0 text-gray-400", "aria-hidden": "true" } ), /* @__PURE__ */ a.jsx("p", { className: "flex items-center gap-2", children: e == null ? void 0 : e.map((c, d) => /* @__PURE__ */ a.jsxs("span", { className: "cursor-pointer hover:text-gray-700", children: [ n.getAuthorName(c), " ", d < e.length - 1 && "•" ] })) }) ] }), /* @__PURE__ */ a.jsxs("div", { className: "mt-2 flex items-center text-sm text-gray-500", children: [ /* @__PURE__ */ a.jsx( $e, { className: "mr-1.5 h-5 w-5 shrink-0 text-gray-400", "aria-hidden": "true" } ), s ] }), /* @__PURE__ */ a.jsxs("div", { className: "mt-2 flex items-center text-sm text-gray-500", children: [ /* @__PURE__ */ a.jsx( ke, { className: "mr-1.5 h-5 w-5 shrink-0 text-gray-400", "aria-hidden": "true" } ), x(l) ] }) ] }) }), t && /* @__PURE__ */ a.jsx("div", { className: "flex lg:ml-4", children: /* @__PURE__ */ a.jsx("span", { children: /* @__PURE__ */ a.jsxs( "button", { type: "button", onClick: () => { const c = new Blob([JSON.stringify(n.bundle)], { type: "application/json" }), d = URL.createObjectURL(c), o = document.createElement("a"); o.href = d, o.download = "bundle.json", o.click(); }, className: "inline-flex items-center rounded-md bg-white px-3 py-2 text-xs font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50", children: [ /* @__PURE__ */ a.jsx( _e, { className: "-ml-0.5 mr-1.5 h-4 w-4", "aria-hidden": "true" } ), "Download Raw FHIR Bundle" ] } ) }) }) ] }) ] }); } function C({ heads: n, rows: t, className: r }) { return /* @__PURE__ */ a.jsx( "div", { className: _( "-mx-4 mt-10 overflow-x-auto ring-1 ring-gray-300 sm:mx-0 sm:rounded-lg", r ), children: /* @__PURE__ */ a.jsxs("table", { className: "min-w-full divide-y divide-gray-300", children: [ /* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsx("tr", { children: n.map((e) => /* @__PURE__ */ a.jsx( "th", { scope: "col", className: "py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6", children: e } )) }) }), /* @__PURE__ */ a.jsx("tbody", { children: t.map((e, l) => /* @__PURE__ */ a.jsx("tr", { children: e.map((s, c) => /* @__PURE__ */ a.jsx( "td", { className: _( l === 0 ? "" : "border-t border-gray-200", "px-3 py-3.5 text-sm text-gray-500 lg:table-cell" ), children: s }, c )) }, l)) }) ] }) } ); } function xe({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter((e) => e && (e == null ? void 0 : e.resourceType) === "Observation").map((e) => { var l, s; return [ e.effectiveDateTime ? x(e.effectiveDateTime, !0) : null, t.getConceptDisplay(e.code), /* @__PURE__ */ a.jsxs("p", { children: [ t.getObservationValue(e), /* @__PURE__ */ a.jsx("p", { className: "flex flex-col gap-1", children: (l = e.component) == null ? void 0 : l.map((c) => /* @__PURE__ */ a.jsxs("span", { children: [ t.getConceptDisplay(c.code), " :", " ", t.getObservationValue(c) ] })) }) ] }), [e.status, (s = e.interpretation) == null ? void 0 : s[0].text].filter(Boolean).join(" - ") ]; }); return /* @__PURE__ */ a.jsx( C, { heads: ["Date", "Observation", "Value", "Status & Interpretation"], rows: r } ); } function Le({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter((e) => e && (e == null ? void 0 : e.resourceType) === "Immunization").map((e) => { var l, s, c, d; return [ e.occurrenceDateTime ? x(e.occurrenceDateTime) : "NA", t.getConceptDisplay(e.vaccineCode), e.lotNumber ?? "NA", e.route ? t.getConceptDisplay(e.route) : "NA", t.getResource( (l = e.manufacturer) == null ? void 0 : l.reference ).name ?? "NA", ((s = e.protocolApplied) == null ? void 0 : s[0].doseNumberPositiveInt) ?? ((c = e.protocolApplied) == null ? void 0 : c[0].doseNumberString) ?? "NA", ((d = e.reasonCode) == null ? void 0 : d.map((o) => t.getConceptDisplay(o)).join(", ")) ?? "NA", e.status ]; }); return /* @__PURE__ */ a.jsx( C, { heads: [ "Date", "Vaccine", "Lot Number", "Route", "Manufacturer", "Dose", "Reason", "Status" ], rows: r } ); } function Me({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter( (e) => e && (e == null ? void 0 : e.resourceType) === "MedicationRequest" ).map((e) => { var l, s, c, d, o, u; return [ e.authoredOn ? x(e.authoredOn) : "NA", t.getConceptDisplay( (s = t.getResource( (l = e.medicationReference) == null ? void 0 : l.reference )) == null ? void 0 : s.code ) ?? t.getConceptDisplay(e.medicationCodeableConcept) ?? "NA", ((c = e.dosageInstruction) == null ? void 0 : c.map((p) => { var f; return [ p.text, ...((f = p.additionalInstruction) == null ? void 0 : f.map( (y) => t.getConceptDisplay(y) )) ?? [] ]; }).filter(Boolean).join(", ")) || "NA", [ ...((d = e.reasonReference) == null ? void 0 : d.map( (p) => t.getConceptDisplay( t.getResource(p.reference).code ) )) ?? [], ...((o = e.reasonCode) == null ? void 0 : o.map( (p) => t.getConceptDisplay(p) )) ?? [] ].filter(Boolean).join(", ") || "NA", e.status, [ ...((u = e.note) == null ? void 0 : u.map((p) => p.text)) ?? [], e.priority && `Priority: ${e.priority}` ].filter(Boolean).join(", ") || "NA" ]; }); return /* @__PURE__ */ a.jsx( C, { heads: [ "Date", "Medication", "Dose", "Reason", "Status", "Additional Info" ], rows: r } ); } function ze({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter((e) => e && (e == null ? void 0 : e.resourceType) === "Condition").map((e) => { var l, s, c, d; return [ e.recordedDate ? x(e.recordedDate) : "NA", t.getConceptDisplay(e.code) ?? "NA", ((l = e.category) == null ? void 0 : l.map((o) => t.getConceptDisplay(o)).filter(Boolean).join(", ")) || "NA", t.getConceptDisplay(e.severity) ?? "NA", [ `Clinical Status: ${t.getConceptDisplay( e.clinicalStatus )}`, `Verification Status: ${t.getConceptDisplay( e.verificationStatus )}` ].join(", "), [ e.onsetDateTime ? `Onset: ${x(e.onsetDateTime) ?? "NA"}` : "", e.onsetAge ? `Onset: ${e.onsetAge.value ?? "NA"} ${e.onsetAge.unit}` : "", e.onsetPeriod ? `Onset: ${x(e.onsetPeriod.start) ?? "NA"} - ${x(e.onsetPeriod.end) ?? "NA"}` : "", e.onsetRange ? `Onset: ${((s = e.onsetRange.low) == null ? void 0 : s.value) ?? "NA"} - ${((c = e.onsetRange.high) == null ? void 0 : c.value) ?? "NA"}` : "", e.onsetString ? `Onset: ${e.onsetString ?? "NA"}` : "", ...((d = e.note) == null ? void 0 : d.map((o) => o.text)) ?? [] ].filter(Boolean).join(", ") || "NA" ]; }); return /* @__PURE__ */ a.jsx( C, { heads: [ "Date", "Condition", "Category", "Severity", "Status", "Additional Info" ], rows: r } ); } function Ue({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter( (e) => e && (e == null ? void 0 : e.resourceType) === "AllergyIntolerance" ).map((e) => { var l; return [ e.recordedDate ? x(e.recordedDate) : "NA", t.getConceptDisplay(e.code) ?? "NA", [ `Clinical Status: ${t.getConceptDisplay( e.clinicalStatus )}`, `Verification Status: ${t.getConceptDisplay( e.verificationStatus )}` ].join(", "), [...((l = e.note) == null ? void 0 : l.map((s) => s.text)) ?? []].filter(Boolean).join(", ") ]; }); return /* @__PURE__ */ a.jsx( C, { heads: ["Date", "Allergy", "Status", "Additional Info"], rows: r } ); } function Ve({ document: n }) { var e, l, s, c, d; const { profile: t } = v(), r = [ { label: "Authors", value: (e = n.author) == null ? void 0 : e.map( (o) => t.getAuthorName( t.getResource(o.reference) ) ).filter(Boolean).join(", ") }, { label: "Date", value: x(n.date) }, { label: "Description", value: n.description }, { label: "Status", value: n.status }, { label: "Document Status", value: n.docStatus }, { label: "Context", value: ((s = (l = n.context) == null ? void 0 : l.encounter) == null ? void 0 : s.map((o) => o.display).filter(Boolean).join(", ")) || ((d = (c = n.context) == null ? void 0 : c.encounter) == null ? void 0 : d.map( (o) => { var u, p; return (p = (u = t.getResource(o.reference)) == null ? void 0 : u.type) == null ? void 0 : p.map((f) => t.getConceptDisplay(f)).filter(Boolean).join("; "); } ).filter(Boolean).join(", ")) || "NA" } ]; return /* @__PURE__ */ a.jsxs("div", { className: "", children: [ /* @__PURE__ */ a.jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: r.map( (o) => o.value ? /* @__PURE__ */ a.jsxs("div", { className: "px-4 py-4 sm:col-span-1 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: o.label }), /* @__PURE__ */ a.jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:mt-2", children: o.value }) ] }) : null ) }), /* @__PURE__ */ a.jsxs("div", { className: "px-4 py-4 sm:col-span-2 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "Attachments" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-2 text-sm text-gray-900", children: /* @__PURE__ */ a.jsx( "ul", { role: "list", className: "divide-y divide-gray-100 rounded-md border border-gray-200", children: n.content.map((o) => { var u, p, f, y, N, A; return /* @__PURE__ */ a.jsxs("li", { className: "flex items-center justify-between py-4 pl-4 pr-5 text-sm leading-6", children: [ /* @__PURE__ */ a.jsxs("div", { className: "flex w-0 flex-1 items-center", children: [ /* @__PURE__ */ a.jsx( ge, { className: "h-5 w-5 shrink-0 text-gray-400", "aria-hidden": "true" } ), /* @__PURE__ */ a.jsxs("div", { className: "ml-4 flex min-w-0 flex-1 gap-2", children: [ /* @__PURE__ */ a.jsx("span", { className: "truncate font-medium", children: ((u = o.attachment) == null ? void 0 : u.title) ?? "Link to document" }), ((p = o.attachment) == null ? void 0 : p.size) && /* @__PURE__ */ a.jsxs("span", { className: "shrink-0 text-gray-400", children: [ ((f = o.attachment) == null ? void 0 : f.size) / 1e3, " KB" ] }) ] }) ] }), /* @__PURE__ */ a.jsx("div", { className: "ml-4 shrink-0", children: /* @__PURE__ */ a.jsx( "a", { href: ((y = o.attachment) == null ? void 0 : y.url) ?? URL.createObjectURL( new Blob([atob(((N = o.attachment) == null ? void 0 : N.data) ?? "")], { type: ((A = o.attachment) == null ? void 0 : A.contentType) ?? "application/octet-stream" }) ) ?? "#", className: "font-medium text-indigo-600 hover:text-indigo-500", children: "Download" } ) }) ] }); }) } ) }) ] }) ] }); } function Ye({ references: n, className: t }) { const { profile: r } = v(); if (n.length === 0) return null; const e = n.map( (l) => r.getResource(l.reference) ).filter( (l) => l && (l == null ? void 0 : l.resourceType) === "DocumentReference" ); return /* @__PURE__ */ a.jsx( "div", { className: _( "-mx-4 mt-10 ring-1 ring-gray-300 sm:mx-0 sm:rounded-lg p-6 min-w-full divide-y divide-gray-300", t ), children: e.map((l, s) => /* @__PURE__ */ a.jsx(Ve, { document: l }, s)) } ); } function Fe({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter((e) => e && (e == null ? void 0 : e.resourceType) === "Procedure").map((e) => { var l, s, c, d, o, u, p; return [ // TODO: add a helper function to get the diplay of date x(e.performedDateTime) ?? (e.performedAge && `${e.performedAge.value ?? "NA"} ${(l = e.performedAge) == null ? void 0 : l.unit}`) ?? (e.performedPeriod && `${x(e.performedPeriod.start) ?? "NA"} - ${x(e.performedPeriod.end) ?? "NA"}`) ?? (e.performedRange && `${((s = e.performedRange.low) == null ? void 0 : s.value) ?? "NA"} - ${((c = e.performedRange.high) == null ? void 0 : c.value) ?? "NA"}`) ?? (e.performedString && `${e.performedString ?? "NA"}`) ?? "NA", t.getConceptDisplay(e.code) ?? "NA", t.getConceptDisplay(e.category) ?? "NA", [e.status, t.getConceptDisplay(e.statusReason)].filter(Boolean).join(" - ") || "NA", t.getConceptDisplay(e.outcome) ?? "NA", [ e.performer && ("Performer: " + ((d = e.performer) == null ? void 0 : d.map( (f) => t.getAuthorName( t.getResource(f.actor.reference) ) + (f.function ? `(${t.getConceptDisplay(f.function)})` : "") ).filter(Boolean).join(", ")) || "NA"), e.reasonCode && ("Reason: " + ((o = e.reasonCode) == null ? void 0 : o.map((f) => t.getConceptDisplay(f)).filter(Boolean).join(", ")) || "NA"), e.bodySite && ("Body Site: " + ((u = e.bodySite) == null ? void 0 : u.map((f) => t.getConceptDisplay(f)).filter(Boolean).join(", ")) || "NA"), e.complication && ("Complication: " + ((p = e.complication) == null ? void 0 : p.map((f) => t.getConceptDisplay(f)).filter(Boolean).join(", ")) || "NA") ].filter(Boolean).join(", ") || "NA" ]; }); return /* @__PURE__ */ a.jsx( C, { heads: [ "Date", "Procedure", "Category", "Status", "Outcome", "Additional Info" ], rows: r } ); } function He({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter((e) => e && (e == null ? void 0 : e.resourceType) === "Appointment").map((e) => { var l, s, c, d, o; return [ [x(e.start, !0), x(e.end, !0)].filter(Boolean).join(" - ") || "NA", [ e.text, e.description, ...((l = e.serviceCategory) == null ? void 0 : l.map( (u) => t.getConceptDisplay(u) )) ?? [], ...((s = e.serviceType) == null ? void 0 : s.map( (u) => t.getConceptDisplay(u) )) ?? [], ...((c = e.specialty) == null ? void 0 : c.map((u) => t.getConceptDisplay(u))) ?? [], t.getConceptDisplay(e.appointmentType), ...((d = e.reasonCode) == null ? void 0 : d.map( (u) => t.getConceptDisplay(u) )) ?? [] ].filter(Boolean).join(", ") || "NA", [e.status, t.getConceptDisplay(e.cancelationReason)].filter(Boolean).join(" - ") || "NA", [ e.priority && `Priority: ${e.priority}`, e.created && `Created On: ${x(e.created)}`, e.comment, e.patientInstruction, "Participants: " + ((o = e.participant) == null ? void 0 : o.map( (u) => { var p; return t.getAuthorName( t.getResource((p = u.actor) == null ? void 0 : p.reference) ) + (u.status ? ` (${u.status})` : ""); } ).filter(Boolean).join(", ")) ].filter(Boolean).join(", ") || "NA" ]; }); return /* @__PURE__ */ a.jsx( C, { heads: ["Time", "Appointment", "Status", "Additional Info"], rows: r } ); } function We({ references: n }) { const { profile: t } = v(); if (n.length === 0) return null; const r = n.map( (e) => t.getResource(e.reference) ).filter((e) => e && (e == null ? void 0 : e.resourceType) === "CarePlan").map((e) => { var l, s, c; return [ (e.period && `${x(e.period.start) ?? "NA"} - ${x(e.period.end) ?? "NA"}`) ?? "NA", [e.title, e.description, e.text].filter(Boolean).join(", ") || "NA", t.getAuthorName( t.getResource((l = e.author) == null ? void 0 : l.reference) ) ?? "NA", `${e.status} - ${e.intent}`, ((s = e.category) == null ? void 0 : s.map((d) => t.getConceptDisplay(d)).filter(Boolean).join(", ")) || "NA", [ e.created && `Created On: ${x(e.created)}`, ...((c = e.note) == null ? void 0 : c.map((d) => d.text)) ?? [] ].filter(Boolean).join(", ") || "NA" ]; }); return /* @__PURE__ */ a.jsx( C, { heads: [ "Period", "Care Plan", "Author", "Status - Intent", "Categories", "Additional Info" ], rows: r } ); } function qe({ report: n }) { var e, l, s, c, d; const { profile: t } = v(), r = [ { label: "Date", value: x(n.effectiveDateTime) ?? [ x((e = n.effectivePeriod) == null ? void 0 : e.start), x((l = n.effectivePeriod) == null ? void 0 : l.end) ].filter(Boolean).join(" - ") }, { label: "Status", value: n.status }, { label: "Categories", value: (s = n.category) == null ? void 0 : s.map((o) => t.getConceptDisplay(o)).filter(Boolean).join(", ") }, { label: "Conclusion", value: n.conclusion }, { label: "Performers", value: (c = n.performer) == null ? void 0 : c.map( (o) => t.getAuthorName( t.getResource(o.reference) ) ).filter(Boolean).join(", ") }, { label: "Interpreters", value: (d = n.resultsInterpreter) == null ? void 0 : d.map( (o) => t.getAuthorName( t.getResource(o.reference) ) ).filter(Boolean).join(", ") } ]; return /* @__PURE__ */ a.jsxs("div", { className: "", children: [ /* @__PURE__ */ a.jsxs("div", { className: "px-4 py-6 sm:px-6", children: [ /* @__PURE__ */ a.jsx("h3", { className: "text-base font-semibold leading-7 text-gray-900", children: t.getConceptDisplay(n.code) }), n.text && /* @__PURE__ */ a.jsx("p", { className: "mt-1 max-w-2xl text-sm leading-6 text-gray-500", children: n.text.div }) ] }), /* @__PURE__ */ a.jsx("dl", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: r.map( (o) => o.value ? /* @__PURE__ */ a.jsxs("div", { className: "px-4 py-4 sm:col-span-1 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: o.label }), /* @__PURE__ */ a.jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:mt-2", children: o.value }) ] }) : null ) }), /* @__PURE__ */ a.jsxs("div", { className: "px-4 py-4 sm:col-span-2 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "Results" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-2 text-sm text-gray-900", children: /* @__PURE__ */ a.jsx(xe, { references: n.result ?? [] }) }) ] }), n.presentedForm && /* @__PURE__ */ a.jsxs("div", { className: "px-4 py-4 sm:col-span-2 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "Attachments" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-2 text-sm text-gray-900", children: /* @__PURE__ */ a.jsx( "ul", { role: "list", className: "divide-y divide-gray-100 rounded-md border border-gray-200", children: n.presentedForm.map((o) => /* @__PURE__ */ a.jsxs("li", { className: "flex items-center justify-between py-4 pl-4 pr-5 text-sm leading-6", children: [ /* @__PURE__ */ a.jsxs("div", { className: "flex w-0 flex-1 items-center", children: [ /* @__PURE__ */ a.jsx( ge, { className: "h-5 w-5 shrink-0 text-gray-400", "aria-hidden": "true" } ), /* @__PURE__ */ a.jsxs("div", { className: "ml-4 flex min-w-0 flex-1 gap-2", children: [ /* @__PURE__ */ a.jsx("span", { className: "truncate font-medium", children: o.title ?? "Link to document" }), o.size && /* @__PURE__ */ a.jsxs("span", { className: "shrink-0 text-gray-400", children: [ o.size / 1e3, " KB" ] }) ] }) ] }), /* @__PURE__ */ a.jsx("div", { className: "ml-4 shrink-0", children: /* @__PURE__ */ a.jsx( "a", { href: o.url ?? URL.createObjectURL( new Blob([atob(o.data ?? "")], { type: o.contentType ?? "application/octet-stream" }) ) ?? "#", className: "font-medium text-indigo-600 hover:text-indigo-500", children: "Download" } ) }) ] })) } ) }) ] }) ] }); } function Ze({ references: n, className: t }) { const { profile: r } = v(); if (n.length === 0) return null; const e = n.map( (l) => r.getResource(l.reference) ).filter( (l) => l && (l == null ? void 0 : l.resourceType) === "DiagnosticReport" ); return /* @__PURE__ */ a.jsx( "div", { className: _( "-mx-4 mt-10 ring-1 ring-gray-300 sm:mx-0 sm:rounded-lg p-6 min-w-full divide-y divide-gray-300", t ), children: e.map((l, s) => /* @__PURE__ */ a.jsx(qe, { report: l }, s)) } ); } function Je({ section: n }) { var l, s, c, d; const { profile: t } = v(), e = ((o) => { var p; return (p = o.entry) == null ? void 0 : p.reduce((f, y) => { var A; const N = (A = t == null ? void 0 : t.getResource(y.reference)) == null ? void 0 : A.resourceType; return console.log(N, y), N && (f[N] = f[N] ?? [], f[N].push(y)), f; }, {}); })(n); return /* @__PURE__ */ a.jsxs("div", { className: "mt-6 rounded-sm shadow-sm p-4 pl-6", children: [ /* @__PURE__ */ a.jsx("div", { className: "sm:flex sm:items-center", children: /* @__PURE__ */ a.jsxs("div", { className: "sm:flex-auto", children: [ /* @__PURE__ */ a.jsx("h1", { className: "text-base font-semibold leading-6 text-gray-900", children: n.title }), /* @__PURE__ */ a.jsx("p", { className: "mt-2 text-sm text-gray-700", children: ((s = (l = n.code) == null ? void 0 : l.coding) == null ? void 0 : s[0].display) ?? ((d = (c = n.code) == null ? void 0 : c.coding) == null ? void 0 : d[0].code) }) ] }) }), /* @__PURE__ */ a.jsx(xe, { references: (e == null ? void 0 : e.Observation) ?? [] }), /* @__PURE__ */ a.jsx(Le, { references: (e == null ? void 0 : e.Immunization) ?? [] }), /* @__PURE__ */ a.jsx(Me, { references: (e == null ? void 0 : e.MedicationRequest) ?? [] }), /* @__PURE__ */ a.jsx(ze, { references: (e == null ? void 0 : e.Condition) ?? [] }), /* @__PURE__ */ a.jsx(Ue, { references: (e == null ? void 0 : e.AllergyIntolerance) ?? [] }), /* @__PURE__ */ a.jsx(Ye, { references: (e == null ? void 0 : e.DocumentReference) ?? [] }), /* @__PURE__ */ a.jsx(Fe, { references: (e == null ? void 0 : e.Procedure) ?? [] }), /* @__PURE__ */ a.jsx(He, { references: (e == null ? void 0 : e.Appointment) ?? [] }), /* @__PURE__ */ a.jsx(We, { references: (e == null ? void 0 : e.CarePlan) ?? [] }), /* @__PURE__ */ a.jsx(Ze, { references: (e == null ? void 0 : e.DiagnosticReport) ?? [] }) ] }); } function Ge({ className: n }) { var e, l, s, c, d; const { profile: t } = v(), { encounter: r } = t; return r ? /* @__PURE__ */ a.jsxs("div", { className: _("rounded-sm shadow-sm p-4 pl-6", n), children: [ /* @__PURE__ */ a.jsxs("div", { className: "px-4 sm:px-0", children: [ /* @__PURE__ */ a.jsx("h3", { className: "text-xl font-semibold leading-7 text-gray-900", children: "Encounter Details" }), /* @__PURE__ */ a.jsx("p", { className: "mt-1 max-w-2xl text-sm leading-6 text-gray-500", children: "This includes the dates like admission and discharge, and some extra details." }) ] }), /* @__PURE__ */ a.jsx("div", { className: "mt-6", children: /* @__PURE__ */ a.jsxs("dl", { className: "grid grid-cols-1 sm:grid-cols-2", children: [ /* @__PURE__ */ a.jsxs("div", { className: "border-t border-gray-100 px-4 py-6 sm:col-span-1 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "Category" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:mt-2", children: r.class.display ?? r.class.code }) ] }), /* @__PURE__ */ a.jsxs("div", { className: "border-t border-gray-100 px-4 py-6 sm:col-span-1 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "Status" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:mt-2", children: r.status }) ] }), /* @__PURE__ */ a.jsxs("div", { className: "border-t border-gray-100 px-4 py-6 sm:col-span-1 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "Start Date" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:mt-2", children: (e = r.period) != null && e.start ? x((l = r.period) == null ? void 0 : l.start) : "Not available" }) ] }), /* @__PURE__ */ a.jsxs("div", { className: "border-t border-gray-100 px-4 py-6 sm:col-span-1 sm:px-0", children: [ /* @__PURE__ */ a.jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: "End Date" }), /* @__PURE__ */ a.jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:mt-2", children: (s = r.period) != null && s.end ? x((c = r.period) == null ? void 0 : c.end) : "Not available" }) ] }), ((d = r.diagnosis) == null ? void 0 : d.length) && /* @__PURE__ */ a.jsxs("div", { className: "border-t border-gray-100 p