FQL is a query language that allows you to retrieve, filter and project data from any data source containing FHIR Resources. It brings the power of three existing languages together: SQL, JSON and FhirPath. It allows you to create tables and is useful for gaining insight and perform quality control.
<DiagnosticReport xmlns="http://hl7.org/fhir"> <id value="core-examples-DiagnosticReport-example21" /> <meta> <versionId value="3" /> <lastUpdated value="2016-09-08T12:22:26.598+00:00" /> </meta> <text> <status value="generated" /> --- We have skipped the narrative for better readability of the resource --- </text> <contained> <Observation> <id value="o1" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2951-2" /> <display value="Sodium [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="104934005" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="143" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="137" /> <unit value="mmol/L" /> </low> <high> <value value="147" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o2" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2823-3" /> <display value="Potassium [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="59573005" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="4.3" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="3.5" /> <unit value="mmol/L" /> </low> <high> <value value="5.0" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o3" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2075-0" /> <display value="Chloride [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="46511006" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="108" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="96" /> <unit value="mmol/L" /> </low> <high> <value value="109" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o4" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="1963-8" /> <display value="Bicarbonate [Moles/volume] in Serum" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="88645003" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="25" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="25" /> <unit value="mmol/L" /> </low> <high> <value value="33" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o5" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="1863-0" /> <display value="Anion gap 4 in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="271057005" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="14" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="4" /> <unit value="mmol/L" /> </low> <high> <value value="17" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o6" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14749-6" /> <display value="Glucose [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="36048009" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="4.3" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="3.0" /> <unit value="mmol/L" /> </low> <high> <value value="7.7" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o7" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14937-7" /> <display value="Urea nitrogen [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="273967009" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="4.6" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="2.0" /> <unit value="mmol/L" /> </low> <high> <value value="7.0" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o8" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14682-9" /> <display value="Creatinine [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="70901006" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="0.06" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="0.04" /> <unit value="mmol/L" /> </low> <high> <value value="0.11" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o9" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14933-6" /> <display value="Urate [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="86228006" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="0.41" /> <unit value="mmol/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="HH" /> </coding> </interpretation> <referenceRange> <low> <value value="0.14" /> <unit value="mmol/L" /> </low> <high> <value value="0.35" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o10" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14631-6" /> <display value="Bilirubin.total [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="27171005" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="27" /> <unit value="umol/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="H" /> </coding> </interpretation> <referenceRange> <low> <value value="2" /> <unit value="umol/L" /> </low> <high> <value value="20" /> <unit value="umol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o11" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="6768-6" /> <display value="Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="88810008" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="631" /> <unit value="U/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="HH" /> </coding> </interpretation> <referenceRange> <low> <value value="30" /> <unit value="U/L" /> </low> <high> <value value="115" /> <unit value="U/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o12" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2324-2" /> <display value="Gamma glutamyl transferase [Enzymatic activity/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="69480007" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="956" /> <unit value="U/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="HH" /> </coding> </interpretation> <referenceRange> <low> <value value="0" /> <unit value="U/L" /> </low> <high> <value value="45" /> <unit value="U/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o13" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="1742-6" /> <display value="Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="34608000" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="398" /> <unit value="U/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="HH" /> </coding> </interpretation> <referenceRange> <low> <value value="0" /> <unit value="U/L" /> </low> <high> <value value="45" /> <unit value="U/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o14" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="1920-8" /> <display value="Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="45896001" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="120" /> <unit value="U/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="HH" /> </coding> </interpretation> <referenceRange> <low> <value value="0" /> <unit value="U/L" /> </low> <high> <value value="41" /> <unit value="U/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o15" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2532-0" /> <display value="Lactate dehydrogenase [Enzymatic activity/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="11274001" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="243" /> <unit value="U/L" /> </valueQuantity> <referenceRange> <low> <value value="80" /> <unit value="U/L" /> </low> <high> <value value="250" /> <unit value="U/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o16" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2000-8" /> <display value="Calcium [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="71878006" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="2.33" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="2.25" /> <unit value="mmol/L" /> </low> <high> <value value="2.65" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o17" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="13959-2" /> <display value="Calcium.ionized [Moles/volume] in Serum or Plasma by calculation" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="166708003" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="2.52" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="2.25" /> <unit value="mmol/L" /> </low> <high> <value value="2.65" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o18" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14879-1" /> <display value="Phosphate [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="104866001" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="1.2" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="0.8" /> <unit value="mmol/L" /> </low> <high> <value value="1.5" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o19" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="2885-2" /> <display value="Protein [Mass/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="74040009" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="71" /> <unit value="g/L" /> </valueQuantity> <referenceRange> <low> <value value="60" /> <unit value="g/L" /> </low> <high> <value value="82" /> <unit value="g/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o20" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="1751-7" /> <display value="Albumin [Mass/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="104485008" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="36" /> <unit value="g/L" /> </valueQuantity> <referenceRange> <low> <value value="35" /> <unit value="g/L" /> </low> <high> <value value="50" /> <unit value="g/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o21" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="10834-0" /> <display value="Globulin [Mass/volume] in Serum by calculation" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="104979009" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="35" /> <unit value="g/L" /> </valueQuantity> <referenceRange> <low> <value value="20" /> <unit value="g/L" /> </low> <high> <value value="40" /> <unit value="g/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o22" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14798-3" /> <display value="Iron [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="42950004" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="39" /> <unit value="umol/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="H" /> </coding> </interpretation> <referenceRange> <low> <value value="10" /> <unit value="umol/L" /> </low> <high> <value value="33" /> <unit value="umol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o23" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14647-2" /> <display value="Cholesterol [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="77068002" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="6.8" /> <unit value="mmol/L" /> </valueQuantity> <interpretation> <coding> <system value="http://hl7.org/fhir/v2/0078" /> <code value="H" /> </coding> </interpretation> <referenceRange> <low> <value value="3.6" /> <unit value="mmol/L" /> </low> <high> <value value="6.7" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <contained> <Observation> <id value="o24" /> <status value="final" /> <code> <coding> <system value="http://loinc.org" /> <code value="14927-8" /> <display value="Triglyceride [Moles/volume] in Serum or Plasma" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="104784006" /> </coding> </code> <subject> <reference value="Patient/7" /> </subject> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <valueQuantity> <value value="1.5" /> <unit value="mmol/L" /> </valueQuantity> <referenceRange> <low> <value value="0.3" /> <unit value="mmol/L" /> </low> <high> <value value="4.0" /> <unit value="mmol/L" /> </high> </referenceRange> </Observation> </contained> <identifier> <system value="http://acme.com/lab/reports" /> <value value="5234342" /> </identifier> <status value="final" /> <code> <text value="SERUM CHEMISTRY" /> </code> <subject> <reference value="Patient/7" /> </subject> <effectiveDateTime value="2004-12-05T07:15:17Z" /> <issued value="2005-02-23T10:04:01+00:00" /> <performer> <reference value="Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" /> <display value="Acme Laboratory, Inc" /> </performer> <result> <reference value="#o1" /> </result> <result> <reference value="#o2" /> </result> <result> <reference value="#o3" /> </result> <result> <reference value="#o4" /> </result> <result> <reference value="#o5" /> </result> <result> <reference value="#o6" /> </result> <result> <reference value="#o7" /> </result> <result> <reference value="#o8" /> </result> <result> <reference value="#o9" /> </result> <result> <reference value="#o10" /> </result> <result> <reference value="#o11" /> </result> <result> <reference value="#o12" /> </result> <result> <reference value="#o13" /> </result> <result> <reference value="#o14" /> </result> <result> <reference value="#o15" /> </result> <result> <reference value="#o16" /> </result> <result> <reference value="#o17" /> </result> <result> <reference value="#o18" /> </result> <result> <reference value="#o19" /> </result> <result> <reference value="#o20" /> </result> <result> <reference value="#o21" /> </result> <result> <reference value="#o22" /> </result> <result> <reference value="#o23" /> </result> <result> <reference value="#o24" /> </result> </DiagnosticReport>