Beispiel #1
0
		public void OnReceiveRequestMessage(DicomServer server, ServerAssociationParameters association, byte presentationID, ClearCanvas.Dicom.DicomMessage message)
		{
			foreach (byte pcid in association.GetPresentationContextIDs())
			{
				DicomPresContext context = association.GetPresentationContext(pcid);
				if (context.Result == DicomPresContextResult.Accept)
				{
					if (context.AbstractSyntax == SopClass.StudyRootQueryRetrieveInformationModelFind)
					{
						DicomMessage response = new DicomMessage();
						response.DataSet[DicomTags.StudyInstanceUid].SetStringValue("1.2.3");
						response.DataSet[DicomTags.PatientId].SetStringValue("1");
						response.DataSet[DicomTags.PatientsName].SetStringValue("test");
						response.DataSet[DicomTags.StudyId].SetStringValue("1");
						response.DataSet[DicomTags.StudyDescription].SetStringValue("dummy");
						server.SendCFindResponse(presentationID, message.MessageId, response, DicomStatuses.Pending);

						DicomMessage finalResponse = new DicomMessage();
						server.SendCFindResponse(presentationID, message.MessageId, finalResponse, DicomStatuses.Success);
					}
					else if (context.AbstractSyntax == SopClass.VerificationSopClass)
					{
						server.SendCEchoResponse(presentationID, message.MessageId, DicomStatuses.Success);
					}
				}
			}
		}