@claudebernard/patient-profile-element 0.3.2 → 0.3.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.
@@ -20,7 +20,7 @@
20
20
  "type": {
21
21
  "text": "Story"
22
22
  },
23
- "default": "{\n args: {\n patientProfile: clonePatientProfile(),\n },\n play: async({ canvasElement, step }) => {\n const component = canvasElement.querySelector(\"bcb-patient-profile\") as HTMLElement | null;\n\n await step(\"Verify the patient ID information\", () => {\n const divName = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-name\\\"]\") as HTMLElement | null;\n expect(divName?.textContent).toContain(\"Marie Dupont\");\n\n const divGender = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-gender\\\"]\") as HTMLElement | null;\n expect(divGender?.textContent).toContain(\"Femme\");\n\n const divAge = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-age\\\"]\") as HTMLElement | null;\n expect(divAge?.textContent).toContain(\"42 ans\");\n });\n\n await step(\"Verify the patient physical information\", () => {\n const divHeight = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-height\\\"]\") as HTMLElement | null;\n const textHeight = divHeight?.textContent ?? \"\";\n expect(textHeight).toContain(\"Taille\");\n expect(textHeight).toContain(\"170\");\n expect(textHeight).toContain(\"cm\");\n\n const divWeight = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-weight\\\"]\") as HTMLElement | null;\n const textWeight = divWeight?.textContent ?? \"\";\n expect(textWeight).toContain(\"Poids\");\n expect(textWeight).toContain(\"84\");\n expect(textWeight).toContain(\"kg\");\n\n const divIMC = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-IMC\\\"]\") as HTMLElement | null;\n expect(divIMC?.textContent).toContain(\"29.1\");\n });\n\n const divActions = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"action-buttons\\\"]\") as HTMLElement | null;\n const modifyButton = divActions?.querySelector(\"bcbd-button[data-test-id=\\\"modify-button\\\"]\") as HTMLElement | null;\n const visibleButton = divActions?.querySelector(\"bcbd-button[data-test-id=\\\"visible-button\\\"]\") as HTMLElement | null;\n\n await step(\"Verify the action buttons and more information section\", async() => {\n await expect(modifyButton).not.toBeNull();\n await expect(visibleButton).not.toBeNull();\n });\n\n const moreInfoDiv = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"more-information-section\\\"]\") as HTMLElement | null;\n\n await step(\"Verify the more information section is not visible\", () => {\n expect(moreInfoDiv?.className).not.toContain(\"active\");\n expect(moreInfoDiv).not.toBeVisible();\n });\n\n await step(\"Click on the more information button and verify the displayed information\", async() => {\n if (visibleButton) {\n await visibleButton.click();\n }\n expect(moreInfoDiv).toBeVisible();\n });\n\n // eslint-disable-next-line complexity\n await step(\"Verify the content of more information section\", () => {\n const pregnancyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"pregnancy-section\\\"]\") as HTMLElement | null;\n expect(pregnancyDiv).toBeVisible();\n const textPregnancy = pregnancyDiv?.textContent ?? \"\";\n expect(textPregnancy).toContain(\"Oui - 20 semaine(s)\");\n\n const breastfeedingDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"breastfeeding-section\\\"]\") as HTMLElement | null;\n expect(breastfeedingDiv).toBeVisible();\n const textBreastfeeding = breastfeedingDiv?.textContent ?? \"\";\n expect(textBreastfeeding).toContain(\"Oui\");\n\n const pathologyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"pathology-section\\\"]\") as HTMLElement | null;\n expect(pathologyDiv).toBeVisible();\n const textPathology = pathologyDiv?.textContent ?? \"\";\n expect(textPathology).toContain(\"Pathologies suivies\");\n expect(textPathology).toContain(\"Insuffisance hépatique\");\n expect(textPathology).toContain(\"Insuffisance rénale aigüe\");\n expect(textPathology).toContain(\"Insuffisance hépatique mo.\");\n expect(textPathology).toContain(\"Insuffisance cardiaque\");\n\n const allergyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"allergy-section\\\"]\") as HTMLElement | null;\n expect(allergyDiv).toBeVisible();\n const textAllergy = allergyDiv?.textContent ?? \"\";\n expect(textAllergy).toContain(\"Allergies\");\n expect(textAllergy).toContain(\"Allergie au paracétamol\");\n\n const hepaticInsufficiencyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"hepatic-insufficiency-section\\\"]\") as HTMLElement | null;\n expect(hepaticInsufficiencyDiv).toBeVisible();\n const textHepaticInsufficiency = hepaticInsufficiencyDiv?.textContent ?? \"\";\n expect(textHepaticInsufficiency).toContain(\"Insuffisance hépatique\");\n expect(textHepaticInsufficiency).toContain(\"Stade B\");\n\n const clairanceDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"clearance-section\\\"]\") as HTMLElement | null;\n expect(clairanceDiv).toBeVisible();\n const textClairance = clairanceDiv?.textContent ?? \"\";\n expect(textClairance).toContain(\"Clairance créatinine\");\n expect(textClairance).toContain(\"60 mL/min\");\n\n const dfgDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"dfg-section\\\"]\") as HTMLElement | null;\n expect(dfgDiv).toBeVisible();\n const textDfg = dfgDiv?.textContent ?? \"\";\n expect(textDfg).toContain(\"DFG\");\n expect(textDfg).toContain(\"45 mL/min\");\n });\n\n //Close the more information section at the end of the test\n if (visibleButton) {\n await visibleButton.click();\n }\n },\n}"
23
+ "default": "{\n args: {\n patientProfile: clonePatientProfile(),\n },\n play: async({ canvasElement, step }) => {\n const component = canvasElement.querySelector(\"bcb-patient-profile\") as HTMLElement | null;\n\n await step(\"Verify the patient ID information\", () => {\n const divName = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-name\\\"]\") as HTMLElement | null;\n expect(divName?.textContent).toContain(\"Marie Dupont\");\n\n const divGender = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-gender\\\"]\") as HTMLElement | null;\n expect(divGender?.textContent).toContain(\"Femme\");\n\n const divAge = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-age\\\"]\") as HTMLElement | null;\n expect(divAge?.textContent).toContain(\"42 ans\");\n });\n\n await step(\"Verify the patient physical information\", () => {\n const divHeight = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-height\\\"]\") as HTMLElement | null;\n const textHeight = divHeight?.textContent ?? \"\";\n expect(textHeight).toContain(\"Taille\");\n expect(textHeight).toContain(\"170\");\n expect(textHeight).toContain(\"cm\");\n\n const divWeight = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-weight\\\"]\") as HTMLElement | null;\n const textWeight = divWeight?.textContent ?? \"\";\n expect(textWeight).toContain(\"Poids\");\n expect(textWeight).toContain(\"84\");\n expect(textWeight).toContain(\"kg\");\n\n const divIMC = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"patient-IMC\\\"]\") as HTMLElement | null;\n expect(divIMC?.textContent).toContain(\"29.1\");\n });\n\n const divActions = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"action-buttons\\\"]\") as HTMLElement | null;\n const modifyButton = divActions?.querySelector(\"bcbd-button[data-test-id=\\\"modify-button\\\"]\") as HTMLElement | null;\n const visibleButton = divActions?.querySelector(\"bcbd-button[data-test-id=\\\"visible-button\\\"]\") as HTMLElement | null;\n\n await step(\"Verify the action buttons and more information section\", async() => {\n await expect(modifyButton).not.toBeNull();\n await expect(visibleButton).not.toBeNull();\n });\n\n const moreInfoDiv = component?.shadowRoot?.querySelector(\"div[data-test-id=\\\"more-information-section\\\"]\") as HTMLElement | null;\n\n await step(\"Verify the more information section is not visible\", () => {\n expect(moreInfoDiv?.className).not.toContain(\"active\");\n expect(moreInfoDiv).not.toBeVisible();\n });\n\n await step(\"Click on the more information button and verify the displayed information\", async() => {\n if (visibleButton) {\n await visibleButton.click();\n }\n expect(moreInfoDiv).toBeVisible();\n });\n\n // eslint-disable-next-line complexity\n await step(\"Verify the content of more information section\", () => {\n const pregnancyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"pregnancy-section\\\"]\") as HTMLElement | null;\n expect(pregnancyDiv).toBeVisible();\n const textPregnancy = pregnancyDiv?.textContent ?? \"\";\n expect(textPregnancy).toContain(\"Oui - 20 semaine(s)\");\n\n const breastfeedingDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"breastfeeding-section\\\"]\") as HTMLElement | null;\n expect(breastfeedingDiv).toBeVisible();\n const textBreastfeeding = breastfeedingDiv?.textContent ?? \"\";\n expect(textBreastfeeding).toContain(\"Oui\");\n\n const pathologyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"pathology-section\\\"]\") as HTMLElement | null;\n expect(pathologyDiv).toBeVisible();\n const textPathology = pathologyDiv?.textContent ?? \"\";\n expect(textPathology).toContain(\"Pathologies suivies\");\n expect(textPathology).toContain(\"Insuffisance hépatique\");\n expect(textPathology).toContain(\"Insuffisance rénale aigüe\");\n expect(textPathology).toContain(\"Insuffisance hépatique mo.\");\n expect(textPathology).toContain(\"Insuffisance cardiaque\");\n\n const allergyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"allergy-section\\\"]\") as HTMLElement | null;\n expect(allergyDiv).toBeVisible();\n const textAllergy = allergyDiv?.textContent ?? \"\";\n expect(textAllergy).toContain(\"Allergies\");\n expect(textAllergy).toContain(\"Allergie au paracétamol\");\n\n const hepaticInsufficiencyDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"hepatic-insufficiency-section\\\"]\") as HTMLElement | null;\n expect(hepaticInsufficiencyDiv).toBeVisible();\n const textHepaticInsufficiency = hepaticInsufficiencyDiv?.textContent ?? \"\";\n expect(textHepaticInsufficiency).toContain(\"Insuffisance hépatique\");\n expect(textHepaticInsufficiency).toContain(\"Stade B\");\n\n const clairanceDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"clearance-section\\\"]\") as HTMLElement | null;\n expect(clairanceDiv).toBeVisible();\n const textClairance = clairanceDiv?.textContent ?? \"\";\n expect(textClairance).toContain(\"Clairance créatinine\");\n expect(textClairance).toContain(\"71 mL/min\");\n\n const dfgDiv = moreInfoDiv?.querySelector(\"div[data-test-id=\\\"dfg-section\\\"]\") as HTMLElement | null;\n expect(dfgDiv).toBeVisible();\n const textDfg = dfgDiv?.textContent ?? \"\";\n expect(textDfg).toContain(\"DFG\");\n expect(textDfg).toContain(\"45 mL/min\");\n });\n\n //Close the more information section at the end of the test\n if (visibleButton) {\n await visibleButton.click();\n }\n },\n}"
24
24
  },
