/* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. */

set echo on

drop table medical_image_table;

create table medical_image_table 
     (id          integer primary key, 
      dicom       ordsys.orddicom,
      imageThumb  ordsys.ordimage, 
      anonDicom   ordsys.orddicom)
      --
      -- metadata extraction expands the ORDDicom object
      pctfree 60
      --
      -- lob storage
      lob(dicom.source.localdata) store as SecureFile
         (nocache filesystem_like_logging),
      lob(imageThumb.source.localdata) store as SecureFile
         (nocache filesystem_like_logging),
      lob(anonDicom.source.localdata) store as SecureFile
         (nocache filesystem_like_logging),
      -- disable in row storage for the extension
      -- so that it does not consume page space
      -- it is usually < 4k in size
      lob(dicom.extension) store as SecureFile
         ( nocache disable storage in row ),
      lob(anonDicom.extension) store as SecureFile
         ( nocache disable storage in row ),
      -- store the metadata as a CLOB,
      -- disable storage in row
      xmltype dicom.metadata store as SecureFile clob
         ( nocache disable storage in row )
      xmltype anonDicom.metadata store as SecureFile clob
         ( nocache disable storage in row )
;


