@claudebernard/patient-profile-element 0.3.5 → 0.4.0

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.
@@ -8,6 +8,7 @@ export declare class PatientProfile extends LitElement {
8
8
  editButtonVisible: boolean | undefined;
9
9
  apiUrl: string;
10
10
  apiKey: string | undefined;
11
+ preferences: PatientProfilePreferences | undefined;
11
12
  moreInformationVisible: boolean;
12
13
  patientAgeUnit: "ans" | "mois";
13
14
  private editionModalElement;
@@ -27,11 +28,22 @@ export declare class PatientProfile extends LitElement {
27
28
  static styles: CSSResult;
28
29
  }
29
30
 
31
+ export declare interface PatientProfilePreferences {
32
+ /**
33
+ * Filtre le type de pathologie utilisé lors de l'appel fetchPathologiesByTerm.
34
+ * - "AMM" : pathologies avec Autorisation de Mise sur le Marché
35
+ * - "CIM10" : pathologies selon la classification CIM-10
36
+ * - "" : aucun filtre (toutes les pathologies)
37
+ */
38
+ typePathology?: "AMM" | "CIM10" | "";
39
+ }
40
+
30
41
  export declare interface PatientProfileProps {
31
42
  patientProfile?: Bundle;
32
43
  editButtonVisible?: boolean;
33
44
  apiUrl: string;
34
45
  apiKey?: string;
46
+ preferences?: PatientProfilePreferences;
35
47
  }
36
48
 
37
49
  export { }
@@ -1586,8 +1586,8 @@ const ageOptions = [
1586
1586
  { value: "ans", label: "Ans" },
1587
1587
  { value: "mois", label: "Mois" }
1588
1588
  ];
1589
- const fetchPathologiesByTerm = async (term, params, apiUrl) => {
1590
- const response = await fetch(`${apiUrl}/search/pathologies/?term=${term}`, {
1589
+ const fetchPathologiesByTerm = async (term, typePathology, params, apiUrl) => {
1590
+ const response = await fetch(`${apiUrl}/search/pathologies/?term=${term}&typePathology=${typePathology}`, {
1591
1591
  method: "POST",
1592
1592
  headers: {
1593
1593
  "Content-Type": "application/json"
@@ -1868,7 +1868,8 @@ let PatientProfileEdition = class extends i {
1868
1868
  }
1869
1869
  const valueSearch = event.detail.value;
1870
1870
  if (valueSearch.length > 2) {
1871
- fetchPathologiesByTerm(valueSearch, new SearchRequestBody({}), this.apiUrl).then((response) => {
1871
+ const typePathology = this.preferences?.typePathology ?? "";
1872
+ fetchPathologiesByTerm(valueSearch, typePathology, new SearchRequestBody({}), this.apiUrl).then((response) => {
1872
1873
  this.pathologyOptions = [];
1873
1874
  this.pathologyOptions = response.content.map((pathology) => this.apiReturntoSelectOption(pathology));
1874
1875
  this.pathologiesApiErrorMessage = "";
@@ -1912,20 +1913,18 @@ let PatientProfileEdition = class extends i {
1912
1913
  this.selectedAllergyOptions = [...updatedSelections, ...newSelections];
1913
1914
  this.allergyOptions = [];
1914
1915
  }
1915
- handleHepaticStade(event) {
1916
- if (event.detail === null) {
1917
- this.childPughInput.value = "";
1918
- }
1916
+ handleHepaticStade() {
1917
+ this.childPughInput.value = "";
1919
1918
  }
1920
1919
  handleHepaticScore() {
1921
1920
  const childPughInputScore = Number(this.childPughInput?.value ?? "");
1922
1921
  if (isNaN(childPughInputScore) || childPughInputScore <= 0) {
1923
- this.hepaticStadeSelect.value = "";
1922
+ this.defaultHepaticStade = {};
1924
1923
  } else {
1925
1924
  const stade = childPughScore(childPughInputScore);
1926
1925
  const selectedOption = hepaticStadeOptions.find((option) => option.label === stade);
1927
1926
  if (selectedOption) {
1928
- this.hepaticStadeSelect.value = selectedOption.value;
1927
+ this.defaultHepaticStade = { value: selectedOption.value, label: selectedOption.label };
1929
1928
  }
1930
1929
  }
1931
1930
  }
@@ -2122,6 +2121,9 @@ __decorateClass$1([
2122
2121
  __decorateClass$1([
2123
2122
  n2({ type: String, attribute: "api-key" })
2124
2123
  ], PatientProfileEdition.prototype, "apiKey", 2);
2124
+ __decorateClass$1([
2125
+ n2({ type: Object })
2126
+ ], PatientProfileEdition.prototype, "preferences", 2);
2125
2127
  __decorateClass$1([
2126
2128
  r()
2127
2129
  ], PatientProfileEdition.prototype, "patientAge", 2);
@@ -2486,6 +2488,7 @@ let PatientProfile = class extends i {
2486
2488
  ${this.displayHepaticInsufficiencySection()}
2487
2489
  </div>
2488
2490
  <bcb-patient-profile-edition .patientProfile=${this.patientProfile} .apiUrl=${this.apiUrl} .apiKey=${this.apiKey}
2491
+ .preferences=${this.preferences}
2489
2492
  @editPatientProfile=${this.editProfilePatient}></bcb-patient-profile-edition>
2490
2493
  </div>
2491
2494
  `;
@@ -2504,6 +2507,9 @@ __decorateClass([
2504
2507
  __decorateClass([
2505
2508
  n2({ type: String, attribute: "api-key" })
2506
2509
  ], PatientProfile.prototype, "apiKey", 2);
2510
+ __decorateClass([
2511
+ n2({ type: Object })
2512
+ ], PatientProfile.prototype, "preferences", 2);
2507
2513
  __decorateClass([
2508
2514
  r()
2509
2515
  ], PatientProfile.prototype, "moreInformationVisible", 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/patient-profile-element",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "main": "dist/patient-profile.es.js",
5
5
  "module": "dist/patient-profile.es.js",
6
6
  "types": "dist/patient-profile.d.ts",
@@ -44,16 +44,16 @@
44
44
  "vite-tsconfig-paths": "^5.1.4"
45
45
  },
46
46
  "devDependencies": {
47
- "@chromatic-com/storybook": "^4.1.2",
47
+ "@chromatic-com/storybook": "^5.0.1",
48
48
  "@custom-elements-manifest/analyzer": "^0.9.0",
49
49
  "@hey-api/openapi-ts": "0.86.8",
50
50
  "@lit/localize-tools": "^0.8.0",
51
51
  "@playwright/test": "^1.58.1",
52
- "@storybook/addon-a11y": "^10.0.5",
53
- "@storybook/addon-links": "^10.0.5",
54
- "@storybook/addon-vitest": "^10.0.5",
55
- "@storybook/web-components": "^10.0.5",
56
- "@storybook/web-components-vite": "^10.0.5",
52
+ "@storybook/addon-a11y": "^10.2.11",
53
+ "@storybook/addon-links": "^10.2.11",
54
+ "@storybook/addon-vitest": "^10.2.11",
55
+ "@storybook/web-components": "^10.2.11",
56
+ "@storybook/web-components-vite": "^10.2.11",
57
57
  "@claudebernard/storybook-addon-theme-switcher": "0.1.0",
58
58
  "@stylistic/eslint-plugin": "^5.5.0",
59
59
  "@types/fhir": "^0.0.41",
@@ -67,11 +67,11 @@
67
67
  "eslint": "^9.38.0",
68
68
  "eslint-plugin-import": "2.32.0",
69
69
  "eslint-plugin-lit": "^2.1.1",
70
- "eslint-plugin-storybook": "^10.0.5",
70
+ "eslint-plugin-storybook": "^10.2.11",
71
71
  "lit-analyzer": "^2.0.3",
72
72
  "playwright": "^1.58.1",
73
73
  "sass": "^1.79.4",
74
- "storybook": "^10.0.5",
74
+ "storybook": "^10.2.11",
75
75
  "ts-lit-plugin": "^2.0.2",
76
76
  "ts-node": "^10.9.2",
77
77
  "tslib": "^2.6.2",
@@ -144,5 +144,10 @@
144
144
  ],
145
145
  "@semantic-release/gitlab"
146
146
  ]
147
+ },
148
+ "overrides": {
149
+ "@microsoft/api-extractor": {
150
+ "minimatch": "^10.2.2"
151
+ }
147
152
  }
148
153
  }