@claudebernard/patient-profile-element 0.8.1-beta.1 → 0.8.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.
@@ -113,42 +113,42 @@ declare global {
113
113
 
114
114
  declare global {
115
115
  interface HTMLElementTagNameMap {
116
- "bcb-patient-pathologies-form": PatientPathologiesForm;
116
+ "bcb-patient-reproductive-form": PatientReproductiveForm;
117
117
  }
118
118
  }
119
119
 
120
120
 
121
121
  declare global {
122
122
  interface HTMLElementTagNameMap {
123
- "bcb-patient-allergies-form": PatientAllergiesForm;
123
+ "bcb-patient-demographics-form": PatientDemographicsForm;
124
124
  }
125
125
  }
126
126
 
127
127
 
128
128
  declare global {
129
129
  interface HTMLElementTagNameMap {
130
- "bcb-patient-demographics-form": PatientDemographicsForm;
130
+ "bcb-patient-pathologies-form": PatientPathologiesForm;
131
131
  }
132
132
  }
133
133
 
134
134
 
135
135
  declare global {
136
136
  interface HTMLElementTagNameMap {
137
- "bcb-patient-renal-form": PatientRenalForm;
137
+ "bcb-patient-allergies-form": PatientAllergiesForm;
138
138
  }
139
139
  }
140
140
 
141
141
 
142
142
  declare global {
143
143
  interface HTMLElementTagNameMap {
144
- "bcb-patient-hepatic-form": PatientHepaticForm;
144
+ "bcb-patient-renal-form": PatientRenalForm;
145
145
  }
146
146
  }
147
147
 
148
148
 
149
149
  declare global {
150
150
  interface HTMLElementTagNameMap {
151
- "bcb-patient-reproductive-form": PatientReproductiveForm;
151
+ "bcb-patient-hepatic-form": PatientHepaticForm;
152
152
  }
153
153
  }
154
154
 
@@ -399,6 +399,9 @@ function setPatientAmenorrheaStatus(bundle, weeks) {
399
399
  false
400
400
  );
401
401
  }
402
+ function deletePatientAmenorrheaStatus(bundle) {
403
+ removeObservationByCode(bundle, AMENORRHEA_LOINC_CODE);
404
+ }
402
405
  const BREASTFEEDING_LOINC_CODE = "63895-7";
403
406
  const BREASTFEEDING_SNOMED_CODE = "69840006";
404
407
  function getPatientBreastfeedingStatus(bundle) {
@@ -1714,7 +1717,7 @@ let PatientReproductiveForm = class extends i$2 {
1714
1717
  this.visible = false;
1715
1718
  this.isPregnant = false;
1716
1719
  this.breastfeeding = false;
1717
- this._amenorrheaWeeks = 0;
1720
+ this._amenorrheaWeeks = "";
1718
1721
  this._amenorrheaDate = "";
1719
1722
  }
1720
1723
  updated(changedProperties) {
@@ -1723,8 +1726,8 @@ let PatientReproductiveForm = class extends i$2 {
1723
1726
  }
1724
1727
  this.breastfeeding = getPatientBreastfeedingStatus(this.patientProfile);
1725
1728
  this.isPregnant = getPatientPregnancyStatus(this.patientProfile);
1726
- this._amenorrheaWeeks = getPatientAmenorrheaStatus(this.patientProfile) ?? 0;
1727
- this._amenorrheaDate = this.calculateAmenorrheaDate(this._amenorrheaWeeks);
1729
+ this._amenorrheaWeeks = getPatientAmenorrheaStatus(this.patientProfile) ?? "";
1730
+ this._amenorrheaDate = this._amenorrheaWeeks === "" ? "" : this.calculateAmenorrheaDate(this._amenorrheaWeeks);
1728
1731
  this.updateGestationalWeeksWarning(this._amenorrheaWeeks);
1729
1732
  }
1730
1733
  handlePregnancy(event) {
@@ -1763,12 +1766,13 @@ let PatientReproductiveForm = class extends i$2 {
1763
1766
  }
1764
1767
  getValue() {
1765
1768
  if (!this.visible) {
1766
- return { isPregnant: false, breastfeeding: false, gestationalWeeks: 0 };
1769
+ return { isPregnant: false, breastfeeding: false, gestationalWeeks: void 0 };
1767
1770
  }
1771
+ const weeksValue = this.gestationalWeeksInput?.value ?? "";
1768
1772
  return {
1769
1773
  isPregnant: this.isPregnant,
1770
1774
  breastfeeding: this.breastfeeding,
1771
- gestationalWeeks: Number(this.gestationalWeeksInput?.value ?? "")
1775
+ gestationalWeeks: weeksValue === "" ? void 0 : Number(weeksValue)
1772
1776
  };
1773
1777
  }
1774
1778
  render() {
@@ -1784,7 +1788,7 @@ let PatientReproductiveForm = class extends i$2 {
1784
1788
  <div class="${PREFIX}-edition-modal-pregnant-div__inputs">
1785
1789
  <div class="${PREFIX}-edition-modal-pregnant-div-section">
1786
1790
  <span>Date de l'aménorrhée</span>
1787
- <bcbd-input data-test-id="amenorrhea-date-input" id="amenorrheaDateInput" type="date" .value=${this._amenorrheaDate} aria-label="Date de l'aménorrhée" warning-msg="" @change=${this.handleAmenorrheaDateInputChange}></bcbd-input>
1791
+ <bcbd-input data-test-id="amenorrhea-date-input" id="amenorrheaDateInput" type="date" .value=${this._amenorrheaDate} aria-label="Date de l'aménorrhée" warning-msg="" date-picker-placement="bottom" @change=${this.handleAmenorrheaDateInputChange}></bcbd-input>
1788
1792
  </div>
1789
1793
  <div class="${PREFIX}-edition-modal-pregnant-div-section ${PREFIX}-edition-modal-pregnant-div__gestational">
1790
1794
  <span>Nombre de semaines d'aménorrhée</span>
@@ -3974,8 +3978,10 @@ let PatientProfileEdition = class extends i$2 {
3974
3978
  } else {
3975
3979
  deletePatientHepaticInsufficiencyStatus(this.patientProfile);
3976
3980
  }
3977
- if (reproductive.isPregnant) {
3978
- setPatientAmenorrheaStatus(this.patientProfile, isNaN(reproductive.gestationalWeeks) ? 0 : reproductive.gestationalWeeks);
3981
+ if (reproductive.isPregnant && reproductive.gestationalWeeks !== void 0 && !isNaN(reproductive.gestationalWeeks)) {
3982
+ setPatientAmenorrheaStatus(this.patientProfile, reproductive.gestationalWeeks);
3983
+ } else {
3984
+ deletePatientAmenorrheaStatus(this.patientProfile);
3979
3985
  }
3980
3986
  setPatientBreastfeedingStatus(this.patientProfile, reproductive.breastfeeding);
3981
3987
  setPatientPregnancyStatus(this.patientProfile, reproductive.isPregnant);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/patient-profile-element",
3
- "version": "0.8.1-beta.1",
3
+ "version": "0.8.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",