STU 3 Ballot

This page is part of the FHIR Specification (v1.6.0: STU 3 Ballot 4). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

Operation-observation-stats.xml

Raw XML (canonical form)

Operation Definition

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="Observation-stats"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
      <h2>Observation Statistics</h2>
      <p>OPERATION: Observation Statistics</p>
      <div>
        <p>The Statistics operation performs a set of statistical calculations on a set of clinical
           measurements such as a blood pressure.  This operation is limited to 
          <a href="observation.html">Observation</a> resources with valueQuantity elements.
        </p>

        <p>The set of Observations is defined by a the input parameters 
          <code>patient</code>,
          <code>code</code> and 
          <code>duration</code> and 
          <code>params</code>. The set of statistical calculation depends upon the value of the 
          <code>params</code> parameter:
        </p>

        <ul>

          <li>
            <strong>average</strong> - for example if code = 55284-4 the mean of 55284-4 over the stated period from an operation
          </li>

          <li>
            <strong>max</strong> - for example if code = 55284-4 the max of 55284-4 over the stated period from an operation
          </li>

          <li>
            <strong>min</strong> - for example if code = 55284-4 the min of 55284-4 over the stated period from an operation
          </li>

          <li>
            <strong>count</strong> - for example if code = 55284-4 the number of occurances of value x of 55284-4 over the
             stated period from an operation
          </li>

        </ul>

        <p>If successful, the operation returns an Observation resource with the results of the statistical
           calculations as component value pairs where the component code = the params code. The
           Observation also contains the the input parameters 
          <code>patient</code>,
          <code>code</code> and 
          <code>duration</code> parameters. If unsuccessful, an 
          <a href="operationoutcome.html">OperationOutcome</a> with an error message will be returned.
        </p>

      </div>
      <p>URL: [base]/Observation/$stats</p>
      <p>URL: [base]/Observation/[id]/$stats</p>
      <p>Parameters</p>
      <table class="grid">
        <tr>
          <td>
            <b>Use</b>
          </td>
          <td>
            <b>Name</b>
          </td>
          <td>
            <b>Cardinality</b>
          </td>
          <td>
            <b>Type</b>
          </td>
          <td>
            <b>Binding</b>
          </td>
          <td>
            <b>Documentation</b>
          </td>
        </tr>
        <tr>
          <td>IN</td>
          <td>patient</td>
          <td>1..1</td>
          <td>id</td>
          <td/>
          <td>
            <div>
              <p>The FHIR Patient resource id of the relevant Observations. For example  The patient id
                  = &quot;123&quot;  in Observation.subject.reference = Patient/123.</p>

            </div>
          </td>
        </tr>
        <tr>
          <td>IN</td>
          <td>code</td>
          <td>1..1</td>
          <td>string</td>
          <td/>
          <td>
            <div>
              <p>The test code upon which the statistics are being performed.   For example, the code 
                 = &quot;45667-2&quot;  will evaluate all relevant Observations with this code in Observation.code.</p>

            </div>
          </td>
        </tr>
        <tr>
          <td>IN</td>
          <td>duration</td>
          <td>1..1</td>
          <td>decimal</td>
          <td/>
          <td>
            <div>
              <p>The time period of interest given as hours.  For example, the duration = &quot;1&quot;
                 is the last hour</p>

            </div>
          </td>
        </tr>
        <tr>
          <td>IN</td>
          <td>params</td>
          <td>1..4</td>
          <td>code</td>
          <td/>
          <td>
            <div>
              <p>average|max|min|count  The statistical operations to be performed on the relevant operations.
                   These codes are defined 
                <a href="todo.html">here</a>
              </p>

            </div>
          </td>
        </tr>
        <tr>
          <td>OUT</td>
          <td>obs</td>
          <td>1..2</td>
          <td>Observation</td>
          <td/>
          <td>
            <div>
              <p>The Observation.component.code is relative to the Observation.code and cannot be interpreted
                 independently.  The code input parameter is returned as the code element. The 'patient'
                 parameter is returned as the patient element.  The 
                <code>period</code> input parameter is returned as the appliesPeriod element.  The status is fixed to 
                <code>final</code>.
              </p>

            </div>
          </td>
        </tr>
      </table>
    </div>
  </text>
  <url value="http://hl7.org/fhir/OperationDefinition/Observation-stats"/>
  <name value="Observation Statistics"/>
  <status value="draft"/>
  <kind value="operation"/>
  <date value="2016-08-11T17:02:54+10:00"/>
  <publisher value="HL7 (FHIR Project)"/>
  <contact>
    <telecom>
      <system value="other"/>
      <value value="http://hl7.org/fhir"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="fhir@lists.hl7.org"/>
    </telecom>
  </contact>
  <description value="The Statistics operation performs a set of statistical calculations on a set of clinical
   measurements such as a blood pressure.  This operation is limited to [Observation](observation.html)
   resources with valueQuantity elements.  The set of Observations is defined by a the input
   parameters `patient`,`code` and `duration` and `params`. The set of statistical calculation
   depends upon the value of the `params` parameter:  - **average** - for example if code
   = 55284-4 the mean of 55284-4 over the stated period from an operation - **max** - for
   example if code = 55284-4 the max of 55284-4 over the stated period from an operation
   - **min** - for example if code = 55284-4 the min of 55284-4 over the stated period from
   an operation - **count** - for example if code = 55284-4 the number of occurances of value
   x of 55284-4 over the stated period from an operation  If successful, the operation returns
   an Observation resource with the results of the statistical calculations as component
   value pairs where the component code = the params code. The Observation also contains
   the the input parameters `patient`,`code` and `duration` parameters. If unsuccessful,
   an [OperationOutcome](operationoutcome.html) with an error message will be returned."/>
  <code value="stats"/>
  <system value="false"/>
  <type value="Observation"/>
  <instance value="true"/>
  <parameter>
    <name value="patient"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="The FHIR Patient resource id of the relevant Observations. For example  The patient id
      = &quot;123&quot;  in Observation.subject.reference = Patient/123."/>
    <type value="id"/>
  </parameter>
  <parameter>
    <name value="code"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="The test code upon which the statistics are being performed.   For example, the code 
     = &quot;45667-2&quot;  will evaluate all relevant Observations with this code in Observation.code."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="duration"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="The time period of interest given as hours.  For example, the duration = &quot;1&quot;
     is the last hour"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="params"/>
    <use value="in"/>
    <min value="1"/>
    <max value="4"/>
    <documentation value="average|max|min|count  The statistical operations to be performed on the relevant operations.
       These codes are defined [here](todo.html)"/>
    <type value="code"/>
  </parameter>
  <parameter>
    <name value="obs"/>
    <use value="out"/>
    <min value="1"/>
    <max value="2"/>
    <documentation value="The Observation.component.code is relative to the Observation.code and cannot be interpreted
     independently.  The code input parameter is returned as the code element. The 'patient'
     parameter is returned as the patient element.  The `period` input parameter is returned
     as the appliesPeriod element.  The status is fixed to `final`."/>
    <type value="Observation"/>
  </parameter>
</OperationDefinition>

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.