コード例 #1
0
ファイル: AuditTest.cs プロジェクト: scottshea/monodicom
        public void QueryAuditTest()
        {
            AssociationParameters parms = new ClientAssociationParameters("CLIENT", "SERVER",
                                                                          new IPEndPoint(new IPAddress(new byte[] { 2, 2, 2, 2 }),
                                                                                         2));

            parms.LocalEndPoint = new IPEndPoint(new IPAddress(new byte[] { 1, 1, 1, 1 }),
                                                 1);

            QueryAuditHelper helper =
                new QueryAuditHelper(new DicomAuditSource("testApplication"), EventIdentificationTypeEventOutcomeIndicator.Success, parms);

            helper.AddOtherParticipant(new AuditPersonActiveParticipant("testUser", "test@test", "Test Name"));
            helper.AddPatientParticipantObject(new AuditPatientParticipantObject("id1234", "Test Patient"));

            AuditStudyParticipantObject study = new AuditStudyParticipantObject("1.2.3.4.5", "A1234", "1.2.3");

            study.AddSopClass("1.2.3", 5);
            helper.AddStudyParticipantObject(study);

            string output = helper.Serialize(true);

            Assert.IsNotEmpty(output);

            string failure;
            bool   result = helper.Verify(out failure);

            Assert.IsTrue(result, failure);

            helper = new QueryAuditHelper(new DicomAuditSource("testApplication2", "enterpriseId", AuditSourceTypeCodeEnum.EndUserInterface), EventIdentificationTypeEventOutcomeIndicator.Success, parms);
            helper.AddStudyParticipantObject(new AuditStudyParticipantObject("1.2.3.4.5"));

            output = helper.Serialize(true);

            Assert.IsNotEmpty(output);

            result = helper.Verify(out failure);

            Assert.IsTrue(result, failure);
        }
コード例 #2
0
ファイル: AuditTest.cs プロジェクト: scottshea/monodicom
        public void QueryAuditTest()
        {
        	AssociationParameters parms = new ClientAssociationParameters("CLIENT", "SERVER",
        	                                                         new IPEndPoint(new IPAddress(new byte[] {2, 2, 2, 2}),
        	                                                                       2));
			parms.LocalEndPoint = new IPEndPoint(new IPAddress(new byte[] {1, 1, 1, 1}),
        	                                                                       1);

        	QueryAuditHelper helper =
        		new QueryAuditHelper(new DicomAuditSource("testApplication"), EventIdentificationTypeEventOutcomeIndicator.Success, parms);

			helper.AddOtherParticipant(new AuditPersonActiveParticipant("testUser","test@test","Test Name"));
        	helper.AddPatientParticipantObject(new AuditPatientParticipantObject("id1234", "Test Patient"));

			AuditStudyParticipantObject study = new AuditStudyParticipantObject("1.2.3.4.5", "A1234", "1.2.3");
        	study.AddSopClass("1.2.3", 5);
			helper.AddStudyParticipantObject(study);

        	string output = helper.Serialize(true);

        	Assert.IsNotEmpty(output);

        	string failure;
        	bool result = helper.Verify(out failure);

        	Assert.IsTrue(result, failure);

			helper = new QueryAuditHelper(new DicomAuditSource("testApplication2","enterpriseId", AuditSourceTypeCodeEnum.EndUserInterface),EventIdentificationTypeEventOutcomeIndicator.Success, parms);
			helper.AddStudyParticipantObject(new AuditStudyParticipantObject("1.2.3.4.5"));

			output = helper.Serialize(true);

			Assert.IsNotEmpty(output);

			result = helper.Verify(out failure);

			Assert.IsTrue(result, failure);              
        }
