Indivo Document Schema: LabΒΆ

Lab models a set of lab tests.

See also the schema for Indivo Coded Values, Indivo Data Values Schema, and Indivo Provider Schema.

Schema:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://indivo.org/vocab/xml/documents#"
           xmlns:indivo="http://indivo.org/vocab/xml/documents#"
           elementFormDefault="qualified">

  <xs:include schemaLocation="codes.xsd" />
  <xs:include schemaLocation="provider.xsd" />
  <xs:include schemaLocation="values.xsd" />
 

  <!-- the base type for a lab test -->
  <xs:complexType name="LabTest">
    <xs:sequence>
      <xs:element name="dateMeasured" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
      
      <!-- e.g. "hematocrit" -->
      <xs:element name="name" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />

      <!-- either preliminary, or final -->
      <xs:element name="final" type="xs:boolean" minOccurs="1" maxOccurs="1" />
    </xs:sequence>  
  </xs:complexType>


  <!-- a type to represent a single-value lab test -->
  <xs:complexType name="SingleResultLabTest">
    <xs:complexContent>
      <xs:extension base="indivo:LabTest">
        <xs:sequence>
          <!-- an abstract type, which will be subtyped in instance documents -->
          <xs:element name="result" type="indivo:Result" minOccurs="1" maxOccurs="1" />   
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- a type to represent a single MIC lab test -->
  <xs:complexType name="MicroWithCultureLabTest">
    <xs:complexContent>
      <xs:extension base="indivo:LabTest">
        <xs:sequence>
          
          <xs:element name="source" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />

          <!-- a bunch of observations -->
          <xs:element name="observation" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="time" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
                <xs:element name="microbialDensity" type="indivo:Concentration" minOccurs="0" maxOccurs="1" />
                <xs:element name="organism" type="indivo:CodedValue" minOccurs="0" maxOccurs="1" />
                
                <xs:element name="extendedDescription" type="xs:string" minOccurs="0" maxOccurs="1" />
                
                <!-- aerobic, anaerobic, not specified, or not cultured altogether -->
                <xs:element name="cultureCondition" type="xs:string" minOccurs="0" maxOccurs="1" />
                <xs:element name="gram" type="xs:boolean" minOccurs="0" maxOccurs="1" />
                <xs:element name="morphology" type="xs:string" minOccurs="0" maxOccurs="1" />
                <xs:element name="organization" type="xs:string" minOccurs="0" maxOccurs="1" />
                
                <xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
              </xs:sequence>

              <!-- an isolate is a group of organisms that look similar, while an identity is a clear identified microorg -->
              <xs:attribute name="isolate" type="xs:string" use="required" />         
              <xs:attribute name="identity" type="xs:string" use="optional" />

            </xs:complexType>
          </xs:element>

          <!-- a bunch of results (could be more than one if more than one bug -->
          <xs:element name="result" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="organism" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
                <xs:element name="sensitivity" minOccurs="0" maxOccurs="unbounded">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="antibiotic" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
                      
                      <xs:element name="MIC" type="indivo:Concentration" minOccurs="0" maxOccurs="1" />
                      
                      <!-- coded value for resistant/intermediate/not resistant -->
                      <xs:element name="interpretation" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />

                      <!-- more info -->
                      <xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>

                <xs:element name="interpretation" type="xs:string" minOccurs="0" maxOccurs="1" />
                
                <!-- additional comments that are not directly interpretation -->
                <xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />

              </xs:sequence>
              <xs:attribute name="isolate" type="xs:string" use="required" />
              <xs:attribute name="identity" type="xs:string" use="optional" />
            </xs:complexType>
          </xs:element>


        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>


  <!-- a type to represent a panel of tests -->
  <xs:complexType name="LabPanel">
    <xs:sequence>
      <!-- e.g. CBC -->
      <xs:element name="name" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
      
      <!-- for now, no subpanels, but we could do it if we wanted to with a self-reference -->

      <!-- a bunch of lab tests -->
      <xs:element name="labTest" type="indivo:LabTest" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="Lab">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="dateMeasured" type="xs:dateTime" minOccurs="1" maxOccurs="1" />

        <!-- e.g. "hematology" -->
        <xs:element name="labType" type="xs:string" minOccurs="1" maxOccurs="1" />

        <!-- the lab provider -->
        <xs:element name="laboratory" type="indivo:LabProvider" minOccurs="0" maxOccurs="1" />

        <!-- a bunch of panels -->
        <xs:element name="labPanel" type="indivo:LabPanel" minOccurs="0" maxOccurs="unbounded" />

        <!-- a bunch of additional tests not in any panel -->
        <xs:element name="labTest" type="indivo:LabTest" minOccurs="0" maxOccurs="unbounded" />

        <xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Example:

<Lab xmlns="http://indivo.org/vocab/xml/documents#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <dateMeasured>2009-07-16T12:00:00</dateMeasured>
  <labType>hematology</labType>
  <laboratory>
    <name>Quest</name>
    <address>300 Longwood Ave, Boston MA 02215</address>
  </laboratory>

  <labPanel>
    <name type="http://codes.indivo.org/labs/panels#" abbrev="cbc" value="CBC">CBC</name>
    
    <labTest xsi:type="SingleResultLabTest">
      <dateMeasured>2009-07-16T12:23:00</dateMeasured>
      <name type="http://codes.indivo.org/labs/tests#" abbrev="Hct" value="evf" />
      <final>true</final>
      <result xsi:type="ResultInRange">
        <flag type="http://codes.indivo.org/hl7/abnormal-flags#" abbrev="A" value="abnormal" />
        <valueAndUnit>
          <value>49</value>
          <unit type="http://codes.indivo.org/units#" abbrev="%" value="percentage" />
        </valueAndUnit>
        <normalRange>
          <minimum>44</minimum>
          <maximum>48</maximum>
          <unit type="http://codes.indivo.org/units#" abbrev="%" value="percentage" />
        </normalRange>
        <nonCriticalRange>
          <minimum>42</minimum>
          <maximum>50</maximum>
          <unit type="http://codes.indivo.org/units#" abbrev="%" value="percentage" />
        </nonCriticalRange>
      </result>

    </labTest>

    <labTest xsi:type="SingleResultLabTest">
      <dateMeasured>2009-07-16T12:23:00</dateMeasured>
      <name type="http://codes.indivo.org/labs/tests#" abbrev="hiv" value="HIV" />
      <final>true</final>
      <result xsi:type="ResultInSet">
        <!-- there could be a flag here -->
        <!-- <flag type="http://codes.indivo.org/hl7/abnormal-flags#" abbrev="A" value="abnormal" /> -->
        <value>negative</value>

        <!-- these options may not be listed, given that flag may be raised -->
        <option normal="false">positive</option>
        <option normal="true">negative</option>
        <option normal="true" description="insufficient sample">inconclusive</option>
      </result>
    </labTest>
  </labPanel>

  <labTest xsi:type="SingleResultLabTest">
    <dateMeasured>2009-07-16T12:23:00</dateMeasured>
    <name type="http://codes.indivo.org/labs/tests#" abbrev="Hct" value="evf">evf</name>
    <final>true</final>
    <result xsi:type="ResultInRange">
      <flag type="http://codes.indivo.org/hl7/abnormal-flags#" abbrev="A" value="abnormal" />
      <valueAndUnit>
        <value>49</value>
        <unit type="http://codes.indivo.org/units#" abbrev="%" value="percentage">%</unit>
      </valueAndUnit>
      <normalRange>
        <minimum>44</minimum>
        <maximum>48</maximum>
        <unit type="http://codes.indivo.org/units#" abbrev="%" value="percentage" />
      </normalRange>
      <nonCriticalRange>
        <minimum>42</minimum>
        <maximum>50</maximum>
        <unit type="http://codes.indivo.org/units#" abbrev="%" value="percentage" />
      </nonCriticalRange>
    </result>
    
  </labTest>

  <comments>was looking pretty sick</comments>

</Lab>

Another example, for a microbiology lab:

<Lab xmlns="http://indivo.org/vocab/xml/documents#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <dateMeasured>2009-07-16T12:00:00</dateMeasured>
  <!-- hematology, chemistry, immunology, body fluids -->
  <labType>microbiology</labType>
  <laboratory>
    <name>Quest</name>
    <address>300 Longwood Ave, Boston MA 02215</address>
  </laboratory>
  
  <labTest xsi:type="MicroWithCultureLabTest">
    <dateMeasured>2010-06-10T12:23:00</dateMeasured>
    <name type="http://codes.indivo.org/labs/tests#" abbrev="micro" value="MicroWithCultureLabTest" />
    
    <!-- this flag means no further updates will be coming -->
    <final>true</final>
    
    <source type="http://codes.indivo.org/specimen sources#" abbrev="U FC" value="Urine - Foley Cath" />
    
    <observation  isolate="1">
      <time>2009-07-16T13:10:00</time>
      <!-- we get coded density + description OR extended description which is denorm of other fields -->
      <microbialDensity>
        <range>
          <maximum>100000</maximum>
          <unit type="http://codes.indivo.org/units#" abbrev="cfuML" value="CFU per mL" />
        </range>
      </microbialDensity>
      <!-- optional, might end up in <result> -->
      <organism type="..." abbrev=".." value="...">E. coli</organism>
      <extendedDescription>>100000  organisms/mL E. coli</extendedDescription>
      <cultureCondition>anaerobic</cultureCondition>
      <gram>false</gram>
      <morphology>rods</morphology>
    </observation>
    
    <observation  isolate="2">
      <time>2009-07-16T13:10:00</time>
      <microbialDensity>
        <value>
          <value>50000</value>
          <unit type="http://codes.indivo.org/units#" abbrev="cfuML" value="CFU per mL" />
        </value>
      </microbialDensity>
      <organism type="..." abbrev=".." value="...">Staphylococcus spp</organism>
      <extendedDescription>50000  organisms/mL Staphylococcus spp</extendedDescription>
      <cultureCondition>aerobic</cultureCondition>
      <gram>true</gram>
      <morphology>cocci</morphology>
      <!-- optional fields -->
      <organization>clusters</organization>
      <comments>....</comments>
    </observation>

    <observation  isolate="3">
      <time>2009-07-16T13:10:00</time>
      <extendedDescription>not sure what to think of this bug...</extendedDescription>
    </observation>
    
    <!-- possibility of splitting an observation of ONE isolate into multiple identities -->
    
    <!-- possibility of identify the organism BEFORE the <result> with an additional <observation> -->
    
    <!-- @identity is optional but is used when one isolate has more than one result -->
    <result isolate="1">
      <organism type="" abbrev="" value="">E. Coli</organism>
      <!-- a result for an isolate MUST have a corresponding observation with density info -->
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="AMP" value="ampicillin" />
        <MIC>
          <value>
            <value>32</value>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </value>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="resistant" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="AMPSULB" value="ampicillin/sulbactam" />
        <MIC>
          <value>
            <value>16</value>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </value>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="I" value="intermediate" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="TMPSMX" value="Trimeth/Sulf" />
        <MIC>
          <value>
            <value>1</value>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </value>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="S" value="sensitive" />
      </sensitivity>
    </result>

    <result isolate="2" identity="1">
      <organism type="" abbrev="" value="">S. aureus</organism>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="AMP" value="ampicillin" />
        <MIC>
          <range>
            <minimum>32</minimum>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </range>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="resistant" />
        <comments>be careful when treating with AMP, call lab</comments>
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="AMPSULB" value="ampicillin/sulbactam" />
        <MIC>
          <range>
            <minimum>32</minimum>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </range>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="resistant" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="OXCLN" value="Oxacillin" />
        <MIC>
          <range>
            <minimum>16</minimum>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </range>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="resistant" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="VANC" value="Vancomycin" />
        <MIC>
          <range>
            <maximum>2</maximum>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </range>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="S" value="Sensitive" />
      </sensitivity>

      <interpretation>MRSA</interpretation>
      <comments>more stuff here</comments>
    </result>
    
    <result isolate="2" identity="2">
      <organism>S. epidermidis</organism>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="AMP" value="ampicillin" />
        <MIC>
          <range>
            <maximum>2</maximum>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </range>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="S" value="Sensitive" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="AMPSULB" value="ampicillin/sulbactam" />
        <MIC>
          <range>
            <minimum>32</minimum>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </range>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="resistant" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="OXCLN" value="Oxacillin" />
        <MIC>
          <value>
            <value>16</value>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </value>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="resistant" />
      </sensitivity>
      <sensitivity>
        <antibiotic type="http://codes.indivo.org/antibiotics#" abbrev="VANC" value="Vancomycin" />
        <MIC>
          <value>
            <value>2</value>
            <unit type="http://codes.indivo.org/units#" abbrev="ugML" value="mcg per mL" />
          </value>
        </MIC>
        <interpretation type="http://codes.indivo.org/MIC interpretation#" abbrev="R" value="Resistant" />
      </sensitivity>

      <interpretation>Probable contaminant</interpretation>
    </result>

  </labTest>

</Lab>

Project Versions

Previous topic

Indivo Document Schema: Procedure

Next topic

Indivo Document Schema: Medication

This Page