25
25
  {
26
26
  "kind": "variable",
@@ -36,7 +36,7 @@
36
36
  "type": {
37
37
  "text": "Story"
38
38
  },
39
- "default": "{\n args: {\n patientProfile: clonePatientProfile(),\n },\n play: async({ canvasElement, step }) => {\n const restoreFetch = installFetchMockForPathologies(mockPathologies);\n try {\n const component = canvasElement.querySelector(\"bcb-patient-profile\") as HTMLElement | null;\n const shadow = component?.shadowRoot;\n\n await step(\"Verify initial value\", () => {\n const heightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-height\\\"]\") as HTMLElement | null;\n const weightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-weight\\\"]\") as HTMLElement | null;\n const ageDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-age\\\"]\") as HTMLElement | null;\n\n expect(heightDiv?.textContent ?? \"\").toContain(\"170 cm\");\n expect(weightDiv?.textContent ?? \"\").toContain(\"84 kg\");\n expect(ageDiv?.textContent ?? \"\").toContain(\"42 ans\");\n });\n\n const editionComponent = component?.shadowRoot?.querySelector(\"bcb-patient-profile-edition\") as HTMLElement | null;\n const editionContent = editionComponent?.shadowRoot?.querySelector(\"div\") as HTMLElement | null;\n\n // eslint-disable-next-line complexity\n await step(\"Basculer en mode édition et modifier les champs\", async() => {\n const actionsDiv = shadow?.querySelector(\"div[data-test-id=\\\"action-buttons\\\"]\") as HTMLElement | null;\n const modifyButton = actionsDiv?.querySelector(\"bcbd-button[data-test-id=\\\"modify-button\\\"]\") as HTMLElement | null;\n await modifyButton?.click();\n\n const sizeInput = editionContent?.querySelector(\"[data-test-id=\\\"size-input\\\"]\") as HTMLInputElement | null;\n const ageInput = editionContent?.querySelector(\"[data-test-id=\\\"age-input\\\"]\") as HTMLInputElement | null;\n const weightInput = editionContent?.querySelector(\"[data-test-id=\\\"weight-input\\\"]\") as HTMLInputElement | null;\n\n if (sizeInput) {\n sizeInput.value = \"\";\n sizeInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n sizeInput.value = \"20\";\n sizeInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n }\n\n if (ageInput) {\n ageInput.value = \"\";\n ageInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n ageInput.value = \"50\";\n ageInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n }\n\n if (weightInput) {\n weightInput.value = \"\";\n weightInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n weightInput.value = \"90\";\n weightInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n }\n const pathologieSelect = editionContent?.querySelector(\"[data-test-id=\\\"pathologies-select\\\"]\");\n\n const pathologiesSearch = pathologieSelect?.shadowRoot?.querySelector(\"input[type=\\\"text\\\"]\") as HTMLInputElement | null;\n if (pathologiesSearch) {\n await pathologiesSearch.click();\n pathologiesSearch.value = \"tes\";\n pathologiesSearch.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n await pathologiesSearch.click();\n }\n const optionSelector = \"div[data-test-id=\\\"select-option-K63\\\\.0\\\"]\";\n if (pathologieSelect instanceof HTMLElement) {\n const optionPatho = await waitForOption(pathologieSelect, optionSelector, 4000);\n await optionPatho.click();\n }\n\n const hepaticSelect = editionContent?.querySelector(\"[data-test-id=\\\"hepatic-stade-select\\\"]\") as HTMLElement | null;\n if (hepaticSelect instanceof HTMLElement) {\n await hepaticSelect?.click();\n\n const optionA = \"div[data-test-id=\\\"select-option-A\\\"]\";\n const optionStade = await waitForOption(hepaticSelect, optionA, 4000);\n await optionStade?.click();\n }\n\n const validateButton = editionContent?.querySelector(\"[data-test-id=\\\"save-button\\\"]\") as HTMLButtonElement | null;\n await validateButton?.click();\n });\n\n await step(\"Vérifier les valeurs modifiées en mode visuel\", () => {\n const pathologyDiv = shadow?.querySelector(\"div[data-test-id=\\\"pathology-section\\\"]\") as HTMLElement | null;\n const heightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-height\\\"]\") as HTMLElement | null;\n const weightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-weight\\\"]\") as HTMLElement | null;\n const ageDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-age\\\"]\") as HTMLElement | null;\n\n expect(heightDiv?.textContent ?? \"\").toContain(\"20 cm\");\n expect(weightDiv?.textContent ?? \"\").toContain(\"90 kg\");\n expect(ageDiv?.textContent ?? \"\").toContain(\"50 ans\");\n\n const pathologyText = pathologyDiv?.textContent ?? \"\";\n expect(pathologyText).toContain(\"Abces de l'intestin\");\n });\n } finally {\n restoreFetch();\n }\n },\n}"
39
+ "default": "{\n args: {\n patientProfile: clonePatientProfile(),\n },\n play: async({ canvasElement, step }) => {\n const restoreFetch = installFetchMockForPathologies(mockPathologies);\n try {\n const component = canvasElement.querySelector(\"bcb-patient-profile\") as HTMLElement | null;\n\n if (component) {\n component.setAttribute(\"patientProfile\", JSON.stringify(clonePatientProfile()));\n // Ou si c'est une propriété :\n (component as any).patientProfile = clonePatientProfile();\n }\n \n const shadow = component?.shadowRoot;\n\n await step(\"Verify initial value\", () => {\n const heightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-height\\\"]\") as HTMLElement | null;\n const weightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-weight\\\"]\") as HTMLElement | null;\n const ageDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-age\\\"]\") as HTMLElement | null;\n\n expect(heightDiv?.textContent ?? \"\").toContain(\"170 cm\");\n expect(weightDiv?.textContent ?? \"\").toContain(\"84 kg\");\n expect(ageDiv?.textContent ?? \"\").toContain(\"42 ans\");\n });\n\n const editionComponent = component?.shadowRoot?.querySelector(\"bcb-patient-profile-edition\") as HTMLElement | null;\n const editionContent = editionComponent?.shadowRoot?.querySelector(\"div\") as HTMLElement | null;\n\n // eslint-disable-next-line complexity\n await step(\"Basculer en mode édition et modifier les champs\", async() => {\n const actionsDiv = shadow?.querySelector(\"div[data-test-id=\\\"action-buttons\\\"]\") as HTMLElement | null;\n const modifyButton = actionsDiv?.querySelector(\"bcbd-button[data-test-id=\\\"modify-button\\\"]\") as HTMLElement | null;\n await modifyButton?.click();\n\n const sizeInput = editionContent?.querySelector(\"[data-test-id=\\\"size-input\\\"]\") as HTMLInputElement | null;\n const ageInput = editionContent?.querySelector(\"[data-test-id=\\\"age-input\\\"]\") as HTMLInputElement | null;\n const weightInput = editionContent?.querySelector(\"[data-test-id=\\\"weight-input\\\"]\") as HTMLInputElement | null;\n\n if (sizeInput) {\n sizeInput.value = \"\";\n sizeInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n sizeInput.value = \"20\";\n sizeInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n }\n\n if (ageInput) {\n ageInput.value = \"\";\n ageInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n ageInput.value = \"50\";\n ageInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n }\n\n if (weightInput) {\n weightInput.value = \"\";\n weightInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n weightInput.value = \"90\";\n weightInput.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n }\n const pathologieSelect = editionContent?.querySelector(\"[data-test-id=\\\"pathologies-select\\\"]\");\n\n const pathologiesSearch = pathologieSelect?.shadowRoot?.querySelector(\"input[type=\\\"text\\\"]\") as HTMLInputElement | null;\n if (pathologiesSearch) {\n await pathologiesSearch.click();\n pathologiesSearch.value = \"tes\";\n pathologiesSearch.dispatchEvent(new InputEvent(\"input\", { bubbles: true, composed: true }));\n await pathologiesSearch.click();\n }\n const optionSelector = \"div[data-test-id=\\\"select-option-K63\\\\.0\\\"]\";\n if (pathologieSelect instanceof HTMLElement) {\n const optionPatho = await waitForOption(pathologieSelect, optionSelector, 4000);\n await optionPatho.click();\n }\n\n const hepaticSelect = editionContent?.querySelector(\"[data-test-id=\\\"hepatic-stade-select\\\"]\") as HTMLElement | null;\n if (hepaticSelect instanceof HTMLElement) {\n await hepaticSelect?.click();\n\n const optionA = \"div[data-test-id=\\\"select-option-A\\\"]\";\n const optionStade = await waitForOption(hepaticSelect, optionA, 4000);\n await optionStade?.click();\n }\n\n const validateButton = editionContent?.querySelector(\"[data-test-id=\\\"save-button\\\"]\") as HTMLButtonElement | null;\n await validateButton?.click();\n });\n\n await step(\"Vérifier les valeurs modifiées en mode visuel\", () => {\n const pathologyDiv = shadow?.querySelector(\"div[data-test-id=\\\"pathology-section\\\"]\") as HTMLElement | null;\n const heightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-height\\\"]\") as HTMLElement | null;\n const weightDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-weight\\\"]\") as HTMLElement | null;\n const ageDiv = shadow?.querySelector(\"div[data-test-id=\\\"patient-age\\\"]\") as HTMLElement | null;\n\n expect(heightDiv?.textContent ?? \"\").toContain(\"20 cm\");\n expect(weightDiv?.textContent ?? \"\").toContain(\"90 kg\");\n expect(ageDiv?.textContent ?? \"\").toContain(\"50 ans\");\n\n const pathologyText = pathologyDiv?.textContent ?? \"\";\n expect(pathologyText).toContain(\"Abces de l'intestin\");\n });\n } finally {\n restoreFetch();\n }\n },\n}"
40
40
  }