コード例 #3
0
ファイル: AuditTest.cs プロジェクト: hksonngan/Xian
        public void QueryAuditTest()
        {
            DicomAttributeCollection query = new DicomAttributeCollection();

            query[DicomTags.QueryRetrieveLevel].SetStringValue("STUDY");
            query[DicomTags.StudyInstanceUid].SetNullValue();
            query[DicomTags.PatientId].SetNullValue();
            query[DicomTags.AccessionNumber].SetNullValue();
            query[DicomTags.PatientsName].SetStringValue("*W*");
            query[DicomTags.ReferringPhysiciansName].SetNullValue();
            query[DicomTags.StudyDate].SetNullValue();
            query[DicomTags.StudyTime].SetNullValue();
            query[DicomTags.StudyDescription].SetNullValue();
            query[DicomTags.PatientsBirthDate].SetNullValue();
            query[DicomTags.ModalitiesInStudy].SetNullValue();
            query[DicomTags.NumberOfStudyRelatedInstances].SetNullValue();
            query[DicomTags.InstanceAvailability].SetNullValue();

            AssociationParameters parms = new ClientAssociationParameters("CLIENT", "SERVER",
                                                                          new IPEndPoint(new IPAddress(new byte[] { 2, 2, 2, 2 }),
                                                                                         2));

            parms.LocalEndPoint = new IPEndPoint(new IPAddress(new byte[] { 1, 1, 1, 1 }),
                                                 1);

            QueryAuditHelper helper =
                new QueryAuditHelper(new DicomAuditSource("testApplication"),
                                     EventIdentificationContentsEventOutcomeIndicator.Success, parms,
                                     SopClass.StudyRootQueryRetrieveInformationModelFindUid, query);

            helper.AddOtherParticipant(new AuditPersonActiveParticipant("testUser", "test@test", "Test Name"));
            helper.AddPatientParticipantObject(new AuditPatientParticipantObject("id1234", "Test Patient"));

            AuditStudyParticipantObject study = new AuditStudyParticipantObject("1.2.3.4.5", "A1234", "1.2.3");

            study.AddSopClass("1.2.3", 5);
            helper.AddStudyParticipantObject(study);

            string output = helper.Serialize(true);

            Assert.IsNotEmpty(output);

            Exception exception;

            //Assert.Ignore("Skipping schema validation due to schema bug #9455");
            //if (!helper.Verify(out exception))
            //    throw exception;

            helper =
                new QueryAuditHelper(
                    new DicomAuditSource("testApplication2", "enterpriseId", AuditSourceTypeCodeEnum.EndUserInterface),
                    EventIdentificationContentsEventOutcomeIndicator.Success, parms,
                    SopClass.StudyRootQueryRetrieveInformationModelFindUid, query);
            helper.AddStudyParticipantObject(new AuditStudyParticipantObject("1.2.3.4.5"));

            output = helper.Serialize(true);

            Assert.IsNotEmpty(output);

            Assert.Ignore("Skipping schema validation due to schema bug #9455");
            if (!helper.Verify(out exception))
            {
                throw exception;
            }
        }
コード例 #4
0
ファイル: AuditTest.cs プロジェクト: nhannd/Xian
        public void QueryAuditTest()
        {
			DicomAttributeCollection query = new DicomAttributeCollection();
    		query[DicomTags.QueryRetrieveLevel].SetStringValue("STUDY");
			query[DicomTags.StudyInstanceUid].SetNullValue();
			query[DicomTags.PatientId].SetNullValue();
			query[DicomTags.AccessionNumber].SetNullValue();
			query[DicomTags.PatientsName].SetStringValue("*W*");
			query[DicomTags.ReferringPhysiciansName].SetNullValue();
			query[DicomTags.StudyDate].SetNullValue();
			query[DicomTags.StudyTime].SetNullValue();
			query[DicomTags.StudyDescription].SetNullValue();
			query[DicomTags.PatientsBirthDate].SetNullValue();
			query[DicomTags.ModalitiesInStudy].SetNullValue();
			query[DicomTags.NumberOfStudyRelatedInstances].SetNullValue();
    		query[DicomTags.InstanceAvailability].SetNullValue();

        	AssociationParameters parms = new ClientAssociationParameters("CLIENT", "SERVER",
        	                                                         new IPEndPoint(new IPAddress(new byte[] {2, 2, 2, 2}),
        	                                                                       2));
			parms.LocalEndPoint = new IPEndPoint(new IPAddress(new byte[] {1, 1, 1, 1}),
        	                                                                       1);

    		QueryAuditHelper helper =
    			new QueryAuditHelper(new DicomAuditSource("testApplication"),
    			                     EventIdentificationContentsEventOutcomeIndicator.Success, parms,
    			                     SopClass.StudyRootQueryRetrieveInformationModelFindUid, query);

			helper.AddOtherParticipant(new AuditPersonActiveParticipant("testUser","test@test","Test Name"));
        	helper.AddPatientParticipantObject(new AuditPatientParticipantObject("id1234", "Test Patient"));

			AuditStudyParticipantObject study = new AuditStudyParticipantObject("1.2.3.4.5", "A1234", "1.2.3");
        	study.AddSopClass("1.2.3", 5);
			helper.AddStudyParticipantObject(study);

        	string output = helper.Serialize(true);

			Assert.IsNotEmpty(output);

			Exception exception;
			//Assert.Ignore("Skipping schema validation due to schema bug #9455");
			//if (!helper.Verify(out exception))
			//    throw exception;

    		helper =
    			new QueryAuditHelper(
    				new DicomAuditSource("testApplication2", "enterpriseId", AuditSourceTypeCodeEnum.EndUserInterface),
    				EventIdentificationContentsEventOutcomeIndicator.Success, parms,
    				SopClass.StudyRootQueryRetrieveInformationModelFindUid, query);
			helper.AddStudyParticipantObject(new AuditStudyParticipantObject("1.2.3.4.5"));

			output = helper.Serialize(true);

			Assert.IsNotEmpty(output);

			Assert.Ignore("Skipping schema validation due to schema bug #9455");
			if (!helper.Verify(out exception))
				throw exception;           
        }
コード例 #5
0
ファイル: SearchPanel.ascx.cs プロジェクト: hksonngan/Xian
        protected void SearchButton_Click(object sender, ImageClickEventArgs e)
        {
            if (DisplaySearchWarning)
            {
                StudyListGridView.DataBindOnPreRender     = false;
                ConfirmStudySearchMessageBox.Message      = SR.NoFiltersSearchWarning;
                ConfirmStudySearchMessageBox.MessageStyle = "font-weight: bold; color: #205F87;";
                ConfirmStudySearchMessageBox.Show();
            }
            else
            {
                StudyListGridView.Refresh();
            }
            var sb = new StringBuilder();

            if (!String.IsNullOrEmpty(PatientId.Text))
            {
                sb.AppendFormat("PatientId={0};", PatientId.Text);
            }
            if (!String.IsNullOrEmpty(PatientName.Text))
            {
                sb.AppendFormat("PatientsName={0};", PatientName.Text);
            }
            if (!String.IsNullOrEmpty(AccessionNumber.Text))
            {
                sb.AppendFormat("AccessionNumber={0};", AccessionNumber.Text);
            }
            if (!String.IsNullOrEmpty(ToStudyDate.Text) || !String.IsNullOrEmpty(FromStudyDate.Text))
            {
                sb.AppendFormat("StudyDate={0}-{1};", FromStudyDate.Text, ToStudyDate.Text);
            }
            if (!String.IsNullOrEmpty(StudyDescription.Text))
            {
                sb.AppendFormat("StudyDescription={0};", StudyDescription.Text);
            }
            if (ModalityListBox.SelectedIndex < 0)
            {
                bool first = true;
                foreach (ListItem item in ModalityListBox.Items)
                {
                    if (!item.Selected)
                    {
                        continue;
                    }

                    if (first)
                    {
                        sb.AppendFormat("ModalitiesInStudy={0}", item.Value);
                        first = false;
                    }
                    else
                    {
                        sb.AppendFormat(",{0}", item.Value);
                    }
                }
                if (!first)
                {
                    sb.Append(';');
                }
            }

            var helper = new QueryAuditHelper(ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success,
                                              new AuditPersonActiveParticipant(SessionManager.Current.Credentials.UserName,
                                                                               null,
                                                                               SessionManager.Current.Credentials.DisplayName),
                                              ServerPartition.AeTitle, ServerPlatform.HostId, sb.ToString());

            ServerPlatform.LogAuditMessage(helper);
        }