@claudebernard/therapeutic-alternative-element 1.0.0 → 1.0.2

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.
@@ -520,6 +520,7 @@ export declare class TherapeuticAlternative extends LitElement {
520
520
  currentPage: number;
521
521
  productsList: ProductBean[];
522
522
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
523
+ private decodeHtml;
523
524
  private selectIndication;
524
525
  private getIndicationsListForMedication;
525
526
  private searchTherapeuticAlternative;
@@ -972,6 +972,14 @@ let TherapeuticAlternative = class extends i$1 {
972
972
  this.getIndicationsListForMedication();
973
973
  }
974
974
  }
975
+ decodeHtml(html2) {
976
+ if (!html2) {
977
+ return "";
978
+ }
979
+ const textarea = document.createElement("textarea");
980
+ textarea.innerHTML = html2;
981
+ return textarea.value;
982
+ }
975
983
  selectIndication(event) {
976
984
  this.indicationSelected = this.indicationsList.find((option) => option.code === event.detail);
977
985
  this.currentPage = 1;
@@ -1081,6 +1089,14 @@ let TherapeuticAlternative = class extends i$1 {
1081
1089
  `${PREFIX}-therapeutic-alternative__choice-fieldset`,
1082
1090
  this.hasTitle ? "" : `${PREFIX}-therapeutic-alternative__choice-fieldset-without-title`
1083
1091
  ].join(" ");
1092
+ let medicationTitle = "";
1093
+ if (this.medication?.medication.code?.text) {
1094
+ medicationTitle = this.medication?.medication.code.text;
1095
+ } else {
1096
+ medicationTitle = this.medication?.medication.code?.coding?.find(
1097
+ (coding) => coding.system === "https://platform.claudebernard.fr/fhir/CodeSystem/bcb-code"
1098
+ )?.display || "";
1099
+ }
1084
1100
  return b`
1085
1101
  <div class=${containerClasses} data-test-id="therapeutic-alternative-container">
1086
1102
  ${this.hasTitle ? b`<span class="${PREFIX}-therapeutic-alternative-title">Alternative thérapeutique</span>` : ""}
@@ -1089,7 +1105,7 @@ let TherapeuticAlternative = class extends i$1 {
1089
1105
  <fieldset class=${fieldsetClasses} data-test-id="choice-fieldset">
1090
1106
  <legend class="${PREFIX}-therapeutic-alternative__choice-legend" data-test-id="choice-legend">
1091
1107
  Produit sélectionné:
1092
- <span class="text-primary">${this.medication ? this.medication.medication.code?.text || "Inconnu" : "Aucun produit sélectionné"} </span>
1108
+ <span class="text-primary">${medicationTitle !== "" ? this.decodeHtml(medicationTitle) : "Inconnu"} </span>
1093
1109
  </legend>
1094
1110
  <span class="text-primary mb-3 fs-2" data-test-id="choice-text">
1095
1111
  POUR QUELLE INDICATION CHERCHEZ-VOUS UNE ALTERNATIVE THÉRAPEUTIQUE ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/therapeutic-alternative-element",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "dist/therapeutic-alternative.es.js",
5
5
  "module": "dist/therapeutic-alternative.es.js",
6
6
  "types": "dist/therapeutic-alternative.d.ts",