child-growth-standards 0.2.3 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"classify-cutoffs.d.ts","sourceRoot":"","sources":["../../src/doh/classify-cutoffs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+BF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,iBAAiB,CAqBnF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,iBAAiB,CAqBpF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,iBAAiB,CAuBpF"}
1
+ {"version":3,"file":"classify-cutoffs.d.ts","sourceRoot":"","sources":["../../src/doh/classify-cutoffs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+BF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,iBAAiB,CAsBnF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,iBAAiB,CAsBpF;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,iBAAiB,CAwBpF"}
@@ -35,7 +35,8 @@ export function classifyDohWfa(weightKg, row) {
35
35
  if (uwFrom != null && weightKg < uwFrom) {
36
36
  return withSdBand("SUW", "Severely Underweight");
37
37
  }
38
- if (uwFrom != null && uwTo != null && weightKg >= uwFrom && weightKg < uwTo) {
38
+ const uwUpper = normalFrom ?? uwTo;
39
+ if (uwFrom != null && uwUpper != null && weightKg >= uwFrom && weightKg < uwUpper) {
39
40
  return withSdBand("UW", "Underweight");
40
41
  }
41
42
  if (normalFrom != null && normalTo != null && weightKg >= normalFrom && weightKg <= normalTo) {
@@ -56,7 +57,8 @@ export function classifyDohLhfa(heightCm, row) {
56
57
  if (stFrom != null && heightCm < stFrom) {
57
58
  return withSdBand("SSt", "Severely Stunted");
58
59
  }
59
- if (stFrom != null && stTo != null && heightCm >= stFrom && heightCm < stTo) {
60
+ const stUpper = normalFrom ?? stTo;
61
+ if (stFrom != null && stUpper != null && heightCm >= stFrom && heightCm < stUpper) {
60
62
  return withSdBand("St", "Stunted");
61
63
  }
62
64
  if (normalFrom != null && normalTo != null && heightCm >= normalFrom && heightCm <= normalTo) {
@@ -79,7 +81,8 @@ export function classifyDohWflh(weightKg, row) {
79
81
  const ob = band(b, "obese");
80
82
  if (sw != null && weightKg < sw)
81
83
  return withSdBand("SW", "Severely Wasted");
82
- if (mwFrom != null && mwTo != null && weightKg >= mwFrom && weightKg < mwTo) {
84
+ const mwUpper = normalFrom ?? mwTo;
85
+ if (mwFrom != null && mwUpper != null && weightKg >= mwFrom && weightKg < mwUpper) {
83
86
  return withSdBand("MW", "Moderately Wasted");
84
87
  }
85
88
  if (normalFrom != null && normalTo != null && weightKg >= normalFrom && weightKg <= normalTo) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "child-growth-standards",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Pediatric growth — NNC (eOPT) cutoff classification and WHO LMS z-scores with nutritional status",
5
5
  "type": "module",
6
6
  "license": "MIT",