@claudebernard/patient-profile-element 0.6.1 → 0.6.3
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 +2123 -2112
- package/dist/patient-profile.d.ts +2 -63
- package/dist/patient-profile.es.js +91 -105
- package/dist/vitest.config.d.ts +4 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.shims.d.ts +1 -0
- package/package.json +14 -12
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
import { nothing } from 'lit';
|
|
5
|
-
import { TemplateResult } from 'lit';
|
|
6
|
-
|
|
7
|
-
declare interface FormPreferences {
|
|
8
|
-
age?: SectionPreferences;
|
|
9
|
-
sexe?: SectionPreferences;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export declare class PatientProfile extends LitElement {
|
|
13
|
-
patientProfile?: Bundle;
|
|
14
|
-
editButtonVisible: boolean | undefined;
|
|
15
|
-
apiUrl: string;
|
|
16
|
-
apiKey: string | undefined;
|
|
17
|
-
preferences: PatientProfilePreferences | undefined;
|
|
18
|
-
moreInformationVisible: boolean;
|
|
19
|
-
patientAgeUnit: "ans" | "mois";
|
|
20
|
-
private editionModalElement;
|
|
21
|
-
handleMoreInformation(): void;
|
|
22
|
-
displayRenalInsufficiencyStatus(): symbol | TemplateResult<1>;
|
|
23
|
-
displayCreatininemieSection(): TemplateResult<1> | typeof nothing;
|
|
24
|
-
private displayHepaticInsufficiencySection;
|
|
25
|
-
private truncateLabel;
|
|
26
|
-
private displayPregnancy;
|
|
27
|
-
private displayBreastfeeding;
|
|
28
|
-
displayPathologies(): TemplateResult<1> | typeof nothing;
|
|
29
|
-
displayAllergies(): TemplateResult<1> | typeof nothing;
|
|
30
|
-
openEditionModal(): void;
|
|
31
|
-
private editProfilePatient;
|
|
32
|
-
private getPatientAge;
|
|
33
|
-
render(): TemplateResult<1>;
|
|
34
|
-
static styles: CSSResult;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare interface PatientProfilePreferences {
|
|
38
|
-
/**
|
|
39
|
-
* Filtre le type de pathologie utilisé lors de l'appel fetchPathologiesByTerm.
|
|
40
|
-
* - "AMM" : pathologies avec Autorisation de Mise sur le Marché
|
|
41
|
-
* - "CIM10" : pathologies selon la classification CIM-10
|
|
42
|
-
* - "" : aucun filtre (toutes les pathologies)
|
|
43
|
-
*/
|
|
44
|
-
typePathology?: "AMM" | "CIM10" | "";
|
|
45
|
-
forms?: FormPreferences;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export declare interface PatientProfileProps {
|
|
49
|
-
patientProfile?: Bundle;
|
|
50
|
-
editButtonVisible?: boolean;
|
|
51
|
-
apiUrl: string;
|
|
52
|
-
apiKey?: string;
|
|
53
|
-
preferences?: PatientProfilePreferences;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
declare interface SectionPreferences {
|
|
57
|
-
/** @default true */
|
|
58
|
-
display?: boolean;
|
|
59
|
-
/** @default true */
|
|
60
|
-
readOnly?: boolean;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { }
|
|
1
|
+
export * from './src/patient-profile/patient-profile.js'
|
|
2
|
+
export {}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { SearchRequestBody } from "@claudebernard/types";
|
|
2
2
|
import "@claudebernard/design-system";
|
|
3
3
|
const PREFIX = "claudebernard";
|
|
4
|
+
function calculateAgeFromBirthDate(birthDate, referenceDate = /* @__PURE__ */ new Date()) {
|
|
5
|
+
const yearsDiff = referenceDate.getFullYear() - birthDate.getFullYear();
|
|
6
|
+
const monthsDiff = referenceDate.getMonth() - birthDate.getMonth();
|
|
7
|
+
const monthsDifference = yearsDiff * 12 + monthsDiff;
|
|
8
|
+
if (monthsDifference < 24) {
|
|
9
|
+
return { age: monthsDifference, unit: "mois" };
|
|
10
|
+
}
|
|
11
|
+
return { age: Math.floor(monthsDifference / 12), unit: "ans" };
|
|
12
|
+
}
|
|
4
13
|
function calculateBMI(weight, height) {
|
|
5
14
|
if (height === 0 || weight === 0) {
|
|
6
15
|
return 0;
|
|
@@ -181,7 +190,7 @@ function getPatientBirthDate(bundle) {
|
|
|
181
190
|
}
|
|
182
191
|
return new Date(patient.birthDate);
|
|
183
192
|
}
|
|
184
|
-
function setPatientAge(bundle,
|
|
193
|
+
function setPatientAge(bundle, birthdate) {
|
|
185
194
|
const patientEntry = bundle.entry?.find(
|
|
186
195
|
(entry) => entry.resource?.resourceType === "Patient"
|
|
187
196
|
);
|
|
@@ -202,15 +211,7 @@ function setPatientAge(bundle, age, ageUnit) {
|
|
|
202
211
|
composition.subject = [{ reference: patientFullUrl }];
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
|
-
|
|
206
|
-
let birthDate;
|
|
207
|
-
if (ageUnit === "mois") {
|
|
208
|
-
birthDate = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth() - age, today.getUTCDate()));
|
|
209
|
-
} else {
|
|
210
|
-
const birthYear = today.getFullYear() - age;
|
|
211
|
-
birthDate = new Date(Date.UTC(birthYear, 0, 1));
|
|
212
|
-
}
|
|
213
|
-
patient.birthDate = birthDate.toISOString().split("T")[0];
|
|
214
|
+
patient.birthDate = birthdate;
|
|
214
215
|
}
|
|
215
216
|
function getPatientWeight(bundle) {
|
|
216
217
|
const obs = bundle?.entry?.find(
|
|
@@ -1012,7 +1013,7 @@ function setPatientAllergies(patient, allergies) {
|
|
|
1012
1013
|
code: {
|
|
1013
1014
|
coding: [
|
|
1014
1015
|
{
|
|
1015
|
-
system: "
|
|
1016
|
+
system: "https://platform.claudebernard.fr/fhir/CodeSystem/products-ingredients",
|
|
1016
1017
|
code: allergy.value,
|
|
1017
1018
|
display: allergy.label
|
|
1018
1019
|
}
|
|
@@ -1590,10 +1591,6 @@ const hepaticStadeOptions = [
|
|
|
1590
1591
|
{ value: "B", label: "Stade B" },
|
|
1591
1592
|
{ value: "C", label: "Stade C" }
|
|
1592
1593
|
];
|
|
1593
|
-
const ageOptions = [
|
|
1594
|
-
{ value: "ans", label: "Ans" },
|
|
1595
|
-
{ value: "mois", label: "Mois" }
|
|
1596
|
-
];
|
|
1597
1594
|
const convertRenalInsufficiency = async (type, value, patient, apiUrl) => {
|
|
1598
1595
|
const response = await fetch(`${apiUrl}/prescription/patient/fhir/renal-insufficiency-conversion`, {
|
|
1599
1596
|
method: "POST",
|
|
@@ -1657,7 +1654,7 @@ const i3 = e(class extends i$1 {
|
|
|
1657
1654
|
return t2 !== this.key && (p(r2), this.key = t2), e2;
|
|
1658
1655
|
}
|
|
1659
1656
|
});
|
|
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
|
|
1657
|
+
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 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-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 padding-bottom: 10px;\n}\n\nbcbd-checkbox {\n --bcbd-checkbox-font-size: .9rem;\n}";
|
|
1661
1658
|
var __defProp$1 = Object.defineProperty;
|
|
1662
1659
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
1663
1660
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -1672,13 +1669,13 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1672
1669
|
constructor() {
|
|
1673
1670
|
super(...arguments);
|
|
1674
1671
|
this.apiUrl = "https://api-dev.claudebernard.fr";
|
|
1675
|
-
this.
|
|
1672
|
+
this.patientBirthDate = "";
|
|
1673
|
+
this.patientAgeValue = void 0;
|
|
1676
1674
|
this.patientUnitAge = "ans";
|
|
1677
1675
|
this.creatinineByMg = 0;
|
|
1678
1676
|
this.creatinineByUmol = 0;
|
|
1679
1677
|
this.clairanceCreatinine = 0;
|
|
1680
1678
|
this.dfg = 0;
|
|
1681
|
-
this.defaultPatientUnitAge = {};
|
|
1682
1679
|
this.defaultPatientSex = {};
|
|
1683
1680
|
this.defaultHepaticStade = {};
|
|
1684
1681
|
this.isPregnancyDivVisible = false;
|
|
@@ -1701,24 +1698,22 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1701
1698
|
return this.preferences?.forms?.age?.display ?? true;
|
|
1702
1699
|
}
|
|
1703
1700
|
get isAgeReadOnly() {
|
|
1704
|
-
return this.preferences?.forms?.age?.readOnly ??
|
|
1701
|
+
return this.preferences?.forms?.age?.readOnly ?? false;
|
|
1705
1702
|
}
|
|
1706
1703
|
get isSexeDisplay() {
|
|
1707
1704
|
return this.preferences?.forms?.sexe?.display ?? true;
|
|
1708
1705
|
}
|
|
1709
1706
|
get isSexeReadOnly() {
|
|
1710
|
-
return this.preferences?.forms?.sexe?.readOnly ??
|
|
1707
|
+
return this.preferences?.forms?.sexe?.readOnly ?? false;
|
|
1708
|
+
}
|
|
1709
|
+
get patientAge() {
|
|
1710
|
+
return this.patientAgeValue === void 0 ? "" : `${this.patientAgeValue} ${this.patientUnitAge}`;
|
|
1711
1711
|
}
|
|
1712
1712
|
open() {
|
|
1713
1713
|
this.editionModalElement.open();
|
|
1714
1714
|
}
|
|
1715
1715
|
modifyGender() {
|
|
1716
|
-
|
|
1717
|
-
this.isPregnancyDivVisible = false;
|
|
1718
|
-
} else {
|
|
1719
|
-
const age = Number(this.ageInput?.value ?? 0);
|
|
1720
|
-
this.isPregnancyDivVisible = this.patientUnitAge === "ans" && (age >= 12 && age <= 55);
|
|
1721
|
-
}
|
|
1716
|
+
this.isPregnancyDivVisible = this.isPregnancyAge;
|
|
1722
1717
|
this.recalculateRenalValues();
|
|
1723
1718
|
}
|
|
1724
1719
|
resetToProfileValues() {
|
|
@@ -1736,35 +1731,18 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1736
1731
|
this.breastfeeding = getPatientBreastfeedingStatus(this.patientProfile);
|
|
1737
1732
|
this.isPregnant = getPatientPregnancyStatus(this.patientProfile);
|
|
1738
1733
|
const birthDate = getPatientBirthDate(this.patientProfile);
|
|
1734
|
+
this.patientBirthDate = birthDate?.toISOString().split("T")[0] ?? "";
|
|
1739
1735
|
this.isPregnancyDivVisible = false;
|
|
1740
1736
|
if (birthDate) {
|
|
1741
|
-
this.
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
if (monthsDifference < 24) {
|
|
1747
|
-
this.patientAge = monthsDifference;
|
|
1748
|
-
this.patientUnitAge = "mois";
|
|
1749
|
-
this.isPregnancyDivVisible = false;
|
|
1750
|
-
} else {
|
|
1751
|
-
this.patientAge = Math.floor(monthsDifference / 12);
|
|
1752
|
-
this.patientUnitAge = "ans";
|
|
1753
|
-
if (this.defaultPatientSex.value !== "male") {
|
|
1754
|
-
this.isPregnancyDivVisible = true;
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
this.defaultPatientUnitAge = {
|
|
1758
|
-
value: this.patientUnitAge,
|
|
1759
|
-
label: ageOptions.find((option) => option.value === this.patientUnitAge)?.label
|
|
1760
|
-
};
|
|
1737
|
+
this.ageInputText.setAttribute("warning-msg", "");
|
|
1738
|
+
const { age, unit } = calculateAgeFromBirthDate(birthDate);
|
|
1739
|
+
this.patientAgeValue = age;
|
|
1740
|
+
this.patientUnitAge = unit;
|
|
1741
|
+
this.isPregnancyDivVisible = unit === "ans" && this.defaultPatientSex.value !== "male";
|
|
1761
1742
|
} else {
|
|
1743
|
+
this.patientAgeValue = void 0;
|
|
1762
1744
|
this.ageErrorMessageInput = "L'âge est requis";
|
|
1763
|
-
this.
|
|
1764
|
-
this.defaultPatientUnitAge = {
|
|
1765
|
-
value: "ans",
|
|
1766
|
-
label: ageOptions.find((option) => option.value === "ans")?.label
|
|
1767
|
-
};
|
|
1745
|
+
this.ageInputText.setAttribute("warning-msg", this.ageErrorMessageInput);
|
|
1768
1746
|
}
|
|
1769
1747
|
const creatinine = getCreatinine(this.patientProfile);
|
|
1770
1748
|
const renalStatus = getPatientRenalInsufficiencyStatus(this.patientProfile);
|
|
@@ -1786,33 +1764,39 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1786
1764
|
this.resetKey++;
|
|
1787
1765
|
this.editionModalElement.close();
|
|
1788
1766
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
this.ageErrorMessageInput = "L'âge doit être exprimé en mois si inférieur à 2 ans";
|
|
1793
|
-
} else if (age > 150 && this.patientUnitAge === "ans") {
|
|
1794
|
-
this.ageErrorMessageInput = "L'âge ne doit pas dépasser 150 ans";
|
|
1795
|
-
} else if (age > 23 && this.patientUnitAge === "mois") {
|
|
1796
|
-
this.ageErrorMessageInput = "L'âge en mois ne doit pas dépasser 23 mois, veuillez compter en années";
|
|
1797
|
-
} else if (age < 1 && this.patientUnitAge === "mois") {
|
|
1798
|
-
this.ageErrorMessageInput = "L'âge est invalide";
|
|
1799
|
-
} else {
|
|
1800
|
-
this.ageErrorMessageInput = "";
|
|
1767
|
+
getAgeErrorMessage(age) {
|
|
1768
|
+
if (age > 150) {
|
|
1769
|
+
return "L'âge ne doit pas dépasser 150 ans";
|
|
1801
1770
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1771
|
+
if (age < 1) {
|
|
1772
|
+
return "L'âge est invalide";
|
|
1773
|
+
}
|
|
1774
|
+
return "";
|
|
1775
|
+
}
|
|
1776
|
+
get isPregnancyAge() {
|
|
1777
|
+
const age = this.patientAgeValue ?? 0;
|
|
1778
|
+
return this.patientUnitAge === "ans" && age >= 12 && age <= 55 && !!this.genderSelect?.value && this.genderSelect.value !== "male";
|
|
1779
|
+
}
|
|
1780
|
+
verifyAgeInput() {
|
|
1781
|
+
const birthDateValue = String(this.birthDateInput?.value ?? "");
|
|
1782
|
+
const birthDate = new Date(birthDateValue);
|
|
1783
|
+
const today = /* @__PURE__ */ new Date();
|
|
1784
|
+
if (!birthDateValue || isNaN(birthDate.getTime()) || birthDate > today) {
|
|
1785
|
+
this.ageErrorMessageInput = "La date de naissance n'est pas valide";
|
|
1786
|
+
this.ageInputText.setAttribute("warning-msg", this.ageErrorMessageInput);
|
|
1787
|
+
this.patientAgeValue = void 0;
|
|
1808
1788
|
this.isPregnancyDivVisible = false;
|
|
1789
|
+
return;
|
|
1809
1790
|
}
|
|
1791
|
+
this.patientBirthDate = birthDateValue;
|
|
1792
|
+
const { age, unit } = calculateAgeFromBirthDate(birthDate, today);
|
|
1793
|
+
this.patientAgeValue = age;
|
|
1794
|
+
this.patientUnitAge = unit;
|
|
1795
|
+
this.ageErrorMessageInput = this.getAgeErrorMessage(age);
|
|
1796
|
+
this.ageInputText.setAttribute("warning-msg", this.ageErrorMessageInput);
|
|
1797
|
+
this.isPregnancyDivVisible = this.isPregnancyAge;
|
|
1810
1798
|
this.recalculateRenalValues();
|
|
1811
1799
|
}
|
|
1812
|
-
handleAgeUnit() {
|
|
1813
|
-
this.patientUnitAge = this.ageUnitSelect?.value ?? "ans";
|
|
1814
|
-
this.verifyAgeInput();
|
|
1815
|
-
}
|
|
1816
1800
|
verifySizeInput() {
|
|
1817
1801
|
const size = Number(this.sizeInput?.value ?? 0);
|
|
1818
1802
|
if (size < 1 || size > 399) {
|
|
@@ -1970,8 +1954,7 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1970
1954
|
this.patientProfile = setInitialPatientProfile();
|
|
1971
1955
|
}
|
|
1972
1956
|
const size = Number(this.sizeInput?.value ?? "");
|
|
1973
|
-
const
|
|
1974
|
-
const ageUnit = this.ageUnitSelect?.value ?? "ans";
|
|
1957
|
+
const birthDate = this.birthDateInput?.value ?? "";
|
|
1975
1958
|
const weight = Number(this.weightInput?.value ?? "");
|
|
1976
1959
|
const gender = this.genderSelect?.value ?? "";
|
|
1977
1960
|
const creatinineUmol = Number(this.creatinineUmolInput?.value ?? "");
|
|
@@ -1980,8 +1963,8 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
1980
1963
|
const dfg = Number(this.dfgInput?.value ?? "");
|
|
1981
1964
|
const gestationalWeeks = Number(this.gestationalWeeksInput?.value ?? "");
|
|
1982
1965
|
const hepaticStade = this.hepaticStadeSelect?.value ?? "";
|
|
1983
|
-
if (
|
|
1984
|
-
setPatientAge(this.patientProfile,
|
|
1966
|
+
if (birthDate !== "") {
|
|
1967
|
+
setPatientAge(this.patientProfile, birthDate);
|
|
1985
1968
|
}
|
|
1986
1969
|
if (!isNaN(weight) || weight > 0) {
|
|
1987
1970
|
setPatientWeight(this.patientProfile, weight);
|
|
@@ -2050,23 +2033,26 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
2050
2033
|
</div>` : A}
|
|
2051
2034
|
${this.isAgeDisplay ? b`
|
|
2052
2035
|
<div class="${PREFIX}-edition-modal-little-section">
|
|
2053
|
-
<span>
|
|
2054
|
-
<
|
|
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>
|
|
2057
|
-
</div>
|
|
2058
|
-
</div>` : A}
|
|
2059
|
-
<div class="${PREFIX}-edition-modal-little-section">
|
|
2060
|
-
<span>Taille (cm)</span>
|
|
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>
|
|
2062
|
-
</div>
|
|
2063
|
-
<div class="${PREFIX}-edition-modal-little-section">
|
|
2064
|
-
<span>Poids (kg)</span>
|
|
2065
|
-
<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>
|
|
2036
|
+
<span>Date de naissance</span>
|
|
2037
|
+
<bcbd-input data-test-id="birth-date-input" id="birthDateInput" ?disabled=${this.isAgeReadOnly} .value=${this.patientBirthDate} type="date" aria-label="Date de naissance" warning-msg="" ?readonly=${this.isAgeReadOnly} @change=${this.verifyAgeInput}></bcbd-input>
|
|
2066
2038
|
</div>
|
|
2067
2039
|
<div class="${PREFIX}-edition-modal-little-section">
|
|
2068
|
-
<span>
|
|
2069
|
-
<bcbd-input data-test-id="
|
|
2040
|
+
<span>Age</span>
|
|
2041
|
+
<bcbd-input data-test-id="age-input-text" id="ageInputText" disabled type="text" aria-label="Age" .value=${this.patientAge} warning-msg="" readonly></bcbd-input>
|
|
2042
|
+
</div>` : A}
|
|
2043
|
+
<div class="${PREFIX}-edition-modal-information-section-secondary-group">
|
|
2044
|
+
<div class="${PREFIX}-edition-modal-little-section">
|
|
2045
|
+
<span>Taille (cm)</span>
|
|
2046
|
+
<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>
|
|
2047
|
+
</div>
|
|
2048
|
+
<div class="${PREFIX}-edition-modal-little-section">
|
|
2049
|
+
<span>Poids (kg)</span>
|
|
2050
|
+
<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>
|
|
2051
|
+
</div>
|
|
2052
|
+
<div class="${PREFIX}-edition-modal-little-section">
|
|
2053
|
+
<span>IMC</span>
|
|
2054
|
+
<bcbd-input data-test-id="imc-input" id="imcInput" type="number" aria-label="IMC" disabled .value=${this.imc} warning-msg=""></bcbd-input>
|
|
2055
|
+
</div>
|
|
2070
2056
|
</div>
|
|
2071
2057
|
</div>
|
|
2072
2058
|
${this.isPregnancyDivVisible ? b`
|
|
@@ -2131,9 +2117,9 @@ let PatientProfileEdition = class extends i$2 {
|
|
|
2131
2117
|
</div>
|
|
2132
2118
|
</div>
|
|
2133
2119
|
</fieldset>
|
|
2134
|
-
|
|
2135
2120
|
<div class="${PREFIX}-edition-modal-disclaimer-section">
|
|
2136
|
-
|
|
2121
|
+
<bcbd-alert description-message="La qualité des alertes générées dépend de l'exhaustivité des données patient renseignées. Des données incomplètes peuvent entraîner des alertes manquantes ou peu pertinentes. Il est recommandé de compléter l'ensemble des champs disponibles pour garantir une analyse pharmaceutique fiable." type="info">
|
|
2122
|
+
</bcbd-alert>
|
|
2137
2123
|
</div>
|
|
2138
2124
|
</div>
|
|
2139
2125
|
<div slot="actions" class="${PREFIX}-edition-modal-action-buttons" data-test-id="action-buttons">
|
|
@@ -2160,7 +2146,10 @@ __decorateClass$1([
|
|
|
2160
2146
|
], PatientProfileEdition.prototype, "preferences", 2);
|
|
2161
2147
|
__decorateClass$1([
|
|
2162
2148
|
r()
|
|
2163
|
-
], PatientProfileEdition.prototype, "
|
|
2149
|
+
], PatientProfileEdition.prototype, "patientBirthDate", 2);
|
|
2150
|
+
__decorateClass$1([
|
|
2151
|
+
r()
|
|
2152
|
+
], PatientProfileEdition.prototype, "patientAgeValue", 2);
|
|
2164
2153
|
__decorateClass$1([
|
|
2165
2154
|
r()
|
|
2166
2155
|
], PatientProfileEdition.prototype, "patientUnitAge", 2);
|
|
@@ -2176,9 +2165,6 @@ __decorateClass$1([
|
|
|
2176
2165
|
__decorateClass$1([
|
|
2177
2166
|
r()
|
|
2178
2167
|
], PatientProfileEdition.prototype, "dfg", 2);
|
|
2179
|
-
__decorateClass$1([
|
|
2180
|
-
r()
|
|
2181
|
-
], PatientProfileEdition.prototype, "defaultPatientUnitAge", 2);
|
|
2182
2168
|
__decorateClass$1([
|
|
2183
2169
|
r()
|
|
2184
2170
|
], PatientProfileEdition.prototype, "defaultPatientSex", 2);
|
|
@@ -2234,8 +2220,11 @@ __decorateClass$1([
|
|
|
2234
2220
|
e$1("#sizeInput")
|
|
2235
2221
|
], PatientProfileEdition.prototype, "sizeInput", 2);
|
|
2236
2222
|
__decorateClass$1([
|
|
2237
|
-
e$1("#
|
|
2238
|
-
], PatientProfileEdition.prototype, "
|
|
2223
|
+
e$1("#ageInputText")
|
|
2224
|
+
], PatientProfileEdition.prototype, "ageInputText", 2);
|
|
2225
|
+
__decorateClass$1([
|
|
2226
|
+
e$1("#birthDateInput")
|
|
2227
|
+
], PatientProfileEdition.prototype, "birthDateInput", 2);
|
|
2239
2228
|
__decorateClass$1([
|
|
2240
2229
|
e$1("#weightInput")
|
|
2241
2230
|
], PatientProfileEdition.prototype, "weightInput", 2);
|
|
@@ -2263,9 +2252,6 @@ __decorateClass$1([
|
|
|
2263
2252
|
__decorateClass$1([
|
|
2264
2253
|
e$1("#hepaticStadeSelect")
|
|
2265
2254
|
], PatientProfileEdition.prototype, "hepaticStadeSelect", 2);
|
|
2266
|
-
__decorateClass$1([
|
|
2267
|
-
e$1("#ageUnitSelect")
|
|
2268
|
-
], PatientProfileEdition.prototype, "ageUnitSelect", 2);
|
|
2269
2255
|
PatientProfileEdition = __decorateClass$1([
|
|
2270
2256
|
t("bcb-patient-profile-edition")
|
|
2271
2257
|
], PatientProfileEdition);
|
|
@@ -2286,8 +2272,8 @@ let PatientProfile = class extends i$2 {
|
|
|
2286
2272
|
this.apiUrl = "https://api-dev.claudebernard.fr";
|
|
2287
2273
|
this.preferences = {
|
|
2288
2274
|
forms: {
|
|
2289
|
-
age: { display: true, readOnly:
|
|
2290
|
-
sexe: { display: true, readOnly:
|
|
2275
|
+
age: { display: true, readOnly: false },
|
|
2276
|
+
sexe: { display: true, readOnly: false }
|
|
2291
2277
|
}
|
|
2292
2278
|
};
|
|
2293
2279
|
this.moreInformationVisible = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";;AAWA,wBA8CG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@vitest/browser-playwright" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudebernard/patient-profile-element",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"main": "dist/patient-profile.es.js",
|
|
5
5
|
"module": "dist/patient-profile.es.js",
|
|
6
6
|
"types": "dist/patient-profile.d.ts",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
51
51
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
52
52
|
"@lit/localize-tools": "^0.8.0",
|
|
53
|
-
"@playwright/test": "
|
|
53
|
+
"@playwright/test": "1.61.1",
|
|
54
54
|
"@storybook/addon-a11y": "^10.2.11",
|
|
55
|
-
"@storybook/addon-coverage": "^3.0.
|
|
55
|
+
"@storybook/addon-coverage": "^3.0.2",
|
|
56
56
|
"@storybook/addon-docs": "^10.2.11",
|
|
57
57
|
"@storybook/addon-links": "^10.2.11",
|
|
58
58
|
"@storybook/addon-vitest": "^10.2.11",
|
|
@@ -62,17 +62,17 @@
|
|
|
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.65.0",
|
|
66
|
+
"@typescript-eslint/parser": "8.65.0",
|
|
67
67
|
"@vitest/browser-playwright": "^4.0.5",
|
|
68
68
|
"@vitest/coverage-v8": "^4.0.5",
|
|
69
69
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
70
|
-
"eslint": "^
|
|
71
|
-
"eslint-plugin-import": "
|
|
70
|
+
"eslint": "^10.0.0",
|
|
71
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
72
72
|
"eslint-plugin-lit": "^2.1.1",
|
|
73
73
|
"eslint-plugin-storybook": "^10.2.11",
|
|
74
74
|
"lit-analyzer": "^2.0.3",
|
|
75
|
-
"playwright": "
|
|
75
|
+
"playwright": "1.61.1",
|
|
76
76
|
"sass": "^1.79.4",
|
|
77
77
|
"storybook": "^10.2.11",
|
|
78
78
|
"ts-lit-plugin": "^2.0.2",
|
|
@@ -80,8 +80,7 @@
|
|
|
80
80
|
"tslib": "^2.6.2",
|
|
81
81
|
"typescript": "~5.9.0",
|
|
82
82
|
"vite": "^7.1.12",
|
|
83
|
-
"vite-plugin-dts": "^
|
|
84
|
-
"vite-svg-sprite-wrapper": "1.5.0",
|
|
83
|
+
"vite-plugin-dts": "^5.0.3",
|
|
85
84
|
"vitest": "^4.0.7"
|
|
86
85
|
},
|
|
87
86
|
"peerDependencies": {
|
|
@@ -149,8 +148,11 @@
|
|
|
149
148
|
]
|
|
150
149
|
},
|
|
151
150
|
"overrides": {
|
|
152
|
-
"
|
|
153
|
-
|
|
151
|
+
"esbuild": "0.28.1",
|
|
152
|
+
"js-yaml@4.2.0": "^4.3.0",
|
|
153
|
+
"@storybook/addon-coverage": {
|
|
154
|
+
"test-exclude": "^8.0.0",
|
|
155
|
+
"vite-plugin-istanbul": "^9.0.1"
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
}
|