WHO Clinical Care in Crisis Implementation Guide for Children - Local Development build (v0.1.0). See the Directory of published versions
Related Artifacts
depends-on | anthrobase |
depends-on | http://fhir.org/guides/who/anc-cds/Library/FHIRHelpers |
Parameters
zscore | in | | | decimal |
Age | in | | | decimal |
sex | in | | | decimal |
generateHeadCircumferenceFromAge | out | | | decimal |
generateZScoreHeadCircumferenceForAge | out | | | decimal |
ZscoreHeadCircumferenceForAgetables_s | out | | | decimal |
ZscoreHeadCircumferenceForAgetables_m | out | | | decimal |
ZscoreHeadCircumferenceForAgetables_l | out | | | decimal |
Data Requirements
Contents
text/cql
library HeadCircumferenceForAge version '1.0.4'
using FHIR version '4.0.1'
include anthrobase version '1.0.4' called base
include FHIRHelpers version '4.0.1' called FHIRHelpers
// Antrho library for HeadCircumferenceForAge Z-Score from the hcanthro files
codesystem "administrative-gender": 'http://hl7.org/fhir/administrative-gender'
//code "Female" : 'female' from "administrative-gender" display 'Female'
define HeadCircumferenceForAgeFemale:
{
{y:0.0,l:1.0,s:0.03496,m:33.8787},
{y:1.0,l:1.0,s:0.03479,m:33.975},
{y:2.0,l:1.0,s:0.03461,m:34.0714},
{y:3.0,l:1.0,s:0.03444,m:34.1677},
{y:4.0,l:1.0,s:0.03426,m:34.264},
{y:5.0,l:1.0,s:0.03409,m:34.3603},
{y:6.0,l:1.0,s:0.03391,m:34.4566},
{y:7.0,l:1.0,s:0.03374,m:34.5529},
{y:8.0,l:1.0,s:0.03356,m:34.6493},
{y:9.0,l:1.0,s:0.03339,m:34.7456},
{y:10.0,l:1.0,s:0.03321,m:34.8419},
{y:11.0,l:1.0,s:0.03304,m:34.9382},
{y:12.0,l:1.0,s:0.03286,m:35.0345},
{y:13.0,l:1.0,s:0.03269,m:35.1309},
{y:14.0,l:1.0,s:0.03251,m:35.2272},
{y:15.0,l:1.0,s:0.03248,m:35.3211},
{y:16.0,l:1.0,s:0.03245,m:35.413},
{y:17.0,l:1.0,s:0.03242,m:35.5028},
{y:18.0,l:1.0,s:0.03239,m:35.5906},
{y:19.0,l:1.0,s:0.03236,m:35.6766},
{y:20.0,l:1.0,s:0.03233,m:35.7607},
{y:21.0,l:1.0,s:0.03231,m:35.843},
{y:22.0,l:1.0,s:0.03228,m:35.9237},
{y:23.0,l:1.0,s:0.03226,m:36.0028},
{y:24.0,l:1.0,s:0.03223,m:36.0803},
{y:25.0,l:1.0,s:0.03221,m:36.1563},
{y:26.0,l:1.0,s:0.03219,m:36.2309},
{y:27.0,l:1.0,s:0.03217,m:36.3042},
{y:28.0,l:1.0,s:0.03215,m:36.3761},
{y:29.0,l:1.0,s:0.03213,m:36.4468},
{y:30.0,l:1.0,s:0.03211,m:36.5163},
{y:31.0,l:1.0,s:0.03209,m:36.5846},
{y:32.0,l:1.0,s:0.03207,m:36.6519},
{y:33.0,l:1.0,s:0.03206,m:36.718},
{y:34.0,l:1.0,s:0.03204,m:36.7831},
{y:35.0,l:1.0,s:0.03202,m:36.8472},
{y:36.0,l:1.0,s:0.032,m:36.9104},
{y:37.0,l:1.0,s:0.03199,m:36.9726},
{y:38.0,l:1.0,s:0.03197,m:37.034},
{y:39.0,l:1.0,s:0.03196,m:37.0945},
{y:40.0,l:1.0,s:0.03194,m:37.1541},
{y:41.0,l:1.0,s:0.03193,m:37.213},
{y:42.0,l:1.0,s:0.03191,m:37.2711},
{y:43.0,l:1.0,s:0.0319,m:37.3284},
{y:44.0,l:1.0,s:0.03188,m:37.3851},
{y:45.0,l:1.0,s:0.03187,m:37.4411},
{y:46.0,l:1.0,s:0.03186,m:37.4964},
{y:47.0,l:1.0,s:0.03184,m:37.551},
{y:48.0,l:1.0,s:0.03183,m:37.605},
{y:49.0,l:1.0,s:0.03182,m:37.6584},
{y:50.0,l:1.0,s:0.0318,m:37.7112},
{y:51.0,l:1.0,s:0.03179,m:37.7635},
{y:52.0,l:1.0,s:0.03178,m:37.8152},
{y:53.0,l:1.0,s:0.03177,m:37.8663},
{y:54.0,l:1.0,s:0.03176,m:37.9169},
{y:55.0,l:1.0,s:0.03174,m:37.9671},
{y:56.0,l:1.0,s:0.03173,m:38.0167},
{y:57.0,l:1.0,s:0.03172,m:38.0658},
{y:58.0,l:1.0,s:0.03171,m:38.1145},
{y:59.0,l:1.0,s:0.0317,m:38.1628},
{y:60.0,l:1.0,s:0.03169,m:38.2106},
{y:63.0,l:1.0,s:0.03166,m:38.3516},
{y:70.0,l:1.0,s:0.03158,m:38.6673},
{y:77.0,l:1.0,s:0.03152,m:38.9661},
{y:84.0,l:1.0,s:0.03146,m:39.2501},
{y:91.0,l:1.0,s:0.0314,m:39.521},
{y:98.0,l:1.0,s:0.03135,m:39.7802},
{y:105.0,l:1.0,s:0.0313,m:40.0284},
{y:112.0,l:1.0,s:0.03125,m:40.2664},
{y:119.0,l:1.0,s:0.03121,m:40.4946},
{y:126.0,l:1.0,s:0.03117,m:40.7136},
{y:133.0,l:1.0,s:0.03112,m:40.9239},
{y:140.0,l:1.0,s:0.03108,m:41.1259},
{y:147.0,l:1.0,s:0.03105,m:41.32},
{y:154.0,l:1.0,s:0.03101,m:41.5066},
{y:161.0,l:1.0,s:0.03098,m:41.6861},
{y:168.0,l:1.0,s:0.03094,m:41.8589},
{y:175.0,l:1.0,s:0.03091,m:42.0253},
{y:182.0,l:1.0,s:0.03088,m:42.1855},
{y:197.0,l:1.0,s:0.03081,m:42.5093},
{y:227.0,l:1.0,s:0.03069,m:43.0857},
{y:257.0,l:1.0,s:0.03059,m:43.5808},
{y:287.0,l:1.0,s:0.03049,m:44.0092},
{y:317.0,l:1.0,s:0.0304,m:44.3836},
{y:347.0,l:1.0,s:0.03032,m:44.7138},
{y:377.0,l:1.0,s:0.03024,m:45.0077},
{y:407.0,l:1.0,s:0.03017,m:45.2715},
{y:437.0,l:1.0,s:0.0301,m:45.5105},
{y:467.0,l:1.0,s:0.03003,m:45.729},
{y:497.0,l:1.0,s:0.02997,m:45.9305},
{y:527.0,l:1.0,s:0.02991,m:46.1184},
{y:557.0,l:1.0,s:0.02986,m:46.2951},
{y:587.0,l:1.0,s:0.0298,m:46.463},
{y:617.0,l:1.0,s:0.02975,m:46.6236},
{y:647.0,l:1.0,s:0.0297,m:46.7782},
{y:677.0,l:1.0,s:0.02966,m:46.9276},
{y:707.0,l:1.0,s:0.02961,m:47.0722},
{y:737.0,l:1.0,s:0.02957,m:47.2121},
{y:767.0,l:1.0,s:0.02952,m:47.3473},
{y:797.0,l:1.0,s:0.02948,m:47.4777},
{y:827.0,l:1.0,s:0.02944,m:47.603},
{y:857.0,l:1.0,s:0.0294,m:47.7232},
{y:887.0,l:1.0,s:0.02936,m:47.8381},
{y:917.0,l:1.0,s:0.02933,m:47.9479},
{y:947.0,l:1.0,s:0.02929,m:48.0528},
{y:977.0,l:1.0,s:0.02925,m:48.153},
{y:1007.0,l:1.0,s:0.02922,m:48.2489},
{y:1037.0,l:1.0,s:0.02919,m:48.3407},
{y:1067.0,l:1.0,s:0.02915,m:48.4288},
{y:1097.0,l:1.0,s:0.02912,m:48.5134},
{y:1127.0,l:1.0,s:0.02909,m:48.5948},
{y:1157.0,l:1.0,s:0.02906,m:48.6732},
{y:1187.0,l:1.0,s:0.02903,m:48.7487},
{y:1217.0,l:1.0,s:0.029,m:48.8216},
{y:1247.0,l:1.0,s:0.02897,m:48.8919},
{y:1277.0,l:1.0,s:0.02894,m:48.9598},
{y:1307.0,l:1.0,s:0.02891,m:49.0255},
{y:1337.0,l:1.0,s:0.02889,m:49.089},
{y:1367.0,l:1.0,s:0.02886,m:49.1506},
{y:1397.0,l:1.0,s:0.02883,m:49.2103},
{y:1427.0,l:1.0,s:0.02881,m:49.2683},
{y:1457.0,l:1.0,s:0.02878,m:49.3247},
{y:1487.0,l:1.0,s:0.02876,m:49.3797},
{y:1517.0,l:1.0,s:0.02873,m:49.4333},
{y:1547.0,l:1.0,s:0.02871,m:49.4856},
{y:1577.0,l:1.0,s:0.02868,m:49.5367},
{y:1607.0,l:1.0,s:0.02866,m:49.5868},
{y:1637.0,l:1.0,s:0.02864,m:49.6357},
{y:1667.0,l:1.0,s:0.02861,m:49.6836},
{y:1697.0,l:1.0,s:0.02859,m:49.7305},
{y:1727.0,l:1.0,s:0.02857,m:49.7765},
{y:1757.0,l:1.0,s:0.02855,m:49.8216},
{y:1787.0,l:1.0,s:0.02853,m:49.866},
{y:1817.0,l:1.0,s:0.0285,m:49.9096},
{y:1847.0,l:1.0,s:0.02848,m:49.9525}
}
define HeadCircumferenceForAgeMale:
{
{y:0.0,l:1.0,s:0.03686,m:34.4618},
{y:1.0,l:1.0,s:0.03656,m:34.562},
{y:2.0,l:1.0,s:0.03625,m:34.6622},
{y:3.0,l:1.0,s:0.03595,m:34.7625},
{y:4.0,l:1.0,s:0.03564,m:34.8627},
{y:5.0,l:1.0,s:0.03533,m:34.9629},
{y:6.0,l:1.0,s:0.03503,m:35.0631},
{y:7.0,l:1.0,s:0.03472,m:35.1634},
{y:8.0,l:1.0,s:0.03441,m:35.2636},
{y:9.0,l:1.0,s:0.03411,m:35.3638},
{y:10.0,l:1.0,s:0.0338,m:35.464},
{y:11.0,l:1.0,s:0.0335,m:35.5643},
{y:12.0,l:1.0,s:0.03319,m:35.6645},
{y:13.0,l:1.0,s:0.03288,m:35.7647},
{y:14.0,l:1.0,s:0.03258,m:35.8649},
{y:15.0,l:1.0,s:0.03248,m:35.9652},
{y:16.0,l:1.0,s:0.03239,m:36.0632},
{y:17.0,l:1.0,s:0.0323,m:36.159},
{y:18.0,l:1.0,s:0.03221,m:36.2526},
{y:19.0,l:1.0,s:0.03213,m:36.3441},
{y:20.0,l:1.0,s:0.03205,m:36.4338},
{y:21.0,l:1.0,s:0.03197,m:36.5216},
{y:22.0,l:1.0,s:0.03189,m:36.6078},
{y:23.0,l:1.0,s:0.03182,m:36.6922},
{y:24.0,l:1.0,s:0.03175,m:36.7751},
{y:25.0,l:1.0,s:0.03168,m:36.8566},
{y:26.0,l:1.0,s:0.03161,m:36.9366},
{y:27.0,l:1.0,s:0.03154,m:37.0152},
{y:28.0,l:1.0,s:0.03148,m:37.0926},
{y:29.0,l:1.0,s:0.03141,m:37.1687},
{y:30.0,l:1.0,s:0.03135,m:37.2435},
{y:31.0,l:1.0,s:0.03129,m:37.3172},
{y:32.0,l:1.0,s:0.03123,m:37.3898},
{y:33.0,l:1.0,s:0.03118,m:37.4612},
{y:34.0,l:1.0,s:0.03112,m:37.5316},
{y:35.0,l:1.0,s:0.03107,m:37.601},
{y:36.0,l:1.0,s:0.03101,m:37.6694},
{y:37.0,l:1.0,s:0.03096,m:37.7368},
{y:38.0,l:1.0,s:0.03091,m:37.8034},
{y:39.0,l:1.0,s:0.03086,m:37.869},
{y:40.0,l:1.0,s:0.03081,m:37.9338},
{y:41.0,l:1.0,s:0.03076,m:37.9978},
{y:42.0,l:1.0,s:0.03072,m:38.0609},
{y:43.0,l:1.0,s:0.03067,m:38.1233},
{y:44.0,l:1.0,s:0.03062,m:38.185},
{y:45.0,l:1.0,s:0.03058,m:38.2459},
{y:46.0,l:1.0,s:0.03054,m:38.3061},
{y:47.0,l:1.0,s:0.03049,m:38.3655},
{y:48.0,l:1.0,s:0.03045,m:38.4243},
{y:49.0,l:1.0,s:0.03041,m:38.4824},
{y:50.0,l:1.0,s:0.03037,m:38.5399},
{y:51.0,l:1.0,s:0.03033,m:38.5968},
{y:52.0,l:1.0,s:0.03029,m:38.653},
{y:53.0,l:1.0,s:0.03025,m:38.7087},
{y:54.0,l:1.0,s:0.03021,m:38.7638},
{y:55.0,l:1.0,s:0.03018,m:38.8183},
{y:56.0,l:1.0,s:0.03014,m:38.8724},
{y:57.0,l:1.0,s:0.0301,m:38.9258},
{y:58.0,l:1.0,s:0.03007,m:38.9788},
{y:59.0,l:1.0,s:0.03003,m:39.0313},
{y:60.0,l:1.0,s:0.03,m:39.0834},
{y:63.0,l:1.0,s:0.0299,m:39.2368},
{y:70.0,l:1.0,s:0.02969,m:39.5797},
{y:77.0,l:1.0,s:0.0295,m:39.9033},
{y:84.0,l:1.0,s:0.02933,m:40.2096},
{y:91.0,l:1.0,s:0.02918,m:40.5008},
{y:98.0,l:1.0,s:0.02905,m:40.7785},
{y:105.0,l:1.0,s:0.02893,m:41.0436},
{y:112.0,l:1.0,s:0.02882,m:41.297},
{y:119.0,l:1.0,s:0.02872,m:41.5394},
{y:126.0,l:1.0,s:0.02863,m:41.7715},
{y:133.0,l:1.0,s:0.02855,m:41.9939},
{y:140.0,l:1.0,s:0.02848,m:42.2071},
{y:147.0,l:1.0,s:0.02841,m:42.4115},
{y:154.0,l:1.0,s:0.02835,m:42.6076},
{y:161.0,l:1.0,s:0.0283,m:42.7957},
{y:168.0,l:1.0,s:0.02825,m:42.9762},
{y:175.0,l:1.0,s:0.02821,m:43.1495},
{y:182.0,l:1.0,s:0.02817,m:43.316},
{y:197.0,l:1.0,s:0.0281,m:43.6513},
{y:227.0,l:1.0,s:0.028,m:44.2432},
{y:257.0,l:1.0,s:0.02794,m:44.7472},
{y:287.0,l:1.0,s:0.02791,m:45.1809},
{y:317.0,l:1.0,s:0.02789,m:45.5571},
{y:347.0,l:1.0,s:0.02788,m:45.8857},
{y:377.0,l:1.0,s:0.02789,m:46.1754},
{y:407.0,l:1.0,s:0.0279,m:46.4335},
{y:437.0,l:1.0,s:0.02791,m:46.666},
{y:467.0,l:1.0,s:0.02793,m:46.8775},
{y:497.0,l:1.0,s:0.02795,m:47.0719},
{y:527.0,l:1.0,s:0.02798,m:47.2524},
{y:557.0,l:1.0,s:0.02801,m:47.4215},
{y:587.0,l:1.0,s:0.02804,m:47.5811},
{y:617.0,l:1.0,s:0.02807,m:47.7329},
{y:647.0,l:1.0,s:0.02811,m:47.8779},
{y:677.0,l:1.0,s:0.02814,m:48.017},
{y:707.0,l:1.0,s:0.02818,m:48.1505},
{y:737.0,l:1.0,s:0.02822,m:48.2789},
{y:767.0,l:1.0,s:0.02826,m:48.4023},
{y:797.0,l:1.0,s:0.0283,m:48.5207},
{y:827.0,l:1.0,s:0.02835,m:48.6344},
{y:857.0,l:1.0,s:0.02839,m:48.7434},
{y:887.0,l:1.0,s:0.02843,m:48.8478},
{y:917.0,l:1.0,s:0.02847,m:48.9478},
{y:947.0,l:1.0,s:0.02851,m:49.0435},
{y:977.0,l:1.0,s:0.02855,m:49.135},
{y:1007.0,l:1.0,s:0.02859,m:49.2226},
{y:1037.0,l:1.0,s:0.02863,m:49.3066},
{y:1067.0,l:1.0,s:0.02867,m:49.3871},
{y:1097.0,l:1.0,s:0.02871,m:49.4644},
{y:1127.0,l:1.0,s:0.02875,m:49.5387},
{y:1157.0,l:1.0,s:0.02878,m:49.6101},
{y:1187.0,l:1.0,s:0.02882,m:49.679},
{y:1217.0,l:1.0,s:0.02886,m:49.7454},
{y:1247.0,l:1.0,s:0.02889,m:49.8096},
{y:1277.0,l:1.0,s:0.02892,m:49.8717},
{y:1307.0,l:1.0,s:0.02896,m:49.9318},
{y:1337.0,l:1.0,s:0.02899,m:49.99},
{y:1367.0,l:1.0,s:0.02902,m:50.0463},
{y:1397.0,l:1.0,s:0.02905,m:50.1008},
{y:1427.0,l:1.0,s:0.02909,m:50.1536},
{y:1457.0,l:1.0,s:0.02912,m:50.2048},
{y:1487.0,l:1.0,s:0.02915,m:50.2545},
{y:1517.0,l:1.0,s:0.02918,m:50.3028},
{y:1547.0,l:1.0,s:0.0292,m:50.3497},
{y:1577.0,l:1.0,s:0.02923,m:50.3953},
{y:1607.0,l:1.0,s:0.02926,m:50.4398},
{y:1637.0,l:1.0,s:0.02929,m:50.4832},
{y:1667.0,l:1.0,s:0.02932,m:50.5255},
{y:1697.0,l:1.0,s:0.02934,m:50.567},
{y:1727.0,l:1.0,s:0.02937,m:50.6077},
{y:1757.0,l:1.0,s:0.0294,m:50.6476},
{y:1787.0,l:1.0,s:0.02942,m:50.6869},
{y:1817.0,l:1.0,s:0.02945,m:50.7257},
{y:1847.0,l:1.0,s:0.02947,m:50.7638}
}
define function ZscoreHeadCircumferenceForAgetables(sex String, age Decimal):
if sex = 'female' then
First(HeadCircumferenceForAgeFemale c where c.y = base.AgeToMini(age) )
else
First(HeadCircumferenceForAgeMale c where c.y = base.AgeToMini(age))
define function generateZScoreHeadCircumferenceForAge(sex System.String, age System.Decimal, weight System.Decimal) :
generateZScoreHeadCircumferenceForAgedet(ZscoreHeadCircumferenceForAgetables(sex,age), weight )
define function generateZScoreHeadCircumferenceForAgedet(row Tuple {y System.Decimal,l System.Decimal,s System.Decimal,m System.Decimal}, weight System.Decimal):
if row is not null then
base.computeZScore(
weight,
row.m ,
row.l ,
row.s
)
else null
define function generateHeadCircumferenceFromAge(sex System.String, age System.Decimal, zscore System.Decimal) :
generateHeadCircumferenceFromAgedet(ZscoreHeadCircumferenceForAgetables(sex,age),zscore )
define function generateHeadCircumferenceFromAgedet(row Tuple {y System.Decimal,l System.Decimal,s System.Decimal,m System.Decimal},zscore System.Decimal) :
if row is not null then
base.computeReverseZScore(
zscore,
row.m ,
row.l ,
row.s
)
else null