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

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="resolve-psgc"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: DefinicionDeOperacion resolve-psgc</b></p><a name="resolve-psgc"> </a><a name="hcresolve-psgc"> </a><p>URL: [base]/Location/$resolve-psgc</p><h3>Parameters</h3><table class="grid"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</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>lat</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#decimal">decimal</a></td><td/><td><div><p>Latitude (WGS84)</p>
</div></td></tr><tr><td>IN</td><td>lon</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#decimal">decimal</a></td><td/><td><div><p>Longitude (WGS84)</p>
</div></td></tr><tr><td>OUT</td><td>code</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Resolved PSGC code (most specific level found)</p>
</div></td></tr><tr><td>OUT</td><td>hierarchy</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Full hierarchy path from region to resolved level</p>
</div></td></tr></table></div>
  </text>
  <url value="https://australian-e-health-research-centre.gitlab.io/psgc-fhir-ig/OperationDefinition/resolve-psgc"/>
  <version value="0.1.0"/>
  <name value="ResolvePSGC"/>
  <title value="Resolve PSGC from Coordinates"/>
  <status value="draft"/>
  <kind value="operation"/>
  <date value="2026-06-23T13:03:53+00:00"/>
  <publisher value="CSIRO Australian e-Health Research Centre"/>
  <contact>
    <name value="CSIRO Australian e-Health Research Centre"/>
    <telecom>
      <system value="url"/>
      <value value="https://aehrc.csiro.au"/>
    </telecom>
  </contact>
  <description value="Reverse geocoding: resolve latitude/longitude to the PSGC code hierarchy via point-in-polygon spatial query."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="PH"/>
      <display value="Philippines"/>
    </coding>
  </jurisdiction>
  <code value="resolve-psgc"/>
  <resource value="Location"/>
  <system value="false"/>
  <type value="true"/>
  <instance value="false"/>
  <parameter>
    <name value="lat"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Latitude (WGS84)"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="lon"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Longitude (WGS84)"/>
    <type value="decimal"/>
  </parameter>
  <parameter>
    <name value="code"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Resolved PSGC code (most specific level found)"/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="hierarchy"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Full hierarchy path from region to resolved level"/>
    <type value="Coding"/>
  </parameter>
</OperationDefinition>