Skip Headers
Oracle® Multimedia DICOM Developer's Guide
11g Release 1 (11.1)

B28416-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

9 ORD_DICOM_ADMIN Package Reference

Oracle Multimedia DICOM describes the ORD_DICOM_ADMIN package. This package lists the data model repository interface, which is intended for use by DICOM administrators to maintain the Oracle Multimedia DICOM repository. The data model repository is a collection of documents. One set of documents is loaded during installation. After installation, DICOM administrators can add more documents to the data model repository using the procedures and functions in the ORD_DICOM_ADMIN package. Oracle Multimedia DICOM also defines information views for the DICOM repository to be used by DICOM administrators.

Note:

Administrators of the DICOM data model repository must be assigned the ORDADMIN role. See Section 8.1 for more information about administrator privileges.

The ORD_DICOM_ADMIN package is defined in the ordcrpsp.sql file. After installation, this file is available in the Oracle home directory at:

<ORACLE_HOME>/ord/im/admin (on Linux and UNIX)

<ORACLE_HOME>\ord\im\admin (on Windows)

Oracle Multimedia contains the following information:

This chapter describes the functions, procedures, and information views in the ORD_DICOM_ADMIN data model repository interface. For information about other DICOM APIs, see the following chapters:

See Oracle Multimedia DICOM Java API Reference for information about the DICOM Java API.


ORD_DICOM_ADMIN Data Model Repository Functions and Procedures

The ORD_DICOM_ADMIN package defines the following ORD_DICOM_ADMIN data model repository functions and procedures:


getDocumentContent( ) Function

Format

getDocumentContent(docName IN VARCHAR2) RETURN XMLTYPE

Description

Returns the document as data type XMLType. This function can be used to make copies of documents in the data model repository without changing the contents of the original documents.

Parameters

docName

The name of the document whose contents are to be retrieved. The document content is returned as data type XMLType. The orddcm_documents view includes the column DOC_NAME, where docName is one of the documents listed.

Pragmas

None.

Exceptions

None.

Usage Notes

Before calling this function, call either the setDataModel( ) procedure or the editDataModel( ) procedure.

Note:

Call the setDataModel( ) procedure when you are not making changes to the data model, such as when calling the getDocumentContent( ) procedure or the exportDocument( ) procedure only.

Call the editDataModel( ) procedure when you are making changes to the data model, such as when inserting or deleting documents.

Examples

Get the contents of a specified document (ordcmpf.xml) in the repository:

CONNECT pm

Enter password: password
-- user pm must be assigned the ORDADMIN role for the following example to work

exec ord_dicom.setDataModel;
 set long 5000;
 -- to see the contents on screen
 select ord_dicom_admin.getDocumentContent('ordcmpf.xml') from dual;
 -- to store in a table
 create table repos_exp_docs( name varchar2(100),  doc xmltype);
 insert into repos_exp_docs (name, doc) select 'ordcmpf.xml', 
 ord_dicom_admin.getDocumentContent('ordcmpf.xml') from dual;

where:


deleteDocument( ) Procedure

Format

deleteDocument(docName IN VARCHAR2)

Description

Deletes the specified document from the data model repository. Documents installed by Oracle are treated as default documents that cannot be removed.

See Section 8.7 for detailed information about deleting configuration documents.

Parameters

docName

The name of the document to be removed from the repository, where docName is one of the documents listed in the orddcm_documents view.

Pragmas

None.

Exceptions

None.

Usage Notes

Before calling this procedure, call the editDataModel( ) procedure.

In addition, Oracle recommends calling the exportDocument( ) procedure to make a copy of the specified document before deleting it from the repository.

Examples

Copy and then delete a document (sample_pref.xml) from the repository:

CONNECT pm

Enter password: password
-- user pm must be assigned the ORDADMIN role for the following example to work

exec ord_dicom_admin.editDataModel();
 -- list most recent docs first
 select doc_name from orddcm_documents order by create_date desc;
 -- export doc
 exec ord_dicom_admin.exportDocument('sample_pref.xml', 'EXPORT_DIR', 
  'sample_pref_exp.xml');
 -- delete doc
 exec ord_dicom_admin.deleteDocument('sample_pref.xml');
 -- list remaining docs
 select doc_name from orddcm_documents order by create_date desc;
 -- publish changes and release locks
 exec ord_dicom_admin.publishDataModel();

where:


editDataModel( ) Procedure

Format

editDataModel( )

Description

Begins an administrator editing session for making changes to the data model repository. The administrator session maintains a lock on the repository until the publishDataModel( ) or rollbackDataModel( ) procedure is called, or until the session exits. Call this procedure before making changes to the repository.

Parameters

None.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Begin an editing session in the repository, while locking it from other administrators:

   exec ord_dicom_admin.editDataModel();

exportDocument( ) Procedure

Format

exportDocument(docName IN VARCHAR2, dirName IN VARCHAR2, fileName IN VARCHAR2)

Description

Exports the contents of the document specified by the docName parameter to the specified file. This procedure writes the data to a file in a directory for which the administrator has been granted the write privilege.

Parameters

docName

The name of the specified document in the repository, where docName is one of the documents listed in the orddcm_documents view.

dirName

The directory location of the specified file. This string is an Oracle directory object name, and it is case-sensitive. The default is uppercase. The write privilege must be granted to the administrator for this directory object.

fileName

The name of the file, including the file extension (file type), but excluding the directory path.

Pragmas

None.

Exceptions

None.

Usage Notes

Before calling this procedure, call either the setDataModel( ) or the editDataModel( ) procedure.

Note:

Call the setDataModel( ) procedure when you are not making changes to the data model, such as when calling the getDocumentContent( ) procedure or the exportDocument( ) procedure only.

Call the editDataModel( ) procedure when you are making changes to the data model, such as when inserting or deleting documents.

Examples

Export the contents of an existing file in the repository (sample_map.xml) into an external file (sample_map_export.xml):

 exec ord_dicom.setDataModel();
 exec ord_dicom_admin.exportDocument('ordcmpf.xml', 'EXPORT_DIR', 
      'ordcmpf_exp.xml');

where:


insertDocument( ) Procedure

Format

insertDocument(docName IN VARCHAR2, docType IN VARCHAR2, xmlDoc IN XMLType)

Description

Loads the specified XML configuration document into the data model repository. The document name must be unique. Supported document types are listed in the public information view orddcm_document_types (see Chapter 4). The document is validated against the registered schema that is associated with the document type.

Documents must be loaded into the repository in the following order:

  1. Standard data dictionary documents

  2. Private data dictionary documents

  3. Other configuration documents, including the following:

    • Constraint documents

    • XML mapping documents

    • Anonymity documents

    • Preference documents

    • UID definition documents

    Other configuration documents can be loaded in any order, except when there are dependencies between constraint documents.

There are semantic dependencies between the documents. For example, elements referenced in an XML mapping document must exist in the standard or private data dictionary documents. The information view orddcm_documents (see Chapter 4) contains the details of the documents in the repository.

Parameters

docName

The unique name of the specified document. The name cannot exceed 100 characters in length, and it must not contain the reserved prefix ORD.

docType

The type of the document to be loaded into the repository. Supported values are listed in the public information view orddcm_document_types (see Chapter 4). The value of this parameter must not be NULL.

xmlDoc

The XML document to be loaded into the repository. The value of this parameter must not be NULL

Pragmas

None.

Exceptions

None.

Usage Notes

Before calling this procedure, call the editDataModel( ) procedure.

Before inserting a user-defined mapping document into the repository, its associated metadata schema must have been registered as a global schema with Oracle XML DB. See Oracle XML DB Developer's Guide for information about registering XML schemas. (The metadata schema associated with the default mapping document is registered with Oracle XML DB upon installation of Oracle Multimedia DICOM. See Appendix B and Example 10-1 for more information.)

Examples

Insert a mapping document (sample_map.xml) into the repository:

   exec ord_dicom_admin.editDataModel();
   exec ord_dicom_admin.insertDocument('sample_map.xml', 'MAPPING', 
     xmltype(bfilename('DICOMDIR', 'sample_map.xml'), 
     nls_charset_id('AL32UTF8')));
   select * from orddcm_documents;
   exec ord_dicom_admin.publishDataModel();

where:


publishDataModel( ) Procedure

Format

publishDataModel( )

Description

Publishes changes to the data model repository. This procedure also unlocks the repository, making it available for updating by other administrators. By calling the setDataModel( ) procedure to refresh the data model repository, users can access the latest published changes to the repository.

Parameters

None.

Pragmas

None.

Exceptions

None.

Usage Notes

Before calling this procedure, call the editDataModel( ) procedure.

Depending on when the administrator publishes changes to the data model repository, users who are currently connected to the repository may need to call the setDataModel( ) procedure more than once to see the latest changes. Also, based on when they call the setDataModel( ) procedure, it is possible for two users connected to the same data model repository to access different versions of the repository. See Figure 2-5 for more information about this possible scenario.

Examples

Publish the changes to the repository:

   exec ord_dicom_admin.editDataModel();
   exec ord_dicom_admin.deleteDocument('sample_pref.xml');
   select doc_name from orddcm_documents;
   exec ord_dicom_admin.publishDataModel();

rollbackDataModel( ) Procedure

Format

rollbackDataModel( )

Description

Terminates changes to the data model since the previous call to the editDataModel( ) procedure. Call this procedure to roll back the changes and unlock the data model, making it available for updating by other administrators.

Parameters

None.

Pragmas

None.

Exceptions

None.

Usage Notes

Before calling this procedure, call the editDataModel( ) procedure.

At end of the database session if you want to roll back the data model, call this procedure. Because the changes to the data model were terminated rather than published, the information views are populated with the data from the previously published data model.

Examples

Terminate the data model changes without publishing them to the repository:

   exec ord_dicom_admin.editDataModel();
   exec ord_dicom_admin.deleteDocument('sample_pref.xml');
   select doc_name from orddcm_documents;
   exec ord_dicom_admin.rollbackDataModel();
   select doc_name from orddcm_documents;

DICOM Repository Administrator Information Views

This section describes the Oracle Multimedia DICOM repository information view for administrators. The information view is called orddcm_document_refs.

See Chapter 4 for information about the Oracle Multimedia DICOM repository public information views.


orddcm_document_refs

Format

Column Name Data Type Description
doc_name VARCHAR2(100) Document name
ref_by_doc_name VARCHAR2(100) Referenced by document name

Description

This read-only information view lists the documents that are referenced by other documents. The select privilege is granted to the ORDADMIN role for this information view.

Usage Notes

Before querying this information view, call either the setDataModel( ) or the editDataModel( ) procedure. If you call the setDataModel( ) procedure, call it again whenever the application needs to see new data model changes.

Note:

Call the setDataModel( ) procedure when you are not making changes to the data model, such as when calling the getDocumentContent( ) procedure or the exportDocument( ) procedure only.

Call the editDataModel( ) procedure when you are making changes to the data model, such as when inserting or deleting documents.

Examples

Show the references between a set of Oracle-installed configuration documents:

SQL> select doc_name, ref_by_doc_name from ordsys.orddcm_doc_refs;
 
-------------------------------------------------------------------------------
DOC_NAME             REF_BY_DOC_NAME
-------------------------------------------------------------------------------
ordcmpv.xml          ordcmcmc.xml
ordcmpv.xml          ordcmcmd.xml
ordcmsd.xml          ordcman.xml
ordcmsd.xml          ordcmcmc.xml
ordcmsd.xml          ordcmcmd.xml