protected override void DoCEcho(ActiveAssociation assoc, Dimse rq, Command rspCmd) { rspCmd.PutUS(Tags.Status,DcmServiceBase.SUCCESS); }
public virtual void WriteTo(Command cmd) { cmd.PutUS(Tags.Status, status); String msg = Message; if (msg != null && msg.Length > 0) { cmd.PutLO(Tags.ErrorComment, msg.Length > 64?msg.Substring(0, (64) - (0)):msg); } if (errorID >= 0) { cmd.PutUS(Tags.ErrorID, errorID); } if (actionTypeID >= 0) { cmd.PutUS(Tags.ActionTypeID, actionTypeID); } if (eventTypeID >= 0) { cmd.PutUS(Tags.EventTypeID, eventTypeID); } }
protected override void DoCStore(ActiveAssociation assoc, Dimse rq, Command rspCmd) { Command rqCmd = rq.Command; Stream ins = rq.DataAsStream; try { String instUID = rqCmd.AffectedSOPInstanceUID; String classUID = rqCmd.AffectedSOPClassUID; DcmDecodeParam decParam = DcmDecodeParam.ValueOf(rq.TransferSyntaxUID); Dataset ds = objFact.NewDataset(); DcmParser parser = parserFact.NewDcmParser(ins); parser.DcmHandler = ds.DcmHandler; parser.ParseDataset(decParam, Tags.PixelData); ds.SetFileMetaInfo( objFact.NewFileMetaInfo(classUID, instUID, rq.TransferSyntaxUID) ); FileInfo file = toFile(ds); storeToFile(parser, ds, file, (DcmEncodeParam) decParam); rspCmd.PutUS(Tags.Status, SUCCESS); } catch (System.Exception e) { log.Error(e.Message, e); throw new DcmServiceException(PROCESSING_FAILURE, e); } finally { ins.Close(); } }