@claudebernard/patient-profile-element 0.5.6 → 0.6.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/dist/custom-elements.json +2050 -1991
- package/dist/patient-profile.d.ts +14 -1
- package/dist/patient-profile.es.js +29 -9
- package/package.json +4 -4
|
@@ -4,6 +4,11 @@ import { LitElement } from 'lit';
|
|
|
4
4
|
import { nothing } from 'lit';
|
|
5
5
|
import { TemplateResult } from 'lit';
|
|
6
6
|
|
|
7
|
+
declare interface FormPreferences {
|
|
8
|
+
age?: SectionPreferences;
|
|
9
|
+
sexe?: SectionPreferences;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
export declare class PatientProfile extends LitElement {
|
|
8
13
|
patientProfile?: Bundle;
|
|
9
14
|
editButtonVisible: boolean | undefined;
|
|
@@ -29,7 +34,7 @@ export declare class PatientProfile extends LitElement {
|
|
|
29
34
|
static styles: CSSResult;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
declare interface PatientProfilePreferences {
|
|
33
38
|
/**
|
|
34
39
|
* Filtre le type de pathologie utilisé lors de l'appel fetchPathologiesByTerm.
|
|
35
40
|
* - "AMM" : pathologies avec Autorisation de Mise sur le Marché
|
|
@@ -37,6 +42,7 @@ export declare interface PatientProfilePreferences {
|
|
|
37
42
|
* - "" : aucun filtre (toutes les pathologies)
|
|
38
43
|
*/
|
|
39
44
|
typePathology?: "AMM" | "CIM10" | "";
|
|
45
|
+
forms?: FormPreferences;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
export declare interface PatientProfileProps {
|
|
@@ -47,4 +53,11 @@ export declare interface PatientProfileProps {
|
|
|
47
53
|
preferences?: PatientProfilePreferences;
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
declare interface SectionPreferences {
|
|
57
|
+
/** @default true */
|
|
58
|
+
display?: boolean;
|
|
59
|
+
/** @default true */
|
|
60
|
+
readOnly?: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
50
63
|
export { }
|
|
@@ -1657,7 +1657,7 @@ const i3 = e(class extends i$1 {
|
|
|
1657
1657
|
return t2 !== this.key && (p(r2), this.key = t2), e2;
|
|
1658
1658
|
}
|
|
1659
1659
|
});
|
|
1660
|
-
const patientProfileEditionCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 60vw;\n height: 100%;\n max-height: 60vh;\n gap: 16px;\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}\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.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}\n.claudebernard-edition-modal-action-buttons {\n display: flex;\n justify-content: flex-end;\n height: 100%;\n gap: 16px;\n
|
|
1660
|
+
const patientProfileEditionCSS = ".claudebernard-edition-modal {\n font-size: 0.9rem;\n}\n.claudebernard-edition-modal-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 60vw;\n height: 100%;\n max-height: 60vh;\n gap: 16px;\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}\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.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}\n.claudebernard-edition-modal-action-buttons {\n display: flex;\n justify-content: flex-end;\n height: 100%;\n gap: 16px;\n align-items: flex-end;\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-age-input-group {\n display: flex;\n gap: 8px;\n}\n.claudebernard-edition-modal-age-input-group bcbd-input {\n width: 50% !important;\n}\n.claudebernard-edition-modal-age-input-group bcbd-select {\n width: 50% !important;\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.claudebernard-edition-modal-disclaimer-section {\n font-size: 0.8rem;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
|
|
1661
1661
|
var __defProp$1 = Object.defineProperty;
|
|
1662
1662
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
1663
1663
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -1697,6 +1697,18 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1697
1697
|
this.imc = 0;
|
|
1698
1698
|
this.resetKey = 0;
|
|
1699
1699
|
}
|
|
1700
|
+
get isAgeDisplay() {
|
|
1701
|
+
return this.preferences?.forms?.age?.display ?? true;
|
|
1702
|
+
}
|
|
1703
|
+
get isAgeReadOnly() {
|
|
1704
|
+
return this.preferences?.forms?.age?.readOnly ?? true;
|
|
1705
|
+
}
|
|
1706
|
+
get isSexeDisplay() {
|
|
1707
|
+
return this.preferences?.forms?.sexe?.display ?? true;
|
|
1708
|
+
}
|
|
1709
|
+
get isSexeReadOnly() {
|
|
1710
|
+
return this.preferences?.forms?.sexe?.readOnly ?? true;
|
|
1711
|
+
}
|
|
1700
1712
|
open() {
|
|
1701
1713
|
this.editionModalElement.open();
|
|
1702
1714
|
}
|
|
@@ -2031,17 +2043,19 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
2031
2043
|
<bcbd-select data-test-id="name-select" .selectedOptions=${{ value: "1", label: getPatientName(this.patientProfile) }} readonly></bcbd-select>
|
|
2032
2044
|
</div>
|
|
2033
2045
|
<div class="${PREFIX}-edition-modal-information-section">
|
|
2046
|
+
${this.isSexeDisplay ? b`
|
|
2034
2047
|
<div class="${PREFIX}-edition-modal-little-section">
|
|
2035
2048
|
<span>Sexe</span>
|
|
2036
|
-
<bcbd-select data-test-id="sex-select" id="genderSelect" placeholder="Choisir" .options=${sexOptions} .selectedOptions=${this.defaultPatientSex} @change=${this.modifyGender}></bcbd-select>
|
|
2037
|
-
</div
|
|
2049
|
+
<bcbd-select data-test-id="sex-select" id="genderSelect" ?disabled=${this.isSexeReadOnly} placeholder="Choisir" .options=${sexOptions} .selectedOptions=${this.defaultPatientSex} ?readonly=${this.isSexeReadOnly} @change=${this.modifyGender}></bcbd-select>
|
|
2050
|
+
</div>` : A}
|
|
2051
|
+
${this.isAgeDisplay ? b`
|
|
2038
2052
|
<div class="${PREFIX}-edition-modal-little-section">
|
|
2039
2053
|
<span>Age</span>
|
|
2040
2054
|
<div class="${PREFIX}-edition-modal-age-input-group">
|
|
2041
|
-
<bcbd-input data-test-id="age-input" id="ageInput" required type="number" aria-label="Age" .value=${this.patientAge} warning-msg="" @change=${this.verifyAgeInput}></bcbd-input>
|
|
2042
|
-
<bcbd-select data-test-id="age-unit-select" id="ageUnitSelect" .options=${ageOptions} .selectedOptions=${this.defaultPatientUnitAge} @change=${this.handleAgeUnit}></bcbd-select>
|
|
2055
|
+
<bcbd-input data-test-id="age-input" id="ageInput" ?disabled=${this.isAgeReadOnly} required type="number" aria-label="Age" .value=${this.patientAge} warning-msg="" ?readonly=${this.isAgeReadOnly} @change=${this.verifyAgeInput}></bcbd-input>
|
|
2056
|
+
<bcbd-select data-test-id="age-unit-select" id="ageUnitSelect" ?disabled=${this.isAgeReadOnly} .options=${ageOptions} .selectedOptions=${this.defaultPatientUnitAge} ?readonly=${this.isAgeReadOnly} @change=${this.handleAgeUnit}></bcbd-select>
|
|
2043
2057
|
</div>
|
|
2044
|
-
</div
|
|
2058
|
+
</div>` : A}
|
|
2045
2059
|
<div class="${PREFIX}-edition-modal-little-section">
|
|
2046
2060
|
<span>Taille (cm)</span>
|
|
2047
2061
|
<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>
|
|
@@ -2121,13 +2135,13 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
2121
2135
|
<div class="${PREFIX}-edition-modal-disclaimer-section">
|
|
2122
2136
|
<b>Important :</b> La qualité des alertes générées est directement liée à l'exhaustivité des données patient renseignées. Des informations incomplètes peuvent entraîner des alertes manquantes ou peu pertinentes. Nous vous recommandons de compléter l'ensemble des champs disponibles pour une analyse pharmaceutique fiable.
|
|
2123
2137
|
</div>
|
|
2124
|
-
|
|
2125
|
-
|
|
2138
|
+
</div>
|
|
2139
|
+
<div slot="actions" class="${PREFIX}-edition-modal-action-buttons" data-test-id="action-buttons">
|
|
2126
2140
|
<bcbd-button ?disabled=${this.ageErrorMessageInput !== "" || this.sizeErrorMessageInput !== "" || this.weightErrorMessageInput !== ""}
|
|
2127
2141
|
data-test-id="save-button" background-color="primary" @click=${this.validateForm}>Valider</bcbd-button>
|
|
2128
2142
|
<bcbd-button data-test-id="cancel-button" outlined background-color="primary" @click=${this.handleCancel}>Annuler</bcbd-button>
|
|
2129
2143
|
</div>
|
|
2130
|
-
|
|
2144
|
+
`)}
|
|
2131
2145
|
</bcbd-modal>`;
|
|
2132
2146
|
}
|
|
2133
2147
|
};
|
|
@@ -2270,6 +2284,12 @@ let PatientProfile = class extends i$2 {
|
|
|
2270
2284
|
super(...arguments);
|
|
2271
2285
|
this.editButtonVisible = true;
|
|
2272
2286
|
this.apiUrl = "https://api-dev.claudebernard.fr";
|
|
2287
|
+
this.preferences = {
|
|
2288
|
+
forms: {
|
|
2289
|
+
age: { display: true, readOnly: true },
|
|
2290
|
+
sexe: { display: true, readOnly: true }
|
|
2291
|
+
}
|
|
2292
|
+
};
|
|
2273
2293
|
this.moreInformationVisible = false;
|
|
2274
2294
|
this.patientAgeUnit = "ans";
|
|
2275
2295
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudebernard/patient-profile-element",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@types/fhir": "^0.0.41",
|
|
63
63
|
"@types/he": "^1.2.3",
|
|
64
64
|
"@types/node": "^24.9.2",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
66
|
-
"@typescript-eslint/parser": "8.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "8.63.0",
|
|
66
|
+
"@typescript-eslint/parser": "8.63.0",
|
|
67
67
|
"@vitest/browser-playwright": "^4.0.5",
|
|
68
68
|
"@vitest/coverage-v8": "^4.0.5",
|
|
69
69
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"vitest": "^4.0.7"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@claudebernard/design-system": "^2.
|
|
88
|
+
"@claudebernard/design-system": "^2.33.0",
|
|
89
89
|
"@claudebernard/types": "^0.35.0"
|
|
90
90
|
},
|
|
91
91
|
"customElements": "dist/custom-elements.json",
|