Storage commitment
Storage commitment is an advanced service complementing the Storage service. It allows a DICOM application to request a commitment to another application for safekeeping of certain DICOM objects. Without storage commitment, a Storage SCU can know an objet has been successfully transmited, but not that the recipient will safekeep the object so that it can be retrieved later.
Asking a commitment from DeCaMino is as simple as replacing, in the Storage SCU example, the line:
scu.store(dmd, writer);by
scu.storeAndRequestCommitment(dmd, writer);An exception is thrown if the SCP does not support storage commitment or refuse to commit the transferred object.
Implementing a storage commitment SCP is slightly more complex. Like the storage SCP, it can listen synchronously or asynchronously. Here is an example that synchronously listens to a single request:
AERegistry aer = AERegistry.getGlobalRegistry(); aer.register("PEER SCU", InetAddress.getByName("192.168.0.2")); StorageCommitmentSCP scp = new StorageCommitmentSCP(); scp.start(); StorageCommitmentSCP.Request req = scp.receiveRequest(); for (int i=0; i<req.getNumberOfSOPInstances(); i++) { if (/* we accept to safekeep object req.getSOPInstance(i) */) req.commit(i); else req.cannotCommit(i); req.sendResult(); }
The first two lines tell that the application called PEER SCU can be reached at IP address 192.168.0.2 and default port. It's necessary because the commitment request and the answer can be sent using different TCP connections (different DICOM associations), so the SCP must know how to reach the requesting SCU.