@claudebernard/patient-profile-element 0.1.3 → 0.1.4

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.
@@ -73,6 +73,9 @@ const acceptedLoincCodesForRenalGFRPerBSA = [
73
73
  "102097-3"
74
74
  ];
75
75
  function calculateBMI(weight, height) {
76
+ if (height === 0 || weight === 0) {
77
+ return 0;
78
+ }
76
79
  const heightInMeters = height / 100;
77
80
  return Math.round(weight / (heightInMeters * heightInMeters) * 10) / 10;
78
81
  }
@@ -946,7 +949,7 @@ let PatientProfile = class extends i {
946
949
  Taille
947
950
  </div>
948
951
  <div class="${PREFIX}-patient-profile__physical-info-result">
949
- ${getPatientHeightWithUnit(this.patientProfile)}
952
+ ${getPatientHeightWithUnit(this.patientProfile) === "" ? "-" : getPatientHeightWithUnit(this.patientProfile)}
950
953
  </div>
951
954
  </div>
952
955
  <div class="${PREFIX}-patient-profile__separator">
@@ -956,7 +959,7 @@ let PatientProfile = class extends i {
956
959
  Poids
957
960
  </div>
958
961
  <div class="${PREFIX}-patient-profile__physical-info-result">
959
- ${getPatientWeightWithUnit(this.patientProfile)}
962
+ ${getPatientWeightWithUnit(this.patientProfile) === "" ? "-" : getPatientWeightWithUnit(this.patientProfile)}
960
963
  </div>
961
964
  </div>
962
965
  <div class="${PREFIX}-patient-profile__separator">
@@ -966,7 +969,7 @@ let PatientProfile = class extends i {
966
969
  IMC
967
970
  </div>
968
971
  <div class="${PREFIX}-patient-profile__physical-info-result">
969
- ${calculateBMI(getPatientWeight(this.patientProfile) ?? 0, getPatientHeight(this.patientProfile) ?? 0)}
972
+ ${calculateBMI(getPatientWeight(this.patientProfile) ?? 0, getPatientHeight(this.patientProfile) ?? 0) === 0 ? "-" : calculateBMI(getPatientWeight(this.patientProfile) ?? 0, getPatientHeight(this.patientProfile) ?? 0)}
970
973
  </div>
971
974
  </div>
972
975
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/patient-profile-element",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "main": "dist/patient-profile.es.js",
5
5
  "module": "dist/patient-profile.es.js",
6
6
  "types": "dist/patient-profile.d.ts",