41
41
  ],
42
42
  "exports": [
@@ -158,6 +158,11 @@
158
158
  "kind": "method",
159
159
  "name": "displayCreatininemieSection"
160
160
  },
161
+ {
162
+ "kind": "method",
163
+ "name": "displayHepaticInsufficiencySection",
164
+ "privacy": "private"
165
+ },
161
166
  {
162
167
  "kind": "method",
163
168
  "name": "truncateLabel",
@@ -316,7 +321,7 @@
316
321
  "type": {
317
322
  "text": "Story"
318
323
  },
319
- "default": "{\n args: {\n patientProfile: patientComplete,\n apiUrl: \"https://api-dev.claudebernard.fr\",\n },\n play: async({ canvasElement, step }) => {\n const component = canvasElement.querySelector(\"bcb-patient-profile-edition\") as PatientProfileEdition | null;\n const modal = component?.shadowRoot?.querySelector(\"bcbd-modal\") as HTMLElement | null;\n const openButton = canvasElement.querySelector(\"bcbd-button\") as HTMLElement | null;\n openButton?.click();\n const modalTitle = modal?.shadowRoot?.querySelector(\"div.claudebernard-modal__header\") as HTMLElement | null;\n\n await step(\"Verify the modal is opened and well displayed\", () => {\n expect(modal).toBeVisible();\n expect(modalTitle?.textContent).toContain(\"Édition du profil patient\");\n expect(component?.shadowRoot?.querySelectorAll(\"bcbd-input\").length).toBe(9);\n expect(component?.shadowRoot?.querySelectorAll(\"bcbd-select\").length).toBe(6);\n expect(component?.shadowRoot?.querySelectorAll(\"bcbd-checkbox\").length).toBe(2);\n expect(component?.shadowRoot?.querySelectorAll(\".claudebernard-edition-modal-subtitle\")?.[0]?.textContent).toContain(\"Insuffisance rénale\");\n expect(component?.shadowRoot?.querySelectorAll(\".claudebernard-edition-modal-subtitle\")?.[1]?.textContent).toContain(\"Insuffisance hépatique\");\n const saveButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\");\n const cancelButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"cancel-button\\\"]\");\n\n expect(saveButton).not.toBeNull();\n expect(cancelButton).not.toBeNull();\n });\n\n // eslint-disable-next-line complexity\n await step(\"Verify all the patient information is here\", () => {\n const nameSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"name-select\\\"]\") as HTMLElement | null;\n expect(nameSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Marie Dupont\");\n\n const sexSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"sex-select\\\"]\") as HTMLElement | null;\n expect(sexSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Féminin\");\n\n const sizeInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"size-input\\\"]\") as HTMLElement | null;\n expect(sizeInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"170\");\n\n const ageInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"age-input\\\"]\") as HTMLElement | null;\n expect(ageInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"42\");\n\n const ageUnitSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"age-unit-select\\\"]\") as HTMLElement | null;\n expect(ageUnitSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Ans\");\n\n const weightInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"weight-input\\\"]\") as HTMLElement | null;\n expect(weightInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"84\");\n\n const pregnancyCheckbox = component?.shadowRoot?.querySelector(\"bcbd-checkbox[data-test-id=\\\"pregnancy-checkbox\\\"]\") as HTMLElement | null;\n expect(pregnancyCheckbox?.shadowRoot?.querySelector(\"input\")?.checked).toBe(true);\n\n const gestationalInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"gestational-input\\\"]\") as HTMLElement | null;\n expect(gestationalInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"20\");\n\n const breastfeedingCheckbox = component?.shadowRoot\n ?.querySelector(\"bcbd-checkbox[data-test-id=\\\"breastfeeding-checkbox\\\"]\") as HTMLElement | null;\n expect(breastfeedingCheckbox?.shadowRoot?.querySelector(\"input\")?.checked).toBe(true);\n\n const pathologiesSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"pathologies-select\\\"]\") as HTMLElement | null;\n const pathologiesValues = pathologiesSelect?.shadowRoot?.querySelectorAll(\"bcbd-badge\");\n expect(pathologiesValues?.length).toBe(4);\n expect(pathologiesValues?.[0]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance hépatique\");\n expect(pathologiesValues?.[1]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance rénale aigüe\");\n expect(pathologiesValues?.[2]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance hépatique modérée\");\n expect(pathologiesValues?.[3]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance cardiaque\");\n\n const allergiesSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"allergies-select\\\"]\") as HTMLElement | null;\n const allergiesValues = allergiesSelect?.shadowRoot?.querySelectorAll(\"bcbd-badge\");\n expect(allergiesValues?.length).toBe(1);\n expect(allergiesValues?.[0]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Allergie au paracétamol\");\n\n const creatinineByUmolInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"creatinine-umol-input\\\"]\") as HTMLElement | null;\n expect(creatinineByUmolInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"141\");\n\n const creatinineBymglInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"creatinine-mgl-input\\\"]\") as HTMLElement | null;\n expect(creatinineBymglInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"16\");\n\n const clearanceInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"clearance-input\\\"]\") as HTMLElement | null;\n expect(clearanceInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"60\");\n\n const dfgInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"dfg-input\\\"]\") as HTMLElement | null;\n expect(dfgInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"45\");\n\n const hepaticStadeSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"hepatic-stade-select\\\"]\") as HTMLElement | null;\n expect(hepaticStadeSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Stade B\");\n\n const hepaticScoreInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"hepatic-score-input\\\"]\") as HTMLElement | null;\n expect(hepaticScoreInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"7\");\n });\n\n await step(\"Verify if error message goes well displayed on size input\", async() => {\n const sizeInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"size-input\\\"]\") as HTMLElement;\n const validateButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\") as HTMLElement;\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n const sizeInputField = sizeInput?.shadowRoot?.querySelector(\"input\") as HTMLInputElement;\n //Test invalid size\n sizeInputField.value = \"0\";\n sizeInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"La taille n'est pas valide\");\n\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n\n sizeInputField.value = \"400\";\n sizeInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"La taille n'est pas valide\");\n expect(validateButton.getAttribute(\"disabled\")).not.toBe(null);\n\n //Test valid size\n sizeInputField.value = \"170\";\n sizeInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n });\n\n await step(\"Verify if error message goes well displayed on age input\", async() => {\n const ageInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"age-input\\\"]\") as HTMLElement;\n const validateButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\") as HTMLElement;\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n const ageInputField = ageInput?.shadowRoot?.querySelector(\"input\") as HTMLInputElement;\n //Test invalid age\n ageInputField.value = \"1\";\n ageInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"L'âge doit être exprimé en mois si inférieur à 2 ans\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).not.toBe(null);\n\n ageInputField.value = \"300\";\n ageInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"L'âge ne doit pas dépasser 150 ans\");\n\n //Test valid age\n ageInputField.value = \"41\";\n ageInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n\n //Change unit to months and test invalid age\n const ageUnitSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"age-unit-select\\\"]\") as HTMLElement;\n expect(ageUnitSelect).not.toBeNull();\n ageUnitSelect!.click();\n let shadowRoot = (ageUnitSelect as any).shadowRoot as ShadowRoot;\n expect(shadowRoot).not.toBeNull();\n const optionMois = shadowRoot.querySelector<HTMLElement>(\"div[data-test-id=\\\"select-option-mois\\\"]\") as HTMLElement;\n optionMois.click();\n\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"L'âge en mois ne doit pas dépasser 23 mois, veuillez compter en années\");\n\n //Go back like initial state\n ageUnitSelect.click();\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n shadowRoot = (ageUnitSelect as any).shadowRoot as ShadowRoot;\n const optionAns = shadowRoot.querySelector<HTMLElement>(\"div[data-test-id=\\\"select-option-ans\\\"]\") as HTMLElement;\n optionAns.click();\n });\n\n await step(\"Verify if error message goes well displayed on weight input\", async() => {\n const weightInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"weight-input\\\"]\") as HTMLElement;\n const validateButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\") as HTMLElement;\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n expect(weightInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n const weightInputField = weightInput?.shadowRoot?.querySelector(\"input\") as HTMLInputElement;\n //Test invalid weight\n weightInputField.value = \"320\";\n weightInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(weightInput?.getAttribute(\"warning-msg\")).toBe(\"Le poids ne doit pas dépasser 300kg\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).not.toBe(null);\n\n //Test valid weight\n weightInputField.value = \"84\";\n weightInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(weightInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n });\n },\n}"
324
+ "default": "{\n args: {\n patientProfile: patientComplete,\n apiUrl: \"https://api-dev.claudebernard.fr\",\n },\n play: async({ canvasElement, step }) => {\n const component = canvasElement.querySelector(\"bcb-patient-profile-edition\") as PatientProfileEdition | null;\n const modal = component?.shadowRoot?.querySelector(\"bcbd-modal\") as HTMLElement | null;\n const openButton = canvasElement.querySelector(\"bcbd-button\") as HTMLElement | null;\n openButton?.click();\n const modalTitle = modal?.shadowRoot?.querySelector(\"div.claudebernard-modal__header\") as HTMLElement | null;\n\n await step(\"Verify the modal is opened and well displayed\", () => {\n expect(modal).toBeVisible();\n expect(modalTitle?.textContent).toContain(\"Édition du profil patient\");\n expect(component?.shadowRoot?.querySelectorAll(\"bcbd-input\").length).toBe(10);\n expect(component?.shadowRoot?.querySelectorAll(\"bcbd-select\").length).toBe(6);\n expect(component?.shadowRoot?.querySelectorAll(\"bcbd-checkbox\").length).toBe(2);\n expect(component?.shadowRoot?.querySelectorAll(\".claudebernard-edition-modal-subtitle\")?.[0]?.textContent).toContain(\"Insuffisance rénale\");\n expect(component?.shadowRoot?.querySelectorAll(\".claudebernard-edition-modal-subtitle\")?.[1]?.textContent).toContain(\"Insuffisance hépatique\");\n const saveButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\");\n const cancelButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"cancel-button\\\"]\");\n\n expect(saveButton).not.toBeNull();\n expect(cancelButton).not.toBeNull();\n });\n\n // eslint-disable-next-line complexity\n await step(\"Verify all the patient information is here\", () => {\n const nameSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"name-select\\\"]\") as HTMLElement | null;\n expect(nameSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Marie Dupont\");\n\n const sexSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"sex-select\\\"]\") as HTMLElement | null;\n expect(sexSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Féminin\");\n\n const sizeInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"size-input\\\"]\") as HTMLElement | null;\n expect(sizeInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"170\");\n\n const ageInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"age-input\\\"]\") as HTMLElement | null;\n expect(ageInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"42\");\n\n const ageUnitSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"age-unit-select\\\"]\") as HTMLElement | null;\n expect(ageUnitSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Ans\");\n\n const weightInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"weight-input\\\"]\") as HTMLElement | null;\n expect(weightInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"84\");\n\n const pregnancyCheckbox = component?.shadowRoot?.querySelector(\"bcbd-checkbox[data-test-id=\\\"pregnancy-checkbox\\\"]\") as HTMLElement | null;\n expect(pregnancyCheckbox?.shadowRoot?.querySelector(\"input\")?.checked).toBe(true);\n\n const gestationalInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"gestational-input\\\"]\") as HTMLElement | null;\n expect(gestationalInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"20\");\n\n const breastfeedingCheckbox = component?.shadowRoot\n ?.querySelector(\"bcbd-checkbox[data-test-id=\\\"breastfeeding-checkbox\\\"]\") as HTMLElement | null;\n expect(breastfeedingCheckbox?.shadowRoot?.querySelector(\"input\")?.checked).toBe(true);\n\n const pathologiesSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"pathologies-select\\\"]\") as HTMLElement | null;\n const pathologiesValues = pathologiesSelect?.shadowRoot?.querySelectorAll(\"bcbd-badge\");\n expect(pathologiesValues?.length).toBe(4);\n expect(pathologiesValues?.[0]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance hépatique\");\n expect(pathologiesValues?.[1]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance rénale aigüe\");\n expect(pathologiesValues?.[2]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance hépatique modérée\");\n expect(pathologiesValues?.[3]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Insuffisance cardiaque\");\n\n const allergiesSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"allergies-select\\\"]\") as HTMLElement | null;\n const allergiesValues = allergiesSelect?.shadowRoot?.querySelectorAll(\"bcbd-badge\");\n expect(allergiesValues?.length).toBe(1);\n expect(allergiesValues?.[0]?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Allergie au paracétamol\");\n\n const creatinineByUmolInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"creatinine-umol-input\\\"]\") as HTMLElement | null;\n expect(creatinineByUmolInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"121\");\n\n const creatinineBymglInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"creatinine-mgl-input\\\"]\") as HTMLElement | null;\n expect(creatinineBymglInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"14\");\n\n const clearanceInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"clearance-input\\\"]\") as HTMLElement | null;\n expect(clearanceInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"71\");\n\n const dfgInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"dfg-input\\\"]\") as HTMLElement | null;\n expect(dfgInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"45\");\n\n const hepaticStadeSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"hepatic-stade-select\\\"]\") as HTMLElement | null;\n expect(hepaticStadeSelect?.shadowRoot?.querySelector(\"span\")).toHaveTextContent(\"Stade B\");\n\n const hepaticScoreInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"hepatic-score-input\\\"]\") as HTMLElement | null;\n expect(hepaticScoreInput?.shadowRoot?.querySelector(\"input\")?.value).toBe(\"7\");\n });\n\n await step(\"Verify if error message goes well displayed on size input\", async() => {\n const sizeInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"size-input\\\"]\") as HTMLElement;\n const validateButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\") as HTMLElement;\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n const sizeInputField = sizeInput?.shadowRoot?.querySelector(\"input\") as HTMLInputElement;\n //Test invalid size\n sizeInputField.value = \"0\";\n sizeInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"La taille n'est pas valide\");\n\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n\n sizeInputField.value = \"400\";\n sizeInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"La taille n'est pas valide\");\n expect(validateButton.getAttribute(\"disabled\")).not.toBe(null);\n\n //Test valid size\n sizeInputField.value = \"170\";\n sizeInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(sizeInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n });\n\n await step(\"Verify if error message goes well displayed on age input\", async() => {\n const ageInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"age-input\\\"]\") as HTMLElement;\n const validateButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\") as HTMLElement;\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n const ageInputField = ageInput?.shadowRoot?.querySelector(\"input\") as HTMLInputElement;\n //Test invalid age\n ageInputField.value = \"1\";\n ageInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"L'âge doit être exprimé en mois si inférieur à 2 ans\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).not.toBe(null);\n\n ageInputField.value = \"300\";\n ageInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"L'âge ne doit pas dépasser 150 ans\");\n\n //Test valid age\n ageInputField.value = \"41\";\n ageInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n\n //Change unit to months and test invalid age\n const ageUnitSelect = component?.shadowRoot?.querySelector(\"bcbd-select[data-test-id=\\\"age-unit-select\\\"]\") as HTMLElement;\n expect(ageUnitSelect).not.toBeNull();\n ageUnitSelect!.click();\n let shadowRoot = (ageUnitSelect as any).shadowRoot as ShadowRoot;\n expect(shadowRoot).not.toBeNull();\n const optionMois = shadowRoot.querySelector<HTMLElement>(\"div[data-test-id=\\\"select-option-mois\\\"]\") as HTMLElement;\n optionMois.click();\n\n expect(ageInput?.getAttribute(\"warning-msg\")).toBe(\"L'âge en mois ne doit pas dépasser 23 mois, veuillez compter en années\");\n\n //Go back like initial state\n ageUnitSelect.click();\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n shadowRoot = (ageUnitSelect as any).shadowRoot as ShadowRoot;\n const optionAns = shadowRoot.querySelector<HTMLElement>(\"div[data-test-id=\\\"select-option-ans\\\"]\") as HTMLElement;\n optionAns.click();\n });\n\n await step(\"Verify if error message goes well displayed on weight input\", async() => {\n const weightInput = component?.shadowRoot?.querySelector(\"bcbd-input[data-test-id=\\\"weight-input\\\"]\") as HTMLElement;\n const validateButton = component?.shadowRoot?.querySelector(\"bcbd-button[data-test-id=\\\"save-button\\\"]\") as HTMLElement;\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n expect(weightInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n const weightInputField = weightInput?.shadowRoot?.querySelector(\"input\") as HTMLInputElement;\n //Test invalid weight\n weightInputField.value = \"320\";\n weightInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(weightInput?.getAttribute(\"warning-msg\")).toBe(\"Le poids ne doit pas dépasser 300kg\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).not.toBe(null);\n\n //Test valid weight\n weightInputField.value = \"84\";\n weightInputField.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true }));\n expect(weightInput?.getAttribute(\"warning-msg\")).toBe(\"\");\n await new Promise(requestAnimationFrame);\n await new Promise((resolve) => setTimeout(resolve, 0));\n expect(validateButton.getAttribute(\"disabled\")).toBe(null);\n });\n },\n}"
320
325
  }
