@claudebernard/patient-profile-element 0.5.0 → 0.5.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.
- package/dist/custom-elements.json +27 -12
- package/dist/patient-profile.es.js +22 -18
- package/package.json +1 -1
|
@@ -40,6 +40,13 @@
|
|
|
40
40
|
"type": {
|
|
41
41
|
"text": "WebComponentsStory<any, any>"
|
|
42
42
|
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"kind": "variable",
|
|
46
|
+
"name": "ChangePatientProfile",
|
|
47
|
+
"type": {
|
|
48
|
+
"text": "WebComponentsStory<any, any>"
|
|
49
|
+
}
|
|
43
50
|
}
|
|
44
51
|
],
|
|
45
52
|
"exports": [
|
|
@@ -82,6 +89,14 @@
|
|
|
82
89
|
"name": "PatientProfileEmpty",
|
|
83
90
|
"module": "src/patient-profile/patient-profile.stories.ts"
|
|
84
91
|
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"kind": "js",
|
|
95
|
+
"name": "ChangePatientProfile",
|
|
96
|
+
"declaration": {
|
|
97
|
+
"name": "ChangePatientProfile",
|
|
98
|
+
"module": "src/patient-profile/patient-profile.stories.ts"
|
|
99
|
+
}
|
|
85
100
|
}
|
|
86
101
|
]
|
|
87
102
|
},
|
|
@@ -1141,18 +1156,6 @@
|
|
|
1141
1156
|
}
|
|
1142
1157
|
]
|
|
1143
1158
|
},
|
|
1144
|
-
{
|
|
1145
|
-
"kind": "javascript-module",
|
|
1146
|
-
"path": "src/shared/interfaces/api-return.interface.ts",
|
|
1147
|
-
"declarations": [],
|
|
1148
|
-
"exports": []
|
|
1149
|
-
},
|
|
1150
|
-
{
|
|
1151
|
-
"kind": "javascript-module",
|
|
1152
|
-
"path": "src/shared/interfaces/patient.ts",
|
|
1153
|
-
"declarations": [],
|
|
1154
|
-
"exports": []
|
|
1155
|
-
},
|
|
1156
1159
|
{
|
|
1157
1160
|
"kind": "javascript-module",
|
|
1158
1161
|
"path": "src/shared/mocks/pathologies.mock.ts",
|
|
@@ -1217,6 +1220,18 @@
|
|
|
1217
1220
|
}
|
|
1218
1221
|
]
|
|
1219
1222
|
},
|
|
1223
|
+
{
|
|
1224
|
+
"kind": "javascript-module",
|
|
1225
|
+
"path": "src/shared/interfaces/api-return.interface.ts",
|
|
1226
|
+
"declarations": [],
|
|
1227
|
+
"exports": []
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
"kind": "javascript-module",
|
|
1231
|
+
"path": "src/shared/interfaces/patient.ts",
|
|
1232
|
+
"declarations": [],
|
|
1233
|
+
"exports": []
|
|
1234
|
+
},
|
|
1220
1235
|
{
|
|
1221
1236
|
"kind": "javascript-module",
|
|
1222
1237
|
"path": "src/shared/services/api-prescription.service.ts",
|
|
@@ -1579,7 +1579,7 @@ function e(e2, r2) {
|
|
|
1579
1579
|
} });
|
|
1580
1580
|
};
|
|
1581
1581
|
}
|
|
1582
|
-
const patientProfileCSS = '@charset "UTF-8";\n:host {\n container-type: inline-size;\n}\n\n.claudebernard-patient-profile {\n font-family: var(--custom-font-family, "Ubuntu"), sans-serif;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n padding: 1rem;\n border-radius: 0.5rem;\n background-color: var(--bcbd-white-color, #FFFFFF);\n container-type: inline-size;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__no-profile {\n display: flex;\n flex-direction: column;\n gap: 0.3rem;\n}\n.claudebernard-patient-profile__no-profile__first {\n font-weight: bold;\n}\n.claudebernard-patient-profile__no-profile__second {\n color: var(--bcbd-gray-500-color, #64748B);\n font-size: 0.8rem;\n}\n.claudebernard-patient-profile__separator {\n border-right: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n}\n.claudebernard-patient-profile__first-info-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__first-info-container {\n flex-wrap: wrap;\n gap: 1rem;\n align-items: center;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__first-info-container {\n justify-content: center;\n }\n}\n.claudebernard-patient-profile__id-info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 1;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 0 0 auto;\n align-items: center;\n }\n}\n.claudebernard-patient-profile__name-info {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__id-info {\n width: fit-content;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n border-radius: 1rem;\n display: flex;\n flex-direction: row;\n padding: 0 0.8rem;\n gap: 0.5rem;\n}\n.claudebernard-patient-profile__id-info-info {\n padding: 0.2rem 0;\n white-space: nowrap;\n}\n.claudebernard-patient-profile__physical-info-container {\n display: flex;\n flex-direction: row;\n justify-content: center;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__physical-info-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 3;\n width: 100%;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 2;\n }\n}\n.claudebernard-patient-profile__physical-info {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 0;\n}\n.claudebernard-patient-profile__physical-info-result {\n white-space: nowrap;\n}\n.claudebernard-patient-profile__physical-info-label {\n color: var(--bcbd-gray-600-color, #475569);\n}\n.claudebernard-patient-profile__action-buttons-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__action-buttons-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 2;\n margin: 0 auto;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 3;\n }\n}\n.claudebernard-patient-profile__second-info-container {\n margin-top: 1rem;\n display: none;\n}\n.claudebernard-patient-profile__second-info-container.active {\n display: flex;\n flex-direction: column;\n}\n.claudebernard-patient-profile__second-info {\n margin-top: 1rem;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip {\n display: inline-block;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip > span {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__second-info-label {\n padding-right: 0.5rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__second-info-label {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__second-info-result.sep-dots > * + *::before {\n content: "•";\n margin: 0 0.5rem;\n}';
|
|
1582
|
+
const patientProfileCSS = '@charset "UTF-8";\n:host {\n container-type: inline-size;\n}\n\n.claudebernard-patient-profile {\n font-family: var(--custom-font-family, "Ubuntu"), sans-serif;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n padding: 1rem;\n border-radius: 0.5rem;\n background-color: var(--bcbd-white-color, #FFFFFF);\n container-type: inline-size;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__no-profile {\n display: flex;\n flex-direction: column;\n gap: 0.3rem;\n}\n.claudebernard-patient-profile__no-profile__first {\n font-weight: bold;\n}\n.claudebernard-patient-profile__no-profile__second {\n color: var(--bcbd-gray-500-color, #64748B);\n font-size: 0.8rem;\n}\n.claudebernard-patient-profile__separator {\n border-right: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n}\n.claudebernard-patient-profile__first-info-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__first-info-container {\n flex-wrap: wrap;\n gap: 1rem;\n align-items: center;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__first-info-container {\n justify-content: center;\n }\n}\n.claudebernard-patient-profile__id-info-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 0.5rem;\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 1;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__id-info-container {\n flex: 0 0 auto;\n align-items: center;\n }\n}\n.claudebernard-patient-profile__name-info {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__id-info {\n width: fit-content;\n border: 1px solid var(--bcbd-border-gray-color, #CBD5E1);\n border-radius: 1rem;\n display: flex;\n flex-direction: row;\n padding: 0 0.8rem;\n gap: 0.5rem;\n}\n.claudebernard-patient-profile__id-info-info {\n padding: 0.2rem 0;\n white-space: nowrap;\n font-size: 1rem;\n}\n.claudebernard-patient-profile__physical-info-container {\n display: flex;\n flex-direction: row;\n justify-content: center;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__physical-info-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 3;\n width: 100%;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__physical-info-container {\n order: 2;\n }\n}\n.claudebernard-patient-profile__physical-info {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 0;\n font-size: 1rem;\n}\n.claudebernard-patient-profile__physical-info-result {\n white-space: nowrap;\n}\n.claudebernard-patient-profile__physical-info-label {\n color: var(--bcbd-gray-600-color, #475569);\n}\n.claudebernard-patient-profile__action-buttons-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__action-buttons-container {\n gap: 0.5rem;\n }\n}\n@container (max-width: 450px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 2;\n margin: 0 auto;\n }\n}\n@container (max-width: 320px) {\n .claudebernard-patient-profile__action-buttons-container {\n order: 3;\n }\n}\n.claudebernard-patient-profile__second-info-container {\n margin-top: 1rem;\n display: none;\n}\n.claudebernard-patient-profile__second-info-container.active {\n display: flex;\n flex-direction: column;\n}\n.claudebernard-patient-profile__second-info {\n margin-top: 1rem;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip {\n display: inline-block;\n}\n.claudebernard-patient-profile__second-info bcbd-tooltip > span {\n font-size: 1rem;\n}\n.claudebernard-patient-profile__second-info-label {\n padding-right: 0.5rem;\n color: var(--bcbd-primary-color, #0C75AD);\n}\n@container (max-width: 600px) {\n .claudebernard-patient-profile__second-info-label {\n font-size: 0.8rem;\n }\n}\n.claudebernard-patient-profile__second-info-result.sep-dots > * + *::before {\n content: "•";\n margin: 0 0.5rem;\n}';
|
|
1583
1583
|
const sexOptions = [
|
|
1584
1584
|
{ value: "male", label: "Masculin" },
|
|
1585
1585
|
{ value: "female", label: "Féminin" },
|
|
@@ -1594,18 +1594,22 @@ const ageOptions = [
|
|
|
1594
1594
|
{ value: "ans", label: "Ans" },
|
|
1595
1595
|
{ value: "mois", label: "Mois" }
|
|
1596
1596
|
];
|
|
1597
|
-
const
|
|
1598
|
-
const response = await fetch(`${apiUrl}/
|
|
1597
|
+
const convertRenalInsufficiency = async (type, value, patient, apiUrl) => {
|
|
1598
|
+
const response = await fetch(`${apiUrl}/prescription/patient/fhir/renal-insufficiency-conversion`, {
|
|
1599
1599
|
method: "POST",
|
|
1600
1600
|
headers: {
|
|
1601
1601
|
"Content-Type": "application/json"
|
|
1602
1602
|
},
|
|
1603
|
-
body: JSON.stringify(
|
|
1603
|
+
body: JSON.stringify({
|
|
1604
|
+
typeEntree: type,
|
|
1605
|
+
valeur: value,
|
|
1606
|
+
patient
|
|
1607
|
+
})
|
|
1604
1608
|
});
|
|
1605
1609
|
return response.json();
|
|
1606
1610
|
};
|
|
1607
|
-
const
|
|
1608
|
-
const response = await fetch(`${apiUrl}/search/
|
|
1611
|
+
const fetchPathologiesByTerm = async (term, typePathology, params, apiUrl) => {
|
|
1612
|
+
const response = await fetch(`${apiUrl}/search/pathologies/?term=${term}&typePathology=${typePathology}`, {
|
|
1609
1613
|
method: "POST",
|
|
1610
1614
|
headers: {
|
|
1611
1615
|
"Content-Type": "application/json"
|
|
@@ -1614,21 +1618,17 @@ const fetchMoleculesByTerm = async (term, params, apiUrl) => {
|
|
|
1614
1618
|
});
|
|
1615
1619
|
return response.json();
|
|
1616
1620
|
};
|
|
1617
|
-
const
|
|
1618
|
-
const
|
|
1619
|
-
const response = await fetch(`${apiUrl}/prescription/patient/fhir/renal-insufficiency-conversion`, {
|
|
1621
|
+
const fetchMoleculesByTerm = async (term, params, apiUrl) => {
|
|
1622
|
+
const response = await fetch(`${apiUrl}/search/molecules/?term=${term}`, {
|
|
1620
1623
|
method: "POST",
|
|
1621
1624
|
headers: {
|
|
1622
1625
|
"Content-Type": "application/json"
|
|
1623
1626
|
},
|
|
1624
|
-
body: JSON.stringify(
|
|
1625
|
-
typeEntree: type,
|
|
1626
|
-
valeur: value,
|
|
1627
|
-
patient
|
|
1628
|
-
})
|
|
1627
|
+
body: JSON.stringify(params)
|
|
1629
1628
|
});
|
|
1630
1629
|
return response.json();
|
|
1631
1630
|
};
|
|
1631
|
+
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 padding-top: 10px;\n padding-bottom: 30px;\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}";
|
|
1632
1632
|
var __defProp$1 = Object.defineProperty;
|
|
1633
1633
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
1634
1634
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -1691,7 +1691,9 @@ let PatientProfileEdition = class extends i {
|
|
|
1691
1691
|
this.breastfeeding = getPatientBreastfeedingStatus(this.patientProfile);
|
|
1692
1692
|
this.isPregnant = getPatientPregnancyStatus(this.patientProfile);
|
|
1693
1693
|
const birthDate = getPatientBirthDate(this.patientProfile);
|
|
1694
|
+
this.isPregnancyDivVisible = false;
|
|
1694
1695
|
if (birthDate) {
|
|
1696
|
+
this.ageInput.setAttribute("warning-msg", "");
|
|
1695
1697
|
const today = /* @__PURE__ */ new Date();
|
|
1696
1698
|
const yearsDiff = today.getFullYear() - birthDate.getFullYear();
|
|
1697
1699
|
const monthsDiff = today.getMonth() - birthDate.getMonth();
|
|
@@ -1703,7 +1705,9 @@ let PatientProfileEdition = class extends i {
|
|
|
1703
1705
|
} else {
|
|
1704
1706
|
this.patientAge = Math.floor(monthsDifference / 12);
|
|
1705
1707
|
this.patientUnitAge = "ans";
|
|
1706
|
-
this.
|
|
1708
|
+
if (this.defaultPatientSex.value !== "male") {
|
|
1709
|
+
this.isPregnancyDivVisible = true;
|
|
1710
|
+
}
|
|
1707
1711
|
}
|
|
1708
1712
|
this.defaultPatientUnitAge = {
|
|
1709
1713
|
value: this.patientUnitAge,
|
|
@@ -2077,7 +2081,7 @@ let PatientProfileEdition = class extends i {
|
|
|
2077
2081
|
<div class="${PREFIX}-edition-modal-action-buttons" data-test-id="action-buttons">
|
|
2078
2082
|
<bcbd-button ?disabled=${this.ageErrorMessageInput !== "" || this.sizeErrorMessageInput !== "" || this.weightErrorMessageInput !== ""}
|
|
2079
2083
|
data-test-id="save-button" background-color="primary" @click=${this.validateForm}>Valider</bcbd-button>
|
|
2080
|
-
<bcbd-button data-test-id="cancel-button" outlined background-color="
|
|
2084
|
+
<bcbd-button data-test-id="cancel-button" outlined background-color="primary" @click=${() => this.editionModalElement.close()}>Annuler</bcbd-button>
|
|
2081
2085
|
</div>
|
|
2082
2086
|
</div>
|
|
2083
2087
|
</bcbd-modal>`;
|
|
@@ -2411,7 +2415,7 @@ let PatientProfile = class extends i {
|
|
|
2411
2415
|
<div class="${PREFIX}-patient-profile__no-profile__first">Aucun profil patient renseigné</div>
|
|
2412
2416
|
<div class="${PREFIX}-patient-profile__no-profile__second">Veuillez remplir le formulaire</div>
|
|
2413
2417
|
</div>
|
|
2414
|
-
${this.editButtonVisible || this.editButtonVisible === void 0 ? b`<bcbd-button icon="pencil" size="medium" background-color="
|
|
2418
|
+
${this.editButtonVisible || this.editButtonVisible === void 0 ? b`<bcbd-button icon="pencil" size="medium" background-color="primary" outlined aria-label="Modifier le profil patient" data-test-id="modify-button" @click=${this.openEditionModal}></bcbd-button>` : A}
|
|
2415
2419
|
` : b`
|
|
2416
2420
|
<div class="${PREFIX}-patient-profile__id-info-container">
|
|
2417
2421
|
<div class="${PREFIX}-patient-profile__name-info" data-test-id="patient-name">
|
|
@@ -2466,7 +2470,7 @@ let PatientProfile = class extends i {
|
|
|
2466
2470
|
</div>
|
|
2467
2471
|
|
|
2468
2472
|
<div class="${PREFIX}-patient-profile__action-buttons-container" data-test-id="action-buttons">
|
|
2469
|
-
${this.editButtonVisible || this.editButtonVisible === void 0 ? b`<bcbd-button icon="pencil" size="medium" background-color="
|
|
2473
|
+
${this.editButtonVisible || this.editButtonVisible === void 0 ? b`<bcbd-button icon="pencil" size="medium" background-color="primary" outlined aria-label="Modifier le profil patient" data-test-id="modify-button" @click=${this.openEditionModal}></bcbd-button>` : A}
|
|
2470
2474
|
<bcbd-button icon=${this.moreInformationVisible ? "chevron-up" : "chevron-down"} size="medium" background-color="primary" aria-label=${this.moreInformationVisible ? "Masquer les informations supplémentaires" : "Afficher les informations supplémentaires"} @click=${this.handleMoreInformation} data-test-id="visible-button"></bcbd-button>
|
|
2471
2475
|
</div>`}
|
|
2472
2476
|
</div>
|