<?xml version="1.0" encoding="UTF-8"?>

<et:ViewDefinition xmlns="http://hl7.org/fhir" xmlns:et="https://sql-on-fhir.org/ig/StructureDefinition">
  <name value="Location"/>
  <status value="draft"/>
  <description value="Vue se rapprochant de la table OMOP location"/>
  <resource value="Patient"/>
  <select>
    <column>
      <path value="id"/>
      <name value="location_id"/>
    </column>
    <column>
      <path value="id"/>
      <name value="person_id"/>
    </column>
    <column>
      <path value="address.first().extension.where(url='http://hl7.org/fhir/StructureDefinition/geolocation').first().extension.where(url='latitude').first().valueDecimal"/>
      <name value="latitude"/>
    </column>
    <column>
      <path value="address.first().extension.where(url='http://hl7.org/fhir/StructureDefinition/geolocation').first().extension.where(url='longitude').first().valueDecimal"/>
      <name value="longitude"/>
    </column>
  </select>
</et:ViewDefinition>