321
326
  ],
322
327
  "exports": [
@@ -555,6 +560,14 @@
555
560
  },
556
561
  "default": "[]"
557
562
  },
563
+ {
564
+ "kind": "field",
565
+ "name": "imc",
566
+ "type": {
567
+ "text": "number"
568
+ },
569
+ "default": "0"
570
+ },
558
571
  {
559
572
  "kind": "field",
560
573
  "name": "sizeInput",
@@ -795,6 +808,16 @@
795
808
  }
796
809
  }
797
810
  },
811
+ {
812
+ "kind": "method",
813
+ "name": "setFormWithDFG",
814
+ "privacy": "private",
815
+ "return": {
816
+ "type": {
817
+ "text": "void"
818
+ }
819
+ }
820
+ },
798
821
  {
799
822
  "kind": "method",
800
823
  "name": "apiReturntoSelectOption",
@@ -885,6 +908,34 @@
885
908
  }
886
909
  ]
887
910
  },
911
+ {
912
+ "kind": "method",
913
+ "name": "handleHepaticStade",
914
+ "privacy": "private",
915
+ "return": {
916
+ "type": {
917
+ "text": "void"
918
+ }
919
+ },
920
+ "parameters": [
921
+ {
922
+ "name": "event",
923
+ "type": {
924
+ "text": "CustomEvent"
925
+ }
926
+ }
927
+ ]
928
+ },
929
+ {
930
+ "kind": "method",
931
+ "name": "handleHepaticScore",
932
+ "privacy": "private",
933
+ "return": {
934
+ "type": {
935
+ "text": "void"
936
+ }
937
+ }
938
+ },
888
939
  {
889
940
  "kind": "method",
890
941
  "name": "validateForm",
@@ -1232,7 +1283,7 @@
1232
1283
  "type": {
1233
1284
  "text": "Bundle"
1234
1285
  },
1235
- "default": "{\n resourceType: \"Bundle\",\n id: \"patient-complete\",\n type: \"document\",\n entry: [\n {\n resource: {\n resourceType: \"Composition\", // On a Bundle of type document, the first entry must be a Composition\n id: \"composition-complete\",\n status: \"final\",\n type: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"34133-9\",\n display: \"Summary of episode note\",\n },\n ],\n },\n subject: [{ reference: \"Patient/patient-complete\" }],\n date: \"2025-09-02\",\n title: \"Patient complete composition\",\n author: [{ reference: \"Practitioner/dr-martin\" }],\n },\n },\n {\n resource: {\n resourceType: \"Patient\",\n id: \"patient-complete\",\n gender: \"female\", // sex at birth\n birthDate: \"1984-01-01\", // birthDate used to calculate age\n name: [\n {\n family: \"Dupont\",\n given: [\"Marie\"],\n },\n ],\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-gestational-age\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"18185-9\",\n display: \"Gestational age\", // Most used Loinc code for gestational age / number of weeks of amenorrhea\n },\n ],\n text: \"Âge gestationnel\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 20,\n unit: \"weeks\",\n system: \"http://unitsofmeasure.org\",\n code: \"wk\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-creatinine-clearance\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"2164-2\",\n display: \"Creatinine renal clearance in 24 hour Urine and Serum or Plasma\", // Most used Loinc code for creatinine clearance\n },\n ],\n text: \"Clairance de la créatinine\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 60,\n unit: \"mL/min\",\n system: \"http://unitsofmeasure.org\",\n code: \"mL/min\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-creatinine\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"15051-6\",\n display: \"Creatinine [Moles/volume] in Serum or Plasma\", // LOINC code for serum creatinine in μmol/L\n },\n ],\n text: \"Créatininémie\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 141,\n unit: \"μmol/L\",\n system: \"http://unitsofmeasure.org\",\n code: \"umol/L\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-creatinine\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"2160-0\",\n display: \"Creatinine [Mass/volume] in Serum or Plasma\", // Most used Loinc code for serum creatinine\n },\n ],\n text: \"Créatininémie\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 1.6,\n unit: \"mg/dL\",\n system: \"http://unitsofmeasure.org\",\n code: \"mg/dL\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-dfg\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"48643-1\",\n // eslint-disable-next-line @stylistic/max-len\n display: \"Glomerular filtration rate [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)/1.73 sq M among black population\",\n },\n ],\n text: \"DFG\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 45,\n unit: \"mL/min/1.73.m2\",\n system: \"http://unitsofmeasure.org\",\n code: \"mL/min/1.73.m2\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-child-pugh-score\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"98152-2\",\n display: \"Total score [Child-Pugh]\",\n },\n ],\n text: \"Score total Child-Pugh\",\n },\n subject: {\n \"reference\": \"Patient/patient-complete\",\n },\n valueQuantity: {\n value: 7,\n unit: \"score\",\n system: \"http://unitsofmeasure.org\",\n code: \"{score}\",\n },\n valueCodeableConcept: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"710066005\",\n display: \"Child-Pugh score class B\",\n },\n ],\n text: \"Stade B\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-body-weight\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"29463-7\",\n display: \"Body weight\", // Most used Loinc code for body weight\n },\n ],\n text: \"Poids corporel\",\n },\n subject: {\n reference: \"Patient/patient-complete\",\n },\n valueQuantity: {\n value: 84,\n unit: \"kg\",\n system: \"http://unitsofmeasure.org\",\n code: \"kg\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-body-height\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"8302-2\",\n display: \"Body height\", // Most used Loinc code for body height\n },\n ],\n text: \"Taille corporelle\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 170,\n unit: \"cm\",\n system: \"http://unitsofmeasure.org\",\n code: \"cm\",\n },\n },\n },\n {\n resource: {\n resourceType: \"AdverseEvent\", // Resource used to specify adverse events like drug side effects the patient is experiencing\n id: \"adverseevent-amoxicillin-rash\",\n actuality: \"actual\",\n subject: { reference: \"Patient/patient-complete\" },\n status: \"unknown\",\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"271807003\",\n display: \"Rash\",\n },\n ],\n text: \"Éruption cutanée\",\n },\n suspectEntity: [ // Link to the medication request that supposedly or certainly caused the adverse event\n {\n instanceReference: {\n reference: \"MedicationRequest/req-cardensiel\",\n },\n causality: {\n assessmentMethod: {\n coding: [\n {\n system: \"http://terminology.hl7.org/CodeSystem/adverse-event-causality-assess\",\n code: \"certain\",\n display: \"Certain\",\n },\n ],\n },\n },\n },\n ],\n seriousness: {\n coding: [\n {\n system: \"http://terminology.hl7.org/CodeSystem/adverse-event-seriousness\",\n code: \"non-serious\",\n display: \"Non-serious\",\n },\n ],\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-pregnancy-status\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"82810-3\",\n display: \"Pregnancy status\", // Most used Loinc code for pregnancy status\n },\n ],\n text: \"Statut de grossesse\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueCodeableConcept: { // result of the observation meaning the patient is currently pregnant (it can also be represented more simply by a Condition resource with the same snomed code)\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"77386006\",\n display: \"Pregnant\",\n },\n ],\n text: \"Grossesse\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-breastfeeding-status\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"63895-7\",\n display: \"Breastfeeding status\", // Most used Loinc code for breastfeeding status\n },\n ],\n text: \"Statut d'allaitement\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueCodeableConcept: { // result of the observation meaning the patient is currently breastfeeding (it can also be represented more simply by a Condition resource with the same snomed code)\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"69840006\",\n display: \"Breastfeeding\",\n },\n ],\n text: \"Allaitement\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Condition\", // Resources of type Condition are used to specify pathologies\n id: \"hepatic-insufficiency\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"59927004\",\n display: \"Hepatic failure\",\n },\n ],\n text: \"Insuffisance hépatique\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"Condition\",\n id: \"cond-medical-terrain\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"723189000\",\n display: \"Insuffisance rénale aigüe\",\n },\n ],\n text: \"Insuffisance rénale aigüe\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"Condition\",\n id: \"cond-medical-terrain\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"723188000\",\n display: \"Insuffisance hépatique modérée\",\n },\n ],\n text: \"Insuffisance hépatique modérée\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"Condition\",\n id: \"cond-followed-pathology\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"84114007\",\n display: \"Insuffisance cardiaque\",\n },\n ],\n text: \"Insuffisance cardiaque\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"AllergyIntolerance\", // Resource used to specify allergies or intolerances the patient has\n id: \"allergy-paracetamol\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"293584003\",\n display: \"Allergie au paracétamol\",\n },\n ],\n text: \"Allergie au paracétamol\",\n },\n patient: { reference: \"Patient/patient-complete\" },\n },\n },\n ],\n}"
1286
+ "default": "{\n resourceType: \"Bundle\",\n id: \"patient-complete\",\n type: \"document\",\n entry: [\n {\n resource: {\n resourceType: \"Composition\", // On a Bundle of type document, the first entry must be a Composition\n id: \"composition-complete\",\n status: \"final\",\n type: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"34133-9\",\n display: \"Summary of episode note\",\n },\n ],\n },\n subject: [{ reference: \"Patient/patient-complete\" }],\n date: \"2025-09-02\",\n title: \"Patient complete composition\",\n author: [{ reference: \"Practitioner/dr-martin\" }],\n },\n },\n {\n resource: {\n resourceType: \"Patient\",\n id: \"patient-complete\",\n gender: \"female\", // sex at birth\n birthDate: \"1984-01-01\", // birthDate used to calculate age\n name: [\n {\n family: \"Dupont\",\n given: [\"Marie\"],\n },\n ],\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-gestational-age\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"18185-9\",\n display: \"Gestational age\", // Most used Loinc code for gestational age / number of weeks of amenorrhea\n },\n ],\n text: \"Âge gestationnel\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 20,\n unit: \"weeks\",\n system: \"http://unitsofmeasure.org\",\n code: \"wk\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-creatinine-clearance\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"2164-2\",\n display: \"Creatinine renal clearance in 24 hour Urine and Serum or Plasma\", // Most used Loinc code for creatinine clearance\n },\n ],\n text: \"Clairance de la créatinine\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 71,\n unit: \"mL/min\",\n system: \"http://unitsofmeasure.org\",\n code: \"mL/min\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-creatinine\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"15051-6\",\n display: \"Creatinine [Moles/volume] in Serum or Plasma\", // LOINC code for serum creatinine in μmol/L\n },\n ],\n text: \"Créatininémie\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 121,\n unit: \"μmol/L\",\n system: \"http://unitsofmeasure.org\",\n code: \"umol/L\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-creatinine\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"2160-0\",\n display: \"Creatinine [Mass/volume] in Serum or Plasma\", // Most used Loinc code for serum creatinine\n },\n ],\n text: \"Créatininémie\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 1.4,\n unit: \"mg/dL\",\n system: \"http://unitsofmeasure.org\",\n code: \"mg/dL\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-dfg\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"48642-3\",\n // eslint-disable-next-line @stylistic/max-len\n display: \"Glomerular filtration rate [Volume Rate/Area] in Serum, Plasma or Blood by Creatinine-based formula (MDRD)/1.73 sq M\",\n },\n ],\n text: \"DFG\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 45,\n unit: \"mL/min/1.73.m2\",\n system: \"http://unitsofmeasure.org\",\n code: \"mL/min/1.73.m2\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-child-pugh-score\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"98152-2\",\n display: \"Total score [Child-Pugh]\",\n },\n ],\n text: \"Score total Child-Pugh\",\n },\n subject: {\n \"reference\": \"Patient/patient-complete\",\n },\n valueQuantity: {\n value: 7,\n unit: \"score\",\n system: \"http://unitsofmeasure.org\",\n code: \"{score}\",\n },\n valueCodeableConcept: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"710066005\",\n display: \"Child-Pugh score class B\",\n },\n ],\n text: \"Stade B\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-body-weight\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"29463-7\",\n display: \"Body weight\", // Most used Loinc code for body weight\n },\n ],\n text: \"Poids corporel\",\n },\n subject: {\n reference: \"Patient/patient-complete\",\n },\n valueQuantity: {\n value: 84,\n unit: \"kg\",\n system: \"http://unitsofmeasure.org\",\n code: \"kg\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-body-height\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"8302-2\",\n display: \"Body height\", // Most used Loinc code for body height\n },\n ],\n text: \"Taille corporelle\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueQuantity: {\n value: 170,\n unit: \"cm\",\n system: \"http://unitsofmeasure.org\",\n code: \"cm\",\n },\n },\n },\n {\n resource: {\n resourceType: \"AdverseEvent\", // Resource used to specify adverse events like drug side effects the patient is experiencing\n id: \"adverseevent-amoxicillin-rash\",\n actuality: \"actual\",\n subject: { reference: \"Patient/patient-complete\" },\n status: \"unknown\",\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"271807003\",\n display: \"Rash\",\n },\n ],\n text: \"Éruption cutanée\",\n },\n suspectEntity: [ // Link to the medication request that supposedly or certainly caused the adverse event\n {\n instanceReference: {\n reference: \"MedicationRequest/req-cardensiel\",\n },\n causality: {\n assessmentMethod: {\n coding: [\n {\n system: \"http://terminology.hl7.org/CodeSystem/adverse-event-causality-assess\",\n code: \"certain\",\n display: \"Certain\",\n },\n ],\n },\n },\n },\n ],\n seriousness: {\n coding: [\n {\n system: \"http://terminology.hl7.org/CodeSystem/adverse-event-seriousness\",\n code: \"non-serious\",\n display: \"Non-serious\",\n },\n ],\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-pregnancy-status\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"82810-3\",\n display: \"Pregnancy status\", // Most used Loinc code for pregnancy status\n },\n ],\n text: \"Statut de grossesse\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueCodeableConcept: { // result of the observation meaning the patient is currently pregnant (it can also be represented more simply by a Condition resource with the same snomed code)\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"77386006\",\n display: \"Pregnant\",\n },\n ],\n text: \"Grossesse\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Observation\",\n id: \"obs-breastfeeding-status\",\n status: \"final\",\n code: {\n coding: [\n {\n system: \"http://loinc.org\",\n code: \"63895-7\",\n display: \"Breastfeeding status\", // Most used Loinc code for breastfeeding status\n },\n ],\n text: \"Statut d'allaitement\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n valueCodeableConcept: { // result of the observation meaning the patient is currently breastfeeding (it can also be represented more simply by a Condition resource with the same snomed code)\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"69840006\",\n display: \"Breastfeeding\",\n },\n ],\n text: \"Allaitement\",\n },\n },\n },\n {\n resource: {\n resourceType: \"Condition\", // Resources of type Condition are used to specify pathologies\n id: \"hepatic-insufficiency\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"59927004\",\n display: \"Hepatic failure\",\n },\n ],\n text: \"Insuffisance hépatique\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"Condition\",\n id: \"cond-medical-terrain\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"723189000\",\n display: \"Insuffisance rénale aigüe\",\n },\n ],\n text: \"Insuffisance rénale aigüe\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"Condition\",\n id: \"cond-medical-terrain\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"723188000\",\n display: \"Insuffisance hépatique modérée\",\n },\n ],\n text: \"Insuffisance hépatique modérée\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"Condition\",\n id: \"cond-followed-pathology\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/condition-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"84114007\",\n display: \"Insuffisance cardiaque\",\n },\n ],\n text: \"Insuffisance cardiaque\",\n },\n subject: { reference: \"Patient/patient-complete\" },\n },\n },\n {\n resource: {\n resourceType: \"AllergyIntolerance\", // Resource used to specify allergies or intolerances the patient has\n id: \"allergy-paracetamol\",\n clinicalStatus: { coding: [{ system: \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\", code: \"active\" }] },\n code: {\n coding: [\n {\n system: \"http://snomed.info/sct\",\n code: \"293584003\",\n display: \"Allergie au paracétamol\",\n },\n ],\n text: \"Allergie au paracétamol\",\n },\n patient: { reference: \"Patient/patient-complete\" },\n },\n },\n ],\n}"
1236
1287
  }
