@claudebernard/therapeutic-alternative-element 0.1.0 → 1.0.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  An element providing some custom stuff.
4
4
 
5
5
  See the related developer documentation on
6
- the [Claude Bernard Developer Portal](https://platform.claudebernard.fr/doc).
6
+ the [Claude Bernard Developer Portal](https://platform.claudebernard.fr/doc)
7
7
 
8
8
  ## License
9
9
 
@@ -1081,6 +1081,14 @@ let TherapeuticAlternative = class extends i$1 {
1081
1081
  `${PREFIX}-therapeutic-alternative__choice-fieldset`,
1082
1082
  this.hasTitle ? "" : `${PREFIX}-therapeutic-alternative__choice-fieldset-without-title`
1083
1083
  ].join(" ");
1084
+ let medicationTitle = "";
1085
+ if (this.medication?.medication.code?.text) {
1086
+ medicationTitle = this.medication?.medication.code.text;
1087
+ } else {
1088
+ medicationTitle = this.medication?.medication.code?.coding?.find(
1089
+ (coding) => coding.system === "https://platform.claudebernard.fr/fhir/CodeSystem/bcb-code"
1090
+ )?.display || "";
1091
+ }
1084
1092
  return b`
1085
1093
  <div class=${containerClasses} data-test-id="therapeutic-alternative-container">
1086
1094
  ${this.hasTitle ? b`<span class="${PREFIX}-therapeutic-alternative-title">Alternative thérapeutique</span>` : ""}
@@ -1089,7 +1097,7 @@ let TherapeuticAlternative = class extends i$1 {
1089
1097
  <fieldset class=${fieldsetClasses} data-test-id="choice-fieldset">
1090
1098
  <legend class="${PREFIX}-therapeutic-alternative__choice-legend" data-test-id="choice-legend">
1091
1099
  Produit sélectionné:
1092
- <span class="text-primary">${this.medication ? this.medication.medication.code?.text || "Inconnu" : "Aucun produit sélectionné"} </span>
1100
+ <span class="text-primary">${medicationTitle !== "" ? medicationTitle : "Inconnu"} </span>
1093
1101
  </legend>
1094
1102
  <span class="text-primary mb-3 fs-2" data-test-id="choice-text">
1095
1103
  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": "0.1.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/therapeutic-alternative.es.js",
5
5
  "module": "dist/therapeutic-alternative.es.js",
6
6
  "types": "dist/therapeutic-alternative.d.ts",