tests/tools/scu.cc
// Handles single C-STORE Request received during C-GET session
Handles single C-STORE Request received during C-GET session
Handles single C - STORE Request received during C - GET session
OFCondition DcmSCU::handleSTORERequest(const T_ASC_PresentationContextID ,
                                       DcmDataset *incomingObject,
                                       OFBool& ,
                                       Uint16& cStoreReturnStatus)
{
  if (incomingObject == NULL)
    return DIMSE_NULLKEY;
  OFString sopClassUID;
  OFString sopInstanceUID;
  OFCondition result = incomingObject->findAndGetOFString(DCM_SOPClassUID, sopClassUID);
  if (result.good())
    result = incomingObject->findAndGetOFString(DCM_SOPInstanceUID, sopInstanceUID);
  if (result.bad())
  {
    DCMNET_ERROR("Cannot store received object: either SOP Instance or SOP Class UID not present");
    cStoreReturnStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass;
    return EC_TagNotFound;
  }
  OFString filename = createStorageFilename(incomingObject);
  result = incomingObject->saveFile(filename.c_str());
  if (result.good())
  {
    E_TransferSyntax xferSyntax;
    getDatasetInfo(incomingObject, sopClassUID, sopInstanceUID, xferSyntax);
    notifyInstanceStored(filename, sopClassUID, sopInstanceUID);
    cStoreReturnStatus = STATUS_Success;
  }
  else
  {
    cStoreReturnStatus = STATUS_STORE_Refused_OutOfResources;
  }
  return result;
}
OFCondition DcmSCU :: handleSTORERequest ( const T_ASC_PresentationContextID , DcmDataset * incomingObject , OFBool & , Uint16 & cStoreReturnStatus ) { if ( incomingObject == NULL ) return DIMSE_NULLKEY ; OFString sopClassUID ; OFString sopInstanceUID ; OFCondition result = incomingObject -> findAndGetOFString ( DCM_SOPClassUID , sopClassUID ) ; if ( result . good ( ) ) result = incomingObject -> findAndGetOFString ( DCM_SOPInstanceUID , sopInstanceUID ) ; if ( result . bad ( ) ) { DCMNET_ERROR ( " " ) ; cStoreReturnStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass ; return EC_TagNotFound ; } OFString filename = createStorageFilename ( incomingObject ) ; result = incomingObject -> saveFile ( filename . c_str ( ) ) ; if ( result . good ( ) ) { E_TransferSyntax xferSyntax ; getDatasetInfo ( incomingObject , sopClassUID , sopInstanceUID , xferSyntax ) ; notifyInstanceStored ( filename , sopClassUID , sopInstanceUID ) ; cStoreReturnStatus = STATUS_Success ; } else { cStoreReturnStatus = STATUS_STORE_Refused_OutOfResources ; } return result ; }
Handles single C-STORE Request received during C-GET session
Handles single C - STORE Request received during C - GET session
/* presID */ /* continueCGETSession */