@claudebernard/patient-profile-element 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
  },
@@ -1594,18 +1594,22 @@ const ageOptions = [
1594
1594
  { value: "ans", label: "Ans" },
1595
1595
  { value: "mois", label: "Mois" }
1596
1596
  ];
1597
- const fetchPathologiesByTerm = async (term, typePathology, params, apiUrl) => {
1598
- const response = await fetch(`${apiUrl}/search/pathologies/?term=${term}&typePathology=${typePathology}`, {
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(params)
1603
+ body: JSON.stringify({
1604
+ typeEntree: type,
1605
+ valeur: value,
1606
+ patient
1607
+ })
1604
1608
  });
1605
1609
  return response.json();
1606
1610
  };
1607
- const fetchMoleculesByTerm = async (term, params, apiUrl) => {
1608
- const response = await fetch(`${apiUrl}/search/molecules/?term=${term}`, {
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 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}";
1618
- const convertRenalInsufficiency = async (type, value, patient, apiUrl) => {
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.isPregnancyDivVisible = true;
1708
+ if (this.defaultPatientSex.value !== "male") {
1709
+ this.isPregnancyDivVisible = true;
1710
+ }
1707
1711
  }
1708
1712
  this.defaultPatientUnitAge = {
1709
1713
  value: this.patientUnitAge,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/patient-profile-element",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "main": "dist/patient-profile.es.js",
5
5
  "module": "dist/patient-profile.es.js",
6
6
  "types": "dist/patient-profile.d.ts",