示例#1
0
        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
        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
        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;           
        }