1237
1288
  ],
1238
1289
  "exports": [
@@ -1248,7 +1299,7 @@
1248
1299
  },
1249
1300
  {
1250
1301
  "kind": "javascript-module",
1251
- "path": "src/shared/utils/patient-fhir-utils.ts",
1302
+ "path": "src/shared/utils/formula-utils.ts",
1252
1303
  "declarations": [
1253
1304
  {
1254
1305
  "kind": "function",
@@ -1276,6 +1327,178 @@
1276
1327
  ],
1277
1328
  "description": "Calcule l'IMC à partir du poids et de la taille"
1278
1329
  },
1330
+ {
1331
+ "kind": "function",
1332
+ "name": "calculateCreatinineClearance",
1333
+ "return": {
1334
+ "type": {
1335
+ "text": ""
1336
+ }
1337
+ },
1338
+ "parameters": [
1339
+ {
1340
+ "name": "age",
1341
+ "type": {
1342
+ "text": "number"
1343
+ },
1344
+ "description": "Age du patient en années"
1345
+ },
1346
+ {
1347
+ "name": "weight",
1348
+ "type": {
1349
+ "text": "number"
1350
+ },
1351
+ "description": "Poids en kilogrammes"
1352
+ },
1353
+ {
1354
+ "name": "scrMgdl",
1355
+ "type": {
1356
+ "text": "number"
1357
+ },
1358
+ "description": "Créatinine sérique en mg/dL"
1359
+ },
1360
+ {
1361
+ "name": "isFemale",
1362
+ "type": {
1363
+ "text": "boolean"
1364
+ },
1365
+ "description": "true si le patient est une femme, false sinon"
1366
+ }
1367
+ ],
1368
+ "description": "Calcule la clairance de la créatinine selon la formule de Cockcroft-Gault"
1369
+ },
1370
+ {
1371
+ "kind": "function",
1372
+ "name": "convertCreatinineUmolToMgdL",
1373
+ "return": {
1374
+ "type": {
1375
+ "text": ""
1376
+ }
1377
+ },
1378
+ "parameters": [
1379
+ {
1380
+ "name": "creatinineUmolL",
1381
+ "type": {
1382
+ "text": "number"
1383
+ },
1384
+ "description": "Créatinine en μmol/L"
1385
+ }
1386
+ ],
1387
+ "description": "Convertit la créatinine de μmol/L en mg/dL"
1388
+ },
1389
+ {
1390
+ "kind": "function",
1391
+ "name": "convertCreatinineMgdLToUmol",
1392
+ "return": {
1393
+ "type": {
1394
+ "text": ""
1395
+ }
1396
+ },
1397
+ "parameters": [
1398
+ {
1399
+ "name": "creatinineMgdL",
1400
+ "type": {
1401
+ "text": "number"
1402
+ },
1403
+ "description": "Créatinine en mg/dL"
1404
+ }
1405
+ ],
1406
+ "description": "Convertit la créatinine de mg/dL en μmol/L"
1407
+ },
1408
+ {
1409
+ "kind": "function",
1410
+ "name": "convertCreatinineMgdLToMgL",
1411
+ "return": {
1412
+ "type": {
1413
+ "text": ""
1414
+ }
1415
+ },
1416
+ "parameters": [
1417
+ {
1418
+ "name": "creatinineMgdL",
1419
+ "type": {
1420
+ "text": "number"
1421
+ },
1422
+ "description": "Créatinine en mg/dL"
1423
+ }
1424
+ ],
1425
+ "description": "Convertit la créatinine de mg/dL en mg/L"
1426
+ },
1427
+ {
1428
+ "kind": "function",
1429
+ "name": "convertCreatinineMgLToMgdL",
1430
+ "return": {
1431
+ "type": {
1432
+ "text": ""
1433
+ }
1434
+ },
1435
+ "parameters": [
1436
+ {
1437
+ "name": "creatinineMgL",
1438
+ "type": {
1439
+ "text": "number"
1440
+ },
1441
+ "description": "Créatinine en mg/L"
1442
+ }
1443
+ ],
1444
+ "description": "Convertit la créatinine de mg/L en mg/dL"
1445
+ }
1446
+ ],
1447
+ "exports": [
1448
+ {
1449
+ "kind": "js",
1450
+ "name": "calculateBMI",
1451
+ "declaration": {
1452
+ "name": "calculateBMI",
1453
+ "module": "src/shared/utils/formula-utils.ts"
1454
+ }
1455
+ },
1456
+ {
1457
+ "kind": "js",
1458
+ "name": "calculateCreatinineClearance",
1459
+ "declaration": {
1460
+ "name": "calculateCreatinineClearance",
1461
+ "module": "src/shared/utils/formula-utils.ts"
1462
+ }
1463
+ },
1464
+ {
1465
+ "kind": "js",
1466
+ "name": "convertCreatinineUmolToMgdL",
1467
+ "declaration": {
1468
+ "name": "convertCreatinineUmolToMgdL",
1469
+ "module": "src/shared/utils/formula-utils.ts"
1470
+ }
1471
+ },
1472
+ {
1473
+ "kind": "js",
1474
+ "name": "convertCreatinineMgdLToUmol",
1475
+ "declaration": {
1476
+ "name": "convertCreatinineMgdLToUmol",
1477
+ "module": "src/shared/utils/formula-utils.ts"
1478
+ }
1479
+ },
1480
+ {
1481
+ "kind": "js",
1482
+ "name": "convertCreatinineMgdLToMgL",
1483
+ "declaration": {
1484
+ "name": "convertCreatinineMgdLToMgL",
1485
+ "module": "src/shared/utils/formula-utils.ts"
1486
+ }
1487
+ },
1488
+ {
1489
+ "kind": "js",
1490
+ "name": "convertCreatinineMgLToMgdL",
1491
+ "declaration": {
1492
+ "name": "convertCreatinineMgLToMgdL",
1493
+ "module": "src/shared/utils/formula-utils.ts"
1494
+ }
1495
+ }
1496
+ ]
1497
+ },
1498
+ {
1499
+ "kind": "javascript-module",
1500
+ "path": "src/shared/utils/patient-fhir-utils.ts",
1501
+ "declarations": [
1279
1502
  {
1280
1503
  "kind": "function",
1281
1504
  "name": "getPatientGender",
@@ -1888,6 +2111,23 @@
1888
2111
  }
1889
2112
  ]
1890
2113
  },
2114
+ {
2115
+ "kind": "function",
2116
+ "name": "deletePatientHepaticInsufficiencyStatus",
2117
+ "return": {
2118
+ "type": {
2119
+ "text": "void"
2120
+ }
2121
+ },
2122
+ "parameters": [
2123
+ {
2124
+ "name": "bundle",
2125
+ "type": {
2126
+ "text": "Bundle"
2127
+ }
2128
+ }
2129
+ ]
2130
+ },
1891
2131
  {
1892
2132
  "kind": "function",
1893
2133
  "name": "getPatientConditions",
@@ -2044,6 +2284,89 @@
2044
2284
  ],
2045
2285
  "description": "Extrait les informations démographiques complètes du patient"
2046
2286
  },
2287
+ {
2288
+ "kind": "function",
2289
+ "name": "childPughScore",
2290
+ "return": {
2291
+ "type": {
2292
+ "text": "string"
2293
+ }
2294
+ },
2295
+ "parameters": [
2296
+ {
2297
+ "name": "score",
2298
+ "type": {
2299
+ "text": "number"
2300
+ }
2301
+ }
2302
+ ]
2303
+ },
2304
+ {
2305
+ "kind": "function",
2306
+ "name": "calculateGFRFromCreatinine",
2307
+ "return": {
2308
+ "type": {
2309
+ "text": ""
2310
+ }
2311
+ },
2312
+ "parameters": [
2313
+ {
2314
+ "name": "age",
2315
+ "type": {
2316
+ "text": "number"
2317
+ },
2318
+ "description": "Âge du patient"
2319
+ },
2320
+ {
2321
+ "name": "isFemale",
2322
+ "type": {
2323
+ "text": "boolean"
2324
+ },
2325
+ "description": "Vrai si le patient est de sexe féminin, sinon faux"
2326
+ },
2327
+ {
2328
+ "name": "creatinine",
2329
+ "type": {
2330
+ "text": "number"
2331
+ },
2332
+ "description": "Créatinine sérique en"
2333
+ }
2334
+ ],
2335
+ "description": "Calcul de la DFG à partir de la créatinine, de l'âge, et du sexe en utilisant la formule MDRD"
2336
+ },
2337
+ {
2338
+ "kind": "function",
2339
+ "name": "calculateCreatinineFromGFR",
2340
+ "return": {
2341
+ "type": {
2342
+ "text": ""
2343
+ }
2344
+ },
2345
+ "parameters": [
2346
+ {
2347
+ "name": "age",
2348
+ "type": {
2349
+ "text": "number"
2350
+ },
2351
+ "description": "Âge du patient"
2352
+ },
2353
+ {
2354
+ "name": "isFemale",
2355
+ "type": {
2356
+ "text": "boolean"
2357
+ },
2358
+ "description": "Vrai si le patient est de sexe féminin, sinon faux"
2359
+ },
2360
+ {
2361
+ "name": "gfr",
2362
+ "type": {
2363
+ "text": "number"
2364
+ },
2365
+ "description": "DFG en mL/min/1.73.m2"
2366
+ }
2367
+ ],
2368
+ "description": "Calcul de la créatinine à partir de la DFG, de l'âge, et du sexe en utilisant la formule MDRD inversée"
2369
+ },
2047
2370
  {
2048
2371
  "kind": "function",
2049
2372
  "name": "getPatientMedicalInfo",
@@ -2084,14 +2407,6 @@
2084
2407
  }
2085
2408
  ],
2086
2409
  "exports": [
2087
- {
2088
- "kind": "js",
2089
- "name": "calculateBMI",
2090
- "declaration": {
2091
- "name": "calculateBMI",
2092
- "module": "src/shared/utils/patient-fhir-utils.ts"
2093
- }
2094
- },
2095
2410
  {
2096
2411
  "kind": "js",
2097
2412
  "name": "getPatientGender",
@@ -2316,6 +2631,14 @@
2316
2631
  "module": "src/shared/utils/patient-fhir-utils.ts"
2317
2632
  }
2318
2633
  },
2634
+ {
2635
+ "kind": "js",
2636
+ "name": "deletePatientHepaticInsufficiencyStatus",
2637
+ "declaration": {
2638
+ "name": "deletePatientHepaticInsufficiencyStatus",
2639
+ "module": "src/shared/utils/patient-fhir-utils.ts"
2640
+ }
2641
+ },
2319
2642
  {
2320
2643
  "kind": "js",
2321
2644
  "name": "getPatientConditions",
@@ -2380,6 +2703,30 @@
2380
2703
  "module": "src/shared/utils/patient-fhir-utils.ts"
2381
2704
  }
2382
2705
  },
2706
+ {
2707
+ "kind": "js",
2708
+ "name": "childPughScore",
2709
+ "declaration": {
2710
+ "name": "childPughScore",
2711
+ "module": "src/shared/utils/patient-fhir-utils.ts"
2712
+ }
2713
+ },
2714
+ {
2715
+ "kind": "js",
2716
+ "name": "calculateGFRFromCreatinine",
2717
+ "declaration": {
2718
+ "name": "calculateGFRFromCreatinine",
2719
+ "module": "src/shared/utils/patient-fhir-utils.ts"
2720
+ }
2721
+ },
2722
+ {
2723
+ "kind": "js",
2724
+ "name": "calculateCreatinineFromGFR",
2725
+ "declaration": {
2726
+ "name": "calculateCreatinineFromGFR",
2727
+ "module": "src/shared/utils/patient-fhir-utils.ts"
2728
+ }
2729
+ },
2383
2730
  {
2384
2731
  "kind": "js",
2385
2732
  "name": "getPatientMedicalInfo",