@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sct: <http://snomed.info/id/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

[a fhir:DocumentReference;
  fhir:nodeRole fhir:treeRoot;
  fhir:Resource.id [ fhir:value "1.2.840.11361907579238403408700.3.1.04.19970327150033"]; # 
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ];
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n      Ultrasound Image on patient &quot;James Chalmers&quot;:<br/>\n      <img src=\"http://imaging.acme.com/wado/server?requestType=WADO&amp;contentType=application%2Fdicom&amp;studyUid=1.2.840.113619.2.21.848.34082.0.538976288.3&amp;seriesUid=1.2.840.113619.2.21.3408.700.0.757923840.3.0&amp;objectUid=1.2.840.11361907579238403408700.3.1.04.19970327150033\" alt=\"WADO reference to image\"/>\n\n    </div>"
  ]; #  
    This example demonstrates how to represent an image
    originally sourced by a DICOM acquisition device
    as a DocumentReference resource. Whether this is appropriate depends
    on the complexity of the image - the DocumentReference resource only
    contains crude metadata, and plain png/jpg (typically)
    pixels. This is suitable for the bulk of simple images
    shared as summaries with consumers, but not at all suitable
    for other kinds of images, or for internal radiology
    reporting usage
   
  fhir:DomainResource.extension [
     fhir:index 0;
     fhir:Extension.url [ fhir:value "http://nema.org/fhir/extensions#0002-0010" ];
     fhir:Extension.valueUri [ fhir:value "urn:oid:1.2.840.10008.1.2.1" ]
  ]; #  
    this is added to demonstrate the use of DICOM extensions.
    0002,0010 is the DICOM transfer syntax of the referenced image
    
  fhir:DocumentReference.identifier [
     fhir:index 0;
     fhir:Identifier.type [
       fhir:CodeableConcept.text [ fhir:value "accessionNo" ]
     ];
     fhir:Identifier.system [ fhir:value "http://acme-imaging.com/accession/2012" ]; #   the imaging department accession number. (they recycle numbers each year)  
     fhir:Identifier.value [ fhir:value "1234567" ]
  ], [
     fhir:index 1;
     fhir:Identifier.type [
       fhir:CodeableConcept.text [ fhir:value "studyId" ]
     ];
     fhir:Identifier.system [ fhir:value "urn:dicom:uid" ];
     fhir:Identifier.value [ fhir:value "urn:oid:1.2.840.113619.2.21.848.34082.0.538976288.3" ]
  ], [
     fhir:index 2;
     fhir:Identifier.type [
       fhir:CodeableConcept.text [ fhir:value "seriesId" ]
     ];
     fhir:Identifier.system [ fhir:value "urn:dicom:uid" ];
     fhir:Identifier.value [ fhir:value "urn:oid:1.2.840.113619.2.21.3408.700.0.757923840.3.0" ]
  ], [
     fhir:index 3;
     fhir:Identifier.use [ fhir:value "official" ];
     fhir:Identifier.type [
       fhir:CodeableConcept.text [ fhir:value "InstanceUID" ]
     ];
     fhir:Identifier.system [ fhir:value "urn:dicom:uid" ];
     fhir:Identifier.value [ fhir:value "urn:oid:1.2.840.11361907579238403408700.3.1.04.19970327150033" ]
  ]; # 
  fhir:DocumentReference.status [ fhir:value "current"]; # 
  fhir:DocumentReference.subject [
     fhir:Reference.reference [ fhir:value "Patient/example" ]
  ]; # 
  fhir:DocumentReference.event [
     fhir:index 0;
     fhir:CodeableReference.concept [
       fhir:CodeableConcept.coding [
         fhir:index 0;
         fhir:Coding.system [ fhir:value "http://dicom.nema.org/resources/ontology/DCM" ];
         fhir:Coding.code [ fhir:value "US" ]
       ] #   modality  
     ]
  ], [
     fhir:index 1;
     fhir:CodeableReference.concept [
       fhir:CodeableConcept.coding [
         fhir:index 0;
         a sct:399067008;
         fhir:Coding.system [ fhir:value "http://snomed.info/sct" ];
         fhir:Coding.code [ fhir:value "399067008" ];
         fhir:Coding.display [ fhir:value "Lateral projection" ]
       ] #   view  
     ]
  ]; # 
  fhir:DocumentReference.author [
     fhir:index 0;
     fhir:Reference.display [ fhir:value "G.E. Medical Systems" ]
  ]; # 
  fhir:DocumentReference.content [
     fhir:index 0;
     fhir:DocumentReference.content.attachment [
       fhir:Attachment.contentType [ fhir:value "application/dicom" ];
       fhir:Attachment.url [ fhir:value "http://imaging.acme.com/wado/server?requestType=WADO&contentType=application%2Fdicom&studyUid=1.2.840.113619.2.21.848.34082.0.538976288.3&seriesUid=1.2.840.113619.2.21.3408.700.0.757923840.3.0&objectUid=1.2.840.11361907579238403408700.3.1.04.19970327150033" ]; #   The actual image could be anywhere. This is a WADO example  
       fhir:Attachment.height [ fhir:value "480"^^xsd:positiveInteger ];
       fhir:Attachment.width [ fhir:value "640"^^xsd:positiveInteger ]
     ]
  ]] . #   and a reference to the image data  

# - ontology header ------------------------------------------------------------

[a owl:Ontology;
  owl:imports fhir:fhir.ttl] .

# -------------------------------------------------------------------------------------

