WHO Clinical Care in Crisis Implementation Guide for Children
0.1.0 - ci-build

WHO Clinical Care in Crisis Implementation Guide for Children - Local Development build (v0.1.0). See the Directory of published versions

: Z.Functions - XML Representation

Active as of 2023-10-04

Raw xml | Download



<Library xmlns="http://hl7.org/fhir">
  <id value="zfunctions"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><h2>Related Artifacts</h2><table class="grid"><tr><td>depends-on</td><td><code>http://fhir.org/guides/who/anc-cds/Library/FHIRHelpers</code></td></tr><tr><td>depends-on</td><td><code>https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/weightforage</code></td></tr><tr><td>depends-on</td><td><a href="Library-anthrobase.html">anthrobase</a></td></tr><tr><td>depends-on</td><td><code>https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/weightforlength</code></td></tr><tr><td>depends-on</td><td><code>https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/weightforheight</code></td></tr></table><h2>Parameters</h2><table class="grid"><tr><td>dob</td><td>in</td><td/><td/><td>date</td></tr><tr><td>dob</td><td>in</td><td/><td/><td>date</td></tr><tr><td>sex</td><td>in</td><td/><td/><td>string</td></tr><tr><td>height</td><td>in</td><td/><td/><td>decimal</td></tr><tr><td>length</td><td>in</td><td/><td/><td>decimal</td></tr><tr><td>weight</td><td>in</td><td/><td/><td>decimal</td></tr><tr><td>zscore</td><td>in</td><td/><td/><td>decimal</td></tr><tr><td>WAZ</td><td>out</td><td/><td/><td>decimal</td></tr><tr><td>WLZ</td><td>out</td><td/><td/><td>decimal</td></tr><tr><td>WHZ</td><td>out</td><td/><td/><td>decimal</td></tr><tr><td>WA</td><td>out</td><td/><td/><td>decimal</td></tr><tr><td>WL</td><td>out</td><td/><td/><td>decimal</td></tr><tr><td>WH</td><td>out</td><td/><td/><td>decimal</td></tr></table><h2>Contents</h2><p><code>text/cql</code></p><pre><code class="language-sql">/*
@author: Patrick Delcroix
@description: This library is part of the project EmCare
*/
library zfunctions version '1.0.313+build.456'
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1' called FHIRHelpers 
include WeightForAge version '1.0.4' called wfa
include WeightForLength version '1.0.4' called wfl
include WeightForHeight version '1.0.4' called wfh

parameter &quot;sex&quot; String
parameter &quot;dob&quot; Date
parameter &quot;ageindays&quot; Date
parameter &quot;height&quot; Decimal
parameter &quot;length&quot; Decimal
parameter &quot;weight&quot; Decimal
parameter &quot;zscore&quot; Decimal

context Patient

define &quot;AgeInDays&quot;:
    case
        when Patient is not null then AgeInDays()
        when  &quot;dob&quot; is not null then (difference in days between &quot;dob&quot; and Today())
        else &quot;ageindays&quot;
    end

define &quot;Sex&quot;:
    case
        when Patient is not null then Patient.gender.value
        else &quot;sex&quot;
    end

define &quot;WAZ&quot;:
    wfa.generateZScoreWeightForAge(&quot;Sex&quot;, &quot;AgeInDays&quot; , &quot;weight&quot;)

define &quot;WA&quot;:
    wfa.generateWeightFromAge(&quot;Sex&quot;, &quot;AgeInDays&quot; , &quot;zscore&quot;) 

define &quot;WLZ&quot;:
    wfl.generateZScoreWeightForLength(&quot;Sex&quot;, &quot;length&quot; , &quot;weight&quot;)

define &quot;WL&quot;:
    wfl.generateWeightFromLength(&quot;Sex&quot;, &quot;length&quot; , &quot;zscore&quot;)

define &quot;WHZ&quot;:
    wfh.generateZScoreWeightForHeight(&quot;Sex&quot;, &quot;height&quot; , &quot;weight&quot;)

define &quot;WH&quot;:
    wfh.generateWeightFromHeight(&quot;Sex&quot;, &quot;height&quot; , &quot;zscore&quot;)</code></pre></div>
  </text>
  <url
       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir//Library/zfunctions"/>
  <identifier>
    <use value="official"/>
    <value value="Zfunctions"/>
  </identifier>
  <version value="0.1.0"/>
  <name value="zfunctions"/>
  <title value="Z.Functions"/>
  <status value="active"/>
  <type>
    <coding>
      <system value="http://hl7.org/fhir/ValueSet/library-type"/>
      <code value="logic-library"/>
    </coding>
  </type>
  <date value="2023-10-04T12:32:21+00:00"/>
  <publisher value="WHO"/>
  <contact>
    <name value="WHO"/>
    <telecom>
      <system value="url"/>
      <value value="http://who.int"/>
    </telecom>
  </contact>
  <relatedArtifact>
    <type value="depends-on"/>
    <resource value="http://fhir.org/guides/who/anc-cds/Library/FHIRHelpers"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <resource
              value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/weightforage"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <resource
              value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/anthrobase"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <resource
              value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/weightforlength"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <resource
              value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/weightforheight"/>
  </relatedArtifact>
  <parameter>
    <name value="dob"/>
    <use value="in"/>
    <type value="date"/>
  </parameter>
  <parameter>
    <name value="dob"/>
    <use value="in"/>
    <type value="date"/>
  </parameter>
  <parameter>
    <name value="sex"/>
    <use value="in"/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="height"/>
    <use value="in"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="length"/>
    <use value="in"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="weight"/>
    <use value="in"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="zscore"/>
    <use value="in"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="WAZ"/>
    <use value="out"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="WLZ"/>
    <use value="out"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="WHZ"/>
    <use value="out"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="WA"/>
    <use value="out"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="WL"/>
    <use value="out"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="WH"/>
    <use value="out"/>
    <type value="decimal"/>
  </parameter>
  <content id="ig-loader-zfunctions.cql">
    <contentType value="text/cql"/>
    <data
          value="LyoKQGF1dGhvcjogUGF0cmljayBEZWxjcm9peApAZGVzY3JpcHRpb246IFRoaXMgbGlicmFyeSBpcyBwYXJ0IG9mIHRoZSBwcm9qZWN0IEVtQ2FyZQoqLwpsaWJyYXJ5IHpmdW5jdGlvbnMgdmVyc2lvbiAnMS4wLjMxMytidWlsZC40NTYnCnVzaW5nIEZISVIgdmVyc2lvbiAnNC4wLjEnCmluY2x1ZGUgRkhJUkhlbHBlcnMgdmVyc2lvbiAnNC4wLjEnIGNhbGxlZCBGSElSSGVscGVycyAKaW5jbHVkZSBXZWlnaHRGb3JBZ2UgdmVyc2lvbiAnMS4wLjQnIGNhbGxlZCB3ZmEKaW5jbHVkZSBXZWlnaHRGb3JMZW5ndGggdmVyc2lvbiAnMS4wLjQnIGNhbGxlZCB3ZmwKaW5jbHVkZSBXZWlnaHRGb3JIZWlnaHQgdmVyc2lvbiAnMS4wLjQnIGNhbGxlZCB3ZmgKCnBhcmFtZXRlciAic2V4IiBTdHJpbmcKcGFyYW1ldGVyICJkb2IiIERhdGUKcGFyYW1ldGVyICJhZ2VpbmRheXMiIERhdGUKcGFyYW1ldGVyICJoZWlnaHQiIERlY2ltYWwKcGFyYW1ldGVyICJsZW5ndGgiIERlY2ltYWwKcGFyYW1ldGVyICJ3ZWlnaHQiIERlY2ltYWwKcGFyYW1ldGVyICJ6c2NvcmUiIERlY2ltYWwKCmNvbnRleHQgUGF0aWVudAoKZGVmaW5lICJBZ2VJbkRheXMiOgogICAgY2FzZQogICAgICAgIHdoZW4gUGF0aWVudCBpcyBub3QgbnVsbCB0aGVuIEFnZUluRGF5cygpCiAgICAgICAgd2hlbiAgImRvYiIgaXMgbm90IG51bGwgdGhlbiAoZGlmZmVyZW5jZSBpbiBkYXlzIGJldHdlZ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