44
44
import java .io .OutputStream ;
45
45
import java .io .Reader ;
46
46
import java .util .Calendar ;
47
+ import java .util .HashSet ;
48
+ import java .util .List ;
47
49
import java .util .regex .Pattern ;
48
50
49
51
import javax .xml .bind .JAXBContext ;
52
54
import javax .xml .bind .Marshaller ;
53
55
import javax .xml .bind .Unmarshaller ;
54
56
55
- import org .dcm4che3 .audit .Accession ;
56
- import org .dcm4che3 .audit .ActiveParticipant ;
57
- import org .dcm4che3 .audit .AuditMessage ;
58
- import org .dcm4che3 .audit .AuditSourceIdentification ;
59
- import org .dcm4che3 .audit .EventIdentification ;
60
- import org .dcm4che3 .audit .Instance ;
61
- import org .dcm4che3 .audit .MPPS ;
62
- import org .dcm4che3 .audit .ObjectFactory ;
63
- import org .dcm4che3 .audit .ParticipantObjectContainsStudy ;
64
- import org .dcm4che3 .audit .ParticipantObjectDescriptionType ;
65
- import org .dcm4che3 .audit .ParticipantObjectDetail ;
66
- import org .dcm4che3 .audit .ParticipantObjectIdentification ;
67
- import org .dcm4che3 .audit .SOPClass ;
68
-
69
57
/**
70
58
* @author Gunter Zeilinger <[email protected] >
71
59
* @author Michael Backhaus <[email protected] >
60
+ * @author Vrinda Nayak <[email protected] >
72
61
*/
73
62
public class AuditMessages {
74
63
@@ -319,7 +308,7 @@ public void setCodeSystemName(String value) {
319
308
}
320
309
321
310
public static final class AuditSourceTypeCode
322
- extends org .dcm4che3 .audit .AuditSourceTypeCode {
311
+ extends org .dcm4che3 .audit .AuditSourceIdentification {
323
312
324
313
public static final AuditSourceTypeCode EndUserDisplayDevice =
325
314
new AuditSourceTypeCode ("1" );
@@ -550,7 +539,7 @@ public static final class ParticipantObjectIDTypeCode
550
539
public static final ParticipantObjectIDTypeCode MedicalRecordNumber =
551
540
new ParticipantObjectIDTypeCode ("1" );
552
541
public static final ParticipantObjectIDTypeCode PatientNumber =
553
- new ParticipantObjectIDTypeCode ("2" );
542
+ new ParticipantObjectIDTypeCode ("2" , "RFC-3881" , "Patient Number" );
554
543
public static final ParticipantObjectIDTypeCode EncounterNumber =
555
544
new ParticipantObjectIDTypeCode ("3" );
556
545
public static final ParticipantObjectIDTypeCode EnrolleeNumber =
@@ -564,7 +553,7 @@ public static final class ParticipantObjectIDTypeCode
564
553
public static final ParticipantObjectIDTypeCode ReportName =
565
554
new ParticipantObjectIDTypeCode ("8" );
566
555
public static final ParticipantObjectIDTypeCode ReportNumber =
567
- new ParticipantObjectIDTypeCode ("9" );
556
+ new ParticipantObjectIDTypeCode ("9" , "RFC-3881" , "Report Number" );
568
557
public static final ParticipantObjectIDTypeCode SearchCriteria =
569
558
new ParticipantObjectIDTypeCode ("10" );
570
559
public static final ParticipantObjectIDTypeCode UserIdentifier =
@@ -577,10 +566,6 @@ public static final class ParticipantObjectIDTypeCode
577
566
new ParticipantObjectIDTypeCode ("110181" ,"DCM" ,"SOP Class UID" );
578
567
public static final ParticipantObjectIDTypeCode NodeID =
579
568
new ParticipantObjectIDTypeCode ("110182" ,"DCM" ,"Node ID" );
580
- public static final ParticipantObjectIDTypeCode ITI_PatientNumber =
581
- new ParticipantObjectIDTypeCode ("2" ,"RFC-3881" ,"Patient Number" );
582
- public static final ParticipantObjectIDTypeCode ITI_ReportNumber =
583
- new ParticipantObjectIDTypeCode ("9" ,"RFC-3881" ,"Report Number" );
584
569
public static final ParticipantObjectIDTypeCode ITI_PIXQuery =
585
570
new ParticipantObjectIDTypeCode ("ITI-9" ,"IHE Transactions" ,"PIX Query" );
586
571
@@ -660,16 +645,16 @@ public static AuditSourceIdentification createAuditSourceIdentification(
660
645
asi .setAuditEnterpriseSiteID (siteID );
661
646
asi .setAuditSourceID (sourceID );
662
647
for (AuditSourceTypeCode type : types )
663
- asi .getAuditSourceTypeCode ().add (type );
648
+ asi .getAuditSourceTypeCode ().add (type . toString () );
664
649
return asi ;
665
650
}
666
651
667
652
public static ParticipantObjectIdentification createParticipantObjectIdentification (
668
653
String id , ParticipantObjectIDTypeCode idType , String name ,
669
654
byte [] query , String type , String role , String lifeCycle ,
670
- String sensitivity , String description ,
671
- ParticipantObjectDescriptionType descriptionType ,
672
- ParticipantObjectDetail ... details ) {
655
+ String sensitivity , List < String > desc , HashSet < Accession > accessionList , HashSet < MPPS > mppsList ,
656
+ HashSet < SOPClass > sopClasses , Boolean encrypted , Boolean anonymized ,
657
+ ParticipantObjectContainsStudy pocs , ParticipantObjectDetail ... details ) {
673
658
ParticipantObjectIdentification poi = new ParticipantObjectIdentification ();
674
659
poi .setParticipantObjectID (id );
675
660
poi .setParticipantObjectIDTypeCode (idType );
@@ -679,20 +664,25 @@ public static ParticipantObjectIdentification createParticipantObjectIdentificat
679
664
poi .setParticipantObjectTypeCodeRole (role );
680
665
poi .setParticipantObjectDataLifeCycle (lifeCycle );
681
666
poi .setParticipantObjectSensitivity (sensitivity );
682
- poi .setParticipantObjectDescription (description );
683
- poi .setParticipantObjectDescriptionType (descriptionType );
667
+ if (null != desc )
668
+ for (String pod : desc )
669
+ poi .getParticipantObjectDescription ().add (pod );
670
+ if (null != accessionList )
671
+ for (Accession acc : accessionList )
672
+ poi .getAccession ().add (acc );
673
+ if (null != mppsList )
674
+ for (MPPS mpps : mppsList )
675
+ poi .getMPPS ().add (mpps );
676
+ if (null != sopClasses )
677
+ for (SOPClass sopC : sopClasses )
678
+ poi .getSOPClass ().add (sopC );
679
+ poi .setEncrypted (encrypted );
680
+ poi .setAnonymized (anonymized );
681
+ poi .setParticipantObjectContainsStudy (pocs );
684
682
for (ParticipantObjectDetail detail : details )
685
683
poi .getParticipantObjectDetail ().add (detail );
686
684
return poi ;
687
685
}
688
-
689
- public static ParticipantObjectDescriptionType createParticipantObjectDescription (
690
- Boolean encrypted , Boolean anonymized ) {
691
- ParticipantObjectDescriptionType podt = new ParticipantObjectDescriptionType ();
692
- podt .setEncrypted (encrypted );
693
- podt .setAnonymized (anonymized );
694
- return podt ;
695
- }
696
686
697
687
public static ParticipantObjectDetail createParticipantObjectDetail (
698
688
String type , byte [] value ) {
@@ -735,6 +725,12 @@ public static Accession createAccession(String accessionNumber) {
735
725
return accession ;
736
726
}
737
727
728
+ public static StudyIDs createStudyIDs (String studyID ) {
729
+ StudyIDs sID = new StudyIDs ();
730
+ sID .setUID (studyID );
731
+ return sID ;
732
+ }
733
+
738
734
public static String alternativeUserIDForAETitle (String ... aets ) {
739
735
if (aets .length == 0 )
740
736
return null ;
0 commit comments