@claudebernard/patient-profile-element 0.6.5 → 0.7.1

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.
@@ -100,6 +100,26 @@ const childPughStadeToSnomedMap = {
100
100
  function generateUUID() {
101
101
  return crypto.randomUUID();
102
102
  }
103
+ function getTodayDateString() {
104
+ return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
105
+ }
106
+ function formatEffectiveDateTime(effectiveDateTime) {
107
+ const date = new Date(effectiveDateTime);
108
+ if (isNaN(date.getTime())) {
109
+ return void 0;
110
+ }
111
+ const day = date.getUTCDate().toString().padStart(2, "0");
112
+ const month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
113
+ const year = date.getUTCFullYear();
114
+ return `${day}/${month}/${year}`;
115
+ }
116
+ function getMeasureDateTooltipLabel(measureDate) {
117
+ return measureDate ? `Dernière date mesurée : ${measureDate}` : "Aucune date de cette mesure";
118
+ }
119
+ function parseDisplayDateToISO(displayDate) {
120
+ const [day, month, year] = displayDate.split("/");
121
+ return `${year}-${month}-${day}`;
122
+ }
103
123
  function getPatientFullUrl(bundle) {
104
124
  const patientEntry = bundle.entry?.find(
105
125
  (entry) => entry.resource?.resourceType === "Patient"
@@ -151,6 +171,7 @@ function upsertQuantityObservation(bundle, codes, meta, quantity, removeIfZero)
151
171
  ],
152
172
  text: meta.text
153
173
  },
174
+ effectiveDateTime: getTodayDateString(),
154
175
  subject: {
155
176
  reference: getPatientFullUrl(bundle)
156
177
  },
@@ -164,6 +185,9 @@ function upsertQuantityObservation(bundle, codes, meta, quantity, removeIfZero)
164
185
  removeEntryById(bundle, obs.id);
165
186
  return;
166
187
  }
188
+ if (obs.valueQuantity?.value !== quantity.value) {
189
+ obs.effectiveDateTime = getTodayDateString();
190
+ }
167
191
  obs.valueQuantity = quantity;
168
192
  }
169
193
  function setInitialPatientProfile() {
@@ -281,6 +305,10 @@ function getPatientWeightWithUnit(bundle) {
281
305
  const obs = findObservationByCode(bundle, [WEIGHT_LOINC_CODE]);
282
306
  return (obs?.valueQuantity?.value ? obs.valueQuantity.value.toString() : "") + (obs?.valueQuantity?.unit ? ` ${obs.valueQuantity.unit}` : "");
283
307
  }
308
+ function getPatientWeightDate(bundle) {
309
+ const effectiveDateTime = findObservationByCode(bundle, [WEIGHT_LOINC_CODE])?.effectiveDateTime;
310
+ return effectiveDateTime ? formatEffectiveDateTime(effectiveDateTime) : void 0;
311
+ }
284
312
  function setPatientWeight(bundle, weight) {
285
313
  upsertQuantityObservation(
286
314
  bundle,
@@ -298,6 +326,10 @@ function getPatientHeightWithUnit(bundle) {
298
326
  const obs = findObservationByCode(bundle, [HEIGHT_LOINC_CODE]);
299
327
  return (obs?.valueQuantity?.value ? obs.valueQuantity.value.toString() : "") + (obs?.valueQuantity?.unit ? ` ${obs.valueQuantity.unit}` : "");
300
328
  }
329
+ function getPatientHeightDate(bundle) {
330
+ const effectiveDateTime = findObservationByCode(bundle, [HEIGHT_LOINC_CODE])?.effectiveDateTime;
331
+ return effectiveDateTime ? formatEffectiveDateTime(effectiveDateTime) : void 0;
332
+ }
301
333
  function setPatientHeight(bundle, height) {
302
334
  upsertQuantityObservation(
303
335
  bundle,
@@ -437,6 +469,10 @@ function getPatientRenalInsufficiencyStatus(bundle) {
437
469
  gfr: gfrValue
438
470
  };
439
471
  }
472
+ function getPatientGfrDate(bundle) {
473
+ const effectiveDateTime = findObservationByCode(bundle, acceptedLoincCodesForRenalGFRPerBSA)?.effectiveDateTime;
474
+ return effectiveDateTime ? formatEffectiveDateTime(effectiveDateTime) : void 0;
475
+ }
440
476
  function setPatientClearance(bundle, clearance) {
441
477
  upsertQuantityObservation(
442
478
  bundle,
@@ -1341,7 +1377,7 @@ function e$1(e2, r2) {
1341
1377
  } });
1342
1378
  };
1343
1379
  }
1344
- const patientProfileCSS = '@charset "UTF-8";\n.claudebernard-patient-profile {\n font-family: var(--custom-font-family, "Ubuntu"), sans-serif;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n padding: 1rem;\n border-radius: 0.5rem;\n background-color: var(--bcbd-white-color, #FFFFFF);\n container-type: inline-size;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__no-profile {\n display: flex;\n flex-direction: column;\n gap: 0.3rem;\n}\n.claudebernard-patient-profile__no-profile__first {\n font-weight: bold;\n}\n.claudebernard-patient-profile__no-profile__second {\n color: var(--bcbd-gray-500-color, #64748B);\n font-size: 0.8rem;\n}\n.claudebernard-patient-profile__separator {\n border-right: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n}\n.claudebernard-patient-profile__first-info-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__first-info-container {\n flex-wrap: wrap;\n gap: 1rem;\n align-items: center;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__first-info-container {\n justify-content: center;\n }\n}\n.claudebernard-patient-profile__id-info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 1;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 0 0 auto;\n align-items: center;\n }\n}\n.claudebernard-patient-profile__name-info {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__id-info {\n width: fit-content;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n border-radius: 1rem;\n display: flex;\n flex-direction: row;\n padding: 0 0.8rem;\n gap: 0.5rem;\n}\n.claudebernard-patient-profile__id-info-info {\n padding: 0.2rem 0;\n white-space: nowrap;\n font-size: 1rem;\n}\n.claudebernard-patient-profile__physical-info-container {\n display: flex;\n flex-direction: row;\n justify-content: center;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__physical-info-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 3;\n width: 100%;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 2;\n }\n}\n.claudebernard-patient-profile__physical-info {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 0;\n font-size: 1rem;\n}\n.claudebernard-patient-profile__physical-info-result {\n white-space: nowrap;\n}\n.claudebernard-patient-profile__physical-info-label {\n color: var(--bcbd-gray-600-color, #475569);\n}\n.claudebernard-patient-profile__action-buttons-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__action-buttons-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 2;\n margin: 0 auto;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 3;\n }\n}\n.claudebernard-patient-profile__second-info-container {\n margin-top: 1rem;\n display: none;\n}\n.claudebernard-patient-profile__second-info-container.active {\n display: flex;\n flex-direction: column;\n}\n.claudebernard-patient-profile__second-info {\n margin-top: 1rem;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip {\n display: inline-block;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip > span {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__second-info-label {\n padding-right: 0.5rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__second-info-label {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__second-info-result.sep-dots > * + *::before {\n content: "•";\n margin: 0 0.5rem;\n}';
1380
+ const patientProfileCSS = '@charset "UTF-8";\n.claudebernard-patient-profile {\n font-family: var(--custom-font-family, "Ubuntu"), sans-serif;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n padding: 1rem;\n border-radius: 0.5rem;\n background-color: var(--bcbd-white-color, #FFFFFF);\n container-type: inline-size;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__no-profile {\n display: flex;\n flex-direction: column;\n gap: 0.3rem;\n}\n.claudebernard-patient-profile__no-profile__first {\n font-weight: bold;\n}\n.claudebernard-patient-profile__no-profile__second {\n color: var(--bcbd-gray-500-color, #64748B);\n font-size: 0.8rem;\n}\n.claudebernard-patient-profile__separator {\n border-right: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n}\n.claudebernard-patient-profile__first-info-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__first-info-container {\n flex-wrap: wrap;\n gap: 1rem;\n align-items: center;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__first-info-container {\n justify-content: center;\n }\n}\n.claudebernard-patient-profile__id-info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 1;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 0 0 auto;\n align-items: center;\n }\n}\n.claudebernard-patient-profile__name-info {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__id-info {\n width: fit-content;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n border-radius: 1rem;\n display: flex;\n flex-direction: row;\n padding: 0 0.8rem;\n gap: 0.5rem;\n}\n.claudebernard-patient-profile__id-info-info {\n padding: 0.2rem 0;\n white-space: nowrap;\n font-size: 1rem;\n}\n.claudebernard-patient-profile__physical-info-container {\n display: flex;\n flex-direction: row;\n justify-content: center;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__physical-info-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 3;\n width: 100%;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 2;\n }\n}\n.claudebernard-patient-profile__physical-info {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 0;\n font-size: 1rem;\n}\n.claudebernard-patient-profile__physical-info-result {\n white-space: nowrap;\n}\n.claudebernard-patient-profile__physical-info-label {\n color: var(--bcbd-gray-600-color, #475569);\n}\n.claudebernard-patient-profile__action-buttons-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__action-buttons-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 2;\n margin: 0 auto;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 3;\n }\n}\n.claudebernard-patient-profile__second-info-container {\n margin-top: 1rem;\n display: none;\n}\n.claudebernard-patient-profile__second-info-container.active {\n display: flex;\n flex-direction: column;\n}\n.claudebernard-patient-profile__second-info {\n margin-top: 1rem;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip {\n display: inline-block;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip > span {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__second-info-label {\n padding-right: 0.5rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__second-info-label {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__second-info-result.sep-dots > * + *::before {\n content: "•";\n margin: 0 0.5rem;\n}\n.claudebernard-patient-profile__alert-container bcbd-alert {\n margin-top: 10px;\n}\n.claudebernard-patient-profile__alert-container {\n display: flex;\n flex-direction: column;\n}';
1345
1381
  const e = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
1346
1382
  let i$1 = class i2 {
1347
1383
  constructor(t2) {
@@ -1381,7 +1417,7 @@ const hepaticStadeOptions = [
1381
1417
  { value: "B", label: "Stade B" },
1382
1418
  { value: "C", label: "Stade C" }
1383
1419
  ];
1384
- const patientDemographicsFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}\n\n.claudebernard-edition-modal-demographic-div {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}";
1420
+ const patientDemographicsFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-little-section__with-info {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 16px;\n gap: 8px;\n}\n.claudebernard-edition-modal-little-section__with-info bcbd-icon {\n --bcbd-icon-width: 1rem;\n --bcbd-icon-height: 1rem;\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}\n\n.claudebernard-edition-modal-demographic-div {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}";
1385
1421
  var __defProp$7 = Object.defineProperty;
1386
1422
  var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
1387
1423
  var __decorateClass$8 = (decorators, target, key, kind) => {
@@ -1572,11 +1608,23 @@ let PatientDemographicsForm = class extends i$2 {
1572
1608
  </div>` : A}
1573
1609
  <div class="${PREFIX}-edition-modal-information-section-secondary-group">
1574
1610
  <div class="${PREFIX}-edition-modal-little-section">
1575
- <span>Taille (cm)</span>
1611
+ <div class="${PREFIX}-edition-modal-little-section__with-info">
1612
+ <span>Taille (cm)</span>
1613
+ <bcbd-tooltip content=${getMeasureDateTooltipLabel(getPatientHeightDate(this.patientProfile))} placement="top" delay="0">
1614
+ <bcbd-icon color="primary" size="medium" icon="circle-info">
1615
+ </bcbd-icon>
1616
+ </bcbd-tooltip>
1617
+ </div>
1576
1618
  <bcbd-input data-test-id="size-input" id="sizeInput" type="number" aria-label="Taille (cm)" .value=${getPatientHeight(this.patientProfile) ?? ""} warning-msg="" @change=${this.verifySizeInput}></bcbd-input>
1577
1619
  </div>
1578
1620
  <div class="${PREFIX}-edition-modal-little-section">
1579
- <span>Poids (kg)</span>
1621
+ <div class="${PREFIX}-edition-modal-little-section__with-info">
1622
+ <span>Poids (kg)</span>
1623
+ <bcbd-tooltip content=${getMeasureDateTooltipLabel(getPatientWeightDate(this.patientProfile))} placement="top" delay="0">
1624
+ <bcbd-icon color="primary" size="medium" icon="circle-info">
1625
+ </bcbd-icon>
1626
+ </bcbd-tooltip>
1627
+ </div>
1580
1628
  <bcbd-input data-test-id="weight-input" id="weightInput" type="number" aria-label="Poids (kg)" .value=${getPatientWeight(this.patientProfile) ?? ""} warning-msg="" @change=${this.verifyWeightInput}></bcbd-input>
1581
1629
  </div>
1582
1630
  <div class="${PREFIX}-edition-modal-little-section">
@@ -1642,7 +1690,7 @@ __decorateClass$8([
1642
1690
  PatientDemographicsForm = __decorateClass$8([
1643
1691
  t("bcb-patient-demographics-form")
1644
1692
  ], PatientDemographicsForm);
1645
- const patientReproductiveFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}\n\n.claudebernard-edition-modal-pregnant-div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n.claudebernard-edition-modal-pregnant-div bcbd-input {\n width: 40% !important;\n}";
1693
+ const patientReproductiveFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-little-section__with-info {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 16px;\n gap: 8px;\n}\n.claudebernard-edition-modal-little-section__with-info bcbd-icon {\n --bcbd-icon-width: 1rem;\n --bcbd-icon-height: 1rem;\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}\n\n.claudebernard-edition-modal-pregnant-div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n.claudebernard-edition-modal-pregnant-div bcbd-input {\n width: 40% !important;\n}";
1646
1694
  var __defProp$6 = Object.defineProperty;
1647
1695
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
1648
1696
  var __decorateClass$7 = (decorators, target, key, kind) => {
@@ -1809,7 +1857,7 @@ __decorateClass$6([
1809
1857
  __decorateClass$6([
1810
1858
  r()
1811
1859
  ], PatientCodeSearchFormBase.prototype, "apiErrorMessage");
1812
- const patientCodeSearchFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
1860
+ const patientCodeSearchFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-little-section__with-info {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 16px;\n gap: 8px;\n}\n.claudebernard-edition-modal-little-section__with-info bcbd-icon {\n --bcbd-icon-width: 1rem;\n --bcbd-icon-height: 1rem;\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
1813
1861
  var __defProp$4 = Object.defineProperty;
1814
1862
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
1815
1863
  var __decorateClass$5 = (decorators, target, key, kind) => {
@@ -1901,7 +1949,7 @@ const convertRenalInsufficiency = async (type, value, patient, apiUrl) => {
1901
1949
  });
1902
1950
  return response.json();
1903
1951
  };
1904
- const patientRenalFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
1952
+ const patientRenalFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-little-section__with-info {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 16px;\n gap: 8px;\n}\n.claudebernard-edition-modal-little-section__with-info bcbd-icon {\n --bcbd-icon-width: 1rem;\n --bcbd-icon-height: 1rem;\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
1905
1953
  var __defProp$3 = Object.defineProperty;
1906
1954
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
1907
1955
  var __decorateClass$3 = (decorators, target, key, kind) => {
@@ -2037,7 +2085,13 @@ let PatientRenalForm = class extends i$2 {
2037
2085
  <bcbd-input data-test-id="clearance-input" id="clairanceCreatinineInput" type="number" aria-label="Clairance créatinine (ml/min)" .value=${this.clairanceCreatinine <= 0 ? "" : this.clairanceCreatinine} warning-msg="" @change=${() => this.handleRenalConversion(3, Number(this.clairanceCreatinineInput?.value ?? 0))}></bcbd-input>
2038
2086
  </div>
2039
2087
  <div class="${PREFIX}-edition-modal-little-section">
2040
- <span>DFG (mL/min/1.73.m2)</span>
2088
+ <div class="${PREFIX}-edition-modal-little-section__with-info">
2089
+ <span>DFG (mL/min/1.73.m2)</span>
2090
+ <bcbd-tooltip content=${getMeasureDateTooltipLabel(getPatientGfrDate(this.patientProfile))} placement="top" delay="0">
2091
+ <bcbd-icon color="primary" size="medium" icon="circle-info">
2092
+ </bcbd-icon>
2093
+ </bcbd-tooltip>
2094
+ </div>
2041
2095
  <bcbd-input data-test-id="dfg-input" id="dfgInput" type="number" aria-label="DFG (mL/min/1.73.m2)" .value=${this.dfg <= 0 ? "" : this.dfg} warning-msg="" @change=${() => this.handleRenalConversion(4, Number(this.dfgInput?.value ?? 0))}></bcbd-input>
2042
2096
  </div>
2043
2097
  </div>
@@ -2084,7 +2138,7 @@ __decorateClass$3([
2084
2138
  PatientRenalForm = __decorateClass$3([
2085
2139
  t("bcb-patient-renal-form")
2086
2140
  ], PatientRenalForm);
2087
- const patientHepaticFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
2141
+ const patientHepaticFormCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-large-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 100%;\n}\n.claudebernard-edition-modal-information-section {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n.claudebernard-edition-modal-information-section span {\n white-space: nowrap;\n}\n.claudebernard-edition-modal-information-section-secondary-group {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex: 3;\n flex-wrap: wrap;\n}\n@media (max-width: 950px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n flex-basis: 100%;\n }\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-information-section-secondary-group {\n display: contents;\n }\n}\n.claudebernard-edition-modal-little-section {\n display: flex;\n flex-direction: column;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n.claudebernard-edition-modal-little-section bcbd-input {\n height: 100%;\n}\n@media (max-width: 600px) {\n .claudebernard-edition-modal-little-section {\n flex: 1 1 calc(50% - 8px);\n }\n .claudebernard-edition-modal-little-section span {\n white-space: nowrap;\n }\n}\n.claudebernard-edition-modal-little-section__with-info {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 16px;\n gap: 8px;\n}\n.claudebernard-edition-modal-little-section__with-info bcbd-icon {\n --bcbd-icon-width: 1rem;\n --bcbd-icon-height: 1rem;\n}\n.claudebernard-edition-modal-subtitle {\n font-weight: 600;\n font-size: 1.1rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n.claudebernard-edition-modal-error-message {\n color: var(--bcbd-danger-color, #CF406E);\n font-size: 0.8rem;\n}\n.claudebernard-edition-modal-fieldset {\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n margin-inline: 0;\n border-radius: 4px;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
2088
2142
  var __defProp$2 = Object.defineProperty;
2089
2143
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
2090
2144
  var __decorateClass$2 = (decorators, target, key, kind) => {
@@ -2338,6 +2392,13 @@ let PatientProfile = class extends i$2 {
2338
2392
  forms: {
2339
2393
  age: { display: true, readOnly: false },
2340
2394
  sexe: { display: true, readOnly: false }
2395
+ },
2396
+ overview: {
2397
+ warning: {
2398
+ missingWeight: { display: false },
2399
+ missingHeight: { display: false },
2400
+ missingGfr: { display: false }
2401
+ }
2341
2402
  }
2342
2403
  };
2343
2404
  this.moreInformationVisible = false;
@@ -2523,6 +2584,8 @@ let PatientProfile = class extends i$2 {
2523
2584
  const renalStatus = this.displayRenalInsufficiencyStatus();
2524
2585
  const creatinine = this.displayCreatininemieSection();
2525
2586
  const hepatic = this.displayHepaticInsufficiencySection();
2587
+ const patientWeight = getPatientWeight(this.patientProfile);
2588
+ const patientWeightDate = getPatientWeightDate(this.patientProfile);
2526
2589
  const hasSecondaryInfo = [pregnancy, breastfeeding, pathologies, allergies, renalStatus, creatinine, hepatic].some((section) => section !== A);
2527
2590
  return b`
2528
2591
  <div class="${PREFIX}-patient-profile">
@@ -2591,6 +2654,24 @@ let PatientProfile = class extends i$2 {
2591
2654
  <bcbd-button icon=${this.moreInformationVisible ? "chevron-up" : "chevron-down"} size="medium" background-color="primary" aria-label=${this.moreInformationVisible ? "Masquer les informations supplémentaires" : "Afficher les informations supplémentaires"} @click=${this.handleMoreInformation} data-test-id="visible-button"></bcbd-button>
2592
2655
  </div>`}
2593
2656
  </div>
2657
+ <div class="${PREFIX}-patient-profile__alert-container" data-test-id="alert-container">
2658
+ ${patientWeight !== void 0 && patientWeight < 30 && (patientWeightDate !== void 0 && parseDisplayDateToISO(patientWeightDate) < getTodayDateString()) ? b`
2659
+ <bcbd-alert description-message="Attention, le poids renseigné du patient est inférieur à 30kg et n'a pas été saisi aujourd'hui, sa variation même mineure en dessous de 30kg peut avoir un impact significatif sur les thérapies médicamenteuses en cours, il est conseillé de le mettre à jour si vous possédez des informations plus récentes." type="error">
2660
+ </bcbd-alert>
2661
+ ` : A}
2662
+ ${this.preferences?.overview?.warning?.missingWeight?.display && patientWeight === void 0 ? b`
2663
+ <bcbd-alert description-message="Le poids du patient n'étant pas renseigné, les alertes de sécurité du contrôle des posologies pourraient perdre en précision et en pertinence." type="warning">
2664
+ </bcbd-alert>
2665
+ ` : A}
2666
+ ${this.preferences?.overview?.warning?.missingHeight?.display && getPatientHeight(this.patientProfile) === void 0 ? b`
2667
+ <bcbd-alert description-message="La taille du patient n'étant pas renseigné, les alertes de sécurité du contrôle des posologies pourraient perdre en précision et en pertinence." type="warning">
2668
+ </bcbd-alert>
2669
+ ` : A}
2670
+ ${this.preferences?.overview?.warning?.missingGfr?.display && getPatientRenalInsufficiencyStatus(this.patientProfile).gfr === void 0 ? b`
2671
+ <bcbd-alert description-message="La DFG du patient n'étant pas renseigné, les alertes de sécurité du contrôle des posologies pourraient perdre en précision et en pertinence" type="warning">
2672
+ </bcbd-alert>
2673
+ ` : A}
2674
+ </div>
2594
2675
  <div class="${PREFIX}-patient-profile__second-info-container ${this.moreInformationVisible ? "active" : ""}" data-test-id="more-information-section">
2595
2676
  ${pregnancy}
2596
2677
  ${breastfeeding}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/patient-profile-element",
3
- "version": "0.6.5",
3
+ "version": "0.7.1",
4
4
  "main": "dist/patient-profile.es.js",
5
5
  "module": "dist/patient-profile.es.js",
6
6
  "types": "dist/patient-profile.d.ts",
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@chromatic-com/storybook": "^5.0.1",
49
+ "@claudebernard/fhir-prescription-mocks": "^2.4.1",
49
50
  "@claudebernard/storybook-addon-theme-switcher": "0.1.0",
50
51
  "@custom-elements-manifest/analyzer": "^0.11.0",
51
52
  "@hey-api/openapi-ts": "^0.99.0",