This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

FHIR microdata

From HL7Wiki
Jump to navigation Jump to search
  • I assume the Master Resource Id is only interpretable in the context for a certain repository, so the id, on the fhir demoserver might be an URI like "urn:org.fhir.demorepository:people:3a654dc". If another system receives this data and decides to store the resource for itself, it will reassign the ID, and probably keep a reference to the "master" source, if applicable.

Microdata

We could put the resource definition into the formal definition using HTML5 Microdata. Currently, the HTML formatted "formal definition" of a Resource uses a flat table to express the nested elements. This makes it a bad match for Microdata, because we need to introduce the nested elements using references from the container element to the contained elements. Like so:

<table itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceDef" class="dict">
    <tr itemprop="element" itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceElementDef"
        itemref="person_definition person_cardinality person_conformance person_requirement
 person_rim-mapping person.id person.identifier">
        <td colspan=2 class="structure" itemprop="name">Person</td></tr>
    <tr><td>Definition</td><td itemprop="definition" itemid="person_definition">A person who is involved in the healthcare process</td></tr>
    <tr><td>Cardinality</td><td itemprop="cardinality" itemid="person_cardinality">1..1</td></tr>
    <tr><td>Conformance</td><td itemprop="conformance" itemid="person_conformance" value="mand">Mandatory</td></tr>
    <tr><td>Requirements</td><td itemprop="requirements" itemid="person_requirements">Need to track persons across multiple roles</td></tr>
    <tr><td>RIM Mapping</td><td itemprop="rim-mapping" itemid="person_rim-mapping">Person(classCode=PSN, determinerCode=INST)</td></tr>

    <tr itemprop="element" itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceElementDef"
        itemref="person.id_definition person.id_cardinality person.id_conformance
 person.id_elementtype person.id_rim-mapping">
        <td colspan=2 class="structure" itemprop="name">Person.id</td></tr>
    <tr><td>Definition</td><td itemprop="definition" itemid="person.id_definition">Master Resource Id, always first in all resources</td></tr>
    <tr><td>Cardinality</td><td itemprop="cardinality" itemid="person.id_cardinality">1..1</td></tr>
    <tr><td>Conformance</td><td itemprop="conformance" itemid="person.id_conformance" value="mand">Mandatory</td></tr>
    <tr><td>Type</td><td itemprop="elementtype" itemid="person.id_elementtype">id</td></tr>
    <tr><td>RIM Mapping</td><td itemprop="rim-mapping" itemid="person.id_rim-mapping">.id(scope=OBJ)</td></tr>
</table>

If we'd adapt the page's generation so that it actually nests (using invisible div's, so not visible, the whole Microdata gets much more intuitive:


<div itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceDef" class="dict">
  <!-- first of the elements in the Person resource definition -->
  <div itemprop="element" itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceElementDef">
    <table>
      <tr><td colspan=2 class="structure" itemprop="name">Person</td></tr>
      <tr><td>Definition</td><td itemprop="definition">A person who is involved in the healthcare process</td></tr>
      <tr><td>Cardinality</td><td itemprop="cardinality">1..1</td></tr>
      <tr><td>Conformance</td><td itemprop="conformance" value="mand">Mandatory</td></tr>
      <tr><td>Requirements</td><td itemprop="requirements">Need to track persons across multiple roles</td></tr>
      <tr><td>RIM Mapping</td><td itemprop="rim-mapping">Person(classCode=PSN, determinerCode=INST)</td></tr>
    </table>
    
    <!-- first of the nested elements in the Person element -->
    <div itemprop="element" itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceElementDef">
      <table>  
        <td colspan=2 class="structure" itemprop="name">Person.id</td></tr>
        <tr><td>Definition</td><td itemprop="definition">Master Resource Id, always first in all resources</td></tr>
        <tr><td>Cardinality</td><td itemprop="cardinality">1..1</td></tr>
        <tr><td>Conformance</td><td itemprop="conformance" value="mand">Mandatory</td></tr>
        <tr><td>Type</td><td itemprop="elementtype">id</td></tr>
        <tr><td>RIM Mapping</td><td itemprop="rim-mapping">.id(scope=OBJ)</td></tr>
      </table>
    </div>

    <!-- second nested element in Person element -->
    <div itemprop="element" itemscope itemtype="urn:hl7-org:sid/fhir/resource-definition/ResourceElementDef">
      <table>  
        <td colspan=2 class="structure" itemprop="name">Person.identifier</td></tr>
        <!-- etcetera -->
      </table>
    </div>
  </div> <!-- end of Person element of Person resource -->
</div>  <!-- end of Person resource -->