child-growth-standards 0.2.0 → 0.2.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.
- package/README.md +1 -1
- package/dist/doh/calculate-doh.d.ts +6 -0
- package/dist/doh/calculate-doh.d.ts.map +1 -1
- package/dist/doh/calculate-doh.js +9 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Use **`YYYY-MM-DD`** strings or `Date` values for birth and measurement dates (c
|
|
|
48
48
|
|
|
49
49
|
### NNC (`standard: "nnc"`)
|
|
50
50
|
|
|
51
|
-
- Age for WFA and length/height-for-age: **completed calendar months** (same idea as Excel `DATEDIF(..., "m")`)
|
|
51
|
+
- Age for WFA and length/height-for-age: **completed calendar months** (same idea as Excel `DATEDIF(..., "m")`), with tables through **71 completed months**.
|
|
52
52
|
- Weight-for-**length** applies below **24 months**; weight-for-**height** from **24 up to 59 months** (by month index at measurement).
|
|
53
53
|
- Each indicator returns **`nutritionalStatus`**, **`nutritionalStatusCode`** (e.g. SUW, UW, N, OW, SSt, St, SW, MW, Ob), and **`sdBand`**. **`zScore` is always `null`**.
|
|
54
54
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { AssessmentResult, CalculateAllInput, Sex } from "../types.js";
|
|
2
|
+
/** Last month index in bundled NNC WFA/LHFA tables (inclusive). */
|
|
3
|
+
export declare const NNC_MAX_COMPLETED_MONTH_INDEX = 71;
|
|
4
|
+
/** Exclusive upper bound for completed months when NNC age tables apply. */
|
|
5
|
+
export declare const NNC_EXCLUSIVE_MAX_COMPLETED_MONTHS = 72;
|
|
2
6
|
export declare function calculateDohAll(input: CalculateAllInput): AssessmentResult;
|
|
7
|
+
export declare function isNncGrowthAge(months: number): boolean;
|
|
8
|
+
/** @deprecated Use isNncGrowthAge — NNC WFA/LHFA tables run through 71 completed months. */
|
|
3
9
|
export declare function isDohPreschoolAge(months: number): boolean;
|
|
4
10
|
export declare function mapSex(input: string): Sex | null;
|
|
5
11
|
//# sourceMappingURL=calculate-doh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculate-doh.d.ts","sourceRoot":"","sources":["../../src/doh/calculate-doh.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAmB,GAAG,EAAE,MAAM,aAAa,CAAC;AAU7F,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAmE1E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAOhD"}
|
|
1
|
+
{"version":3,"file":"calculate-doh.d.ts","sourceRoot":"","sources":["../../src/doh/calculate-doh.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAmB,GAAG,EAAE,MAAM,aAAa,CAAC;AAU7F,mEAAmE;AACnE,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAErD,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAmE1E;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAOhD"}
|
|
@@ -3,6 +3,10 @@ import { classifyDohLhfa, classifyDohWfa, classifyDohWflh, } from "./classify-cu
|
|
|
3
3
|
import { loadDohTable, lookupDohRow, mRoundHalf } from "./load-tables.js";
|
|
4
4
|
const TWENTY_FOUR_MONTHS = 24;
|
|
5
5
|
const SIXTY_MONTHS = 60;
|
|
6
|
+
/** Last month index in bundled NNC WFA/LHFA tables (inclusive). */
|
|
7
|
+
export const NNC_MAX_COMPLETED_MONTH_INDEX = 71;
|
|
8
|
+
/** Exclusive upper bound for completed months when NNC age tables apply. */
|
|
9
|
+
export const NNC_EXCLUSIVE_MAX_COMPLETED_MONTHS = 72;
|
|
6
10
|
export function calculateDohAll(input) {
|
|
7
11
|
const dates = resolveDates(input.dateOfBirth, input.dateOfMeasurement);
|
|
8
12
|
if (!dates) {
|
|
@@ -64,8 +68,12 @@ export function calculateDohAll(input) {
|
|
|
64
68
|
results,
|
|
65
69
|
};
|
|
66
70
|
}
|
|
71
|
+
export function isNncGrowthAge(months) {
|
|
72
|
+
return months >= 0 && months < NNC_EXCLUSIVE_MAX_COMPLETED_MONTHS;
|
|
73
|
+
}
|
|
74
|
+
/** @deprecated Use isNncGrowthAge — NNC WFA/LHFA tables run through 71 completed months. */
|
|
67
75
|
export function isDohPreschoolAge(months) {
|
|
68
|
-
return months
|
|
76
|
+
return isNncGrowthAge(months);
|
|
69
77
|
}
|
|
70
78
|
export function mapSex(input) {
|
|
71
79
|
const n = String(input ?? "")
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { calculateAll, calculateZScore } from "./calculate.js";
|
|
2
2
|
export { ageInCompletedMonths, ageInDays, daysToMonths, resolveDates, toDateOnly, FIVE_YEARS_DAYS, NINETEEN_YEARS_DAYS, WHO_DAYS_PER_MONTH, } from "./age.js";
|
|
3
3
|
export { mapWhoNutritionalStatus } from "./who/nutritional-status.js";
|
|
4
|
+
export { calculateDohAll, isDohPreschoolAge, isNncGrowthAge, mapSex, NNC_EXCLUSIVE_MAX_COMPLETED_MONTHS, NNC_MAX_COMPLETED_MONTH_INDEX, } from "./doh/calculate-doh.js";
|
|
4
5
|
export { computeZScore, lookupLms, normalCdf, zScoreToPercentile } from "./lms.js";
|
|
5
6
|
export type { AssessmentResult, CalculateAllInput, CalculateZScoreInput, GrowthStandard, IndicatorResult, Sex, WhoAgeIndex, WhoNutritionalStatusReference, WhoNutritionalStatusResult, LmsRow, DohBandRow, } from "./types.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnF,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,GAAG,EACH,WAAW,EACX,6BAA6B,EAC7B,0BAA0B,EAC1B,MAAM,EACN,UAAU,GACX,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,kCAAkC,EAClC,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnF,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,GAAG,EACH,WAAW,EACX,6BAA6B,EAC7B,0BAA0B,EAC1B,MAAM,EACN,UAAU,GACX,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { calculateAll, calculateZScore } from "./calculate.js";
|
|
2
2
|
export { ageInCompletedMonths, ageInDays, daysToMonths, resolveDates, toDateOnly, FIVE_YEARS_DAYS, NINETEEN_YEARS_DAYS, WHO_DAYS_PER_MONTH, } from "./age.js";
|
|
3
3
|
export { mapWhoNutritionalStatus } from "./who/nutritional-status.js";
|
|
4
|
+
export { calculateDohAll, isDohPreschoolAge, isNncGrowthAge, mapSex, NNC_EXCLUSIVE_MAX_COMPLETED_MONTHS, NNC_MAX_COMPLETED_MONTH_INDEX, } from "./doh/calculate-doh.js";
|
|
4
5
|
export { computeZScore, lookupLms, normalCdf, zScoreToPercentile } from "./lms.js";
|