HDR OID Service
HL7 defines OID as a globally unique string representing an ISO Object Identifier (OID), in a form that consists only of numbers and dots (Example: 2.16.840.1.113883.3.1). According to ISO, OIDs are paths in a tree structure, with the left-most number representing the root and the right-most number representing a leaf. OIDs are created in HDR through the DataTypeFactory.newOID method.
HDR Object Identifiers
All HDR objects are uniquely identifiable, based on internal identifiers that are system generated at the time of creation. Each such identifier takes the form of an Instance Identifier DataType, which consists of a root and an extension that together uniquely identify an HDR object.The root uniquely identifies the implementing organization represented by this instance of HDR. The extension uniquely identifies this specific instance of the HDR object (e.g. an act, role or entity). Note, user defined or externally supplied instance identifiers may also be persisted for an object. These are in addition to the system-generated identifier. The root of these IIs is modeled as InternalOID RootId. InternalOID has two mandatory attributes, namely RootName and RootId. RootName can be one of the string constants defined in OIDService. RootId is of type OID. ConfigurationFactory methods can be used to create a blank instance of InternalOID.
A set of InternalOIDs must be configured during implementation to enable HDR to generate identifiers. The OIDService interface is used to configure the InternalOID values. HDR will suffix the root with the appropriate extension, to provide the unique identifier for the object.
See also:
- The,
HL7 web site
current version-3 ballot documentation for details about OID and II data types, andhttp://www.hl7.org/oid/
for more information about OIDs. ISO/IEC 8824
standard standard for the ISO standard for further details on OIDs.- Oracle Healthcare Data Repository Implementation Guide for information about HDR Internal OIDs.
Examples: This section contains the following code samples:
- Set up OID Service and Required Factories (see Example 6-1)
- Create an Internal OID (see Example 6-2)
- Query an Internal OID (see Example 6-3)
- Query All Internal OIDs (see Example 6-4)
- Update an Internal OID (see Example 6-5)
Example 6-1 Set up OID Service and Required Factories
The following code sample shows how to set up the service and factories required:
// Get the OID service OIDService oidService = mServiceLocator.getOIDService(); // Create the configuration factory instance ConfigurationFactory configFactory = ConfigurationFactory.getInstance(); // Create the datatype factory instance DataTypeFactory.getInstance();
Example 6-2 Create an Internal OID
The following code sample shows how to configure an Internal OID with a new root id. Use the appropriate factory methods to create the instance of OID and InternalOID:
// Create an OID datatype instance using the datatype factory OID rootOID = dataTypeFactory.newOID("9.989898.5"); // Create the Internal OID object using the configuration factory InternalOID internalRootOID = configFactory.newInternalRootOID(); // set the root for the Internal OID internalRootOID.setRootId(rootOID); // create the Internal OID using the service oidService.registerOID(internalRootOID);
Example 6-3 Query an Internal OID
The following code sample shows how to query an Internal OID. Pass the appropriate Root Name constant as the parameter to this service method. All Root Name constants are defined in OIDService:
// Find the InternalOID using the get method InternalOID internalOID = oidService.getOID(OIDService.INTERNAL_ROOT);
Example 6-4 Query All Internal OIDs
The following code sample shows how to query all Internal OIDs. This method returns all InternalOIDs configured in the system:
// Find all the InternalOIDs using the get all methodInternalOID[] new line/Enter internalOIDs = oidService.getAllOIDs();
Example 6-5 Update an Internal OID
The following code sample shows how to configure an Internal OID by updating its root value. This same method is used for update and to create operations. Update is not allowed if some RIM objects are already using the root:
// Create an OID datatype instance using the datatype factory OID rootOID = dataTypeFactory.newOID("9.989898.9"); // Create the Internal OID object using the configuration factory InternalOID internalRootOID = configFactory.newInternalRootOID(); // set the root for the Internal OID internalRootOID.setRootId(rootOID); // update the Internal OID using the service oidService.registerOID(internalRootOID);