@Override public void validate() { super.validate(); ParticipantObjectIdentificationType patient = getMessage().findParticipantObjectIdentifications(poi -> ParticipantObjectIdTypeCode.PatientNumber.equals(poi.getParticipantObjectIDTypeCode())).get(0); if (!PATIENT_ID_PATTERN.matcher(patient.getParticipantObjectID()).matches()) { throw new AuditException("Patient ID should be in CX format " + PATIENT_ID_PATTERN.pattern()); } } }
@Override public void validate() { super.validate(); int participants = getMessage().getActiveParticipants().size(); if (participants < 1 || participants > 2) { throw new AuditException("Must have one or two ActiveParticipants"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); int participants = getMessage().getActiveParticipants().size(); if (participants < 1 || participants > 2) { throw new AuditException("Must have one or two ActiveParticipants"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.StudyInstanceUID).isEmpty()) { throw new AuditException("Must have one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode StudyInstanceUID"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must have one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); int participants = getMessage().getActiveParticipants().size(); if (participants < 1 || participants > 2) { throw new AuditException("Must have one or two ActiveParticipants"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.StudyInstanceUID).isEmpty()) { throw new AuditException("Must have one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode StudyInstanceUID"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); int aps = getMessage().getActiveParticipants().size(); if (aps < 1 || aps > 2) { throw new AuditException("Must have one or two user ActiveParticipants"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); int participants = getMessage().getActiveParticipants().size(); if (participants < 1 || participants > 2) { throw new AuditException("Must have one or two ActiveParticipants"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Destination"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.StudyInstanceUID).isEmpty()) { throw new AuditException("Must have one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode StudyInstanceUID"); } } }
@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).isEmpty()) { throw new AuditException("Must have one or more ActiveParticipant with RoleIDCode Destination"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.SourceMedia)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode SourceMedia"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).isEmpty()) { throw new AuditException("Must one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Destination"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must have one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.StudyInstanceUID).isEmpty()) { throw new AuditException("Must have one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode StudyInstanceUID"); } } }
@Override public void validate() { super.validate(); int sources = getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size(); if (sources < 1 || sources > 2) { throw new AuditException("Must have one or two ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.DestinationMedia)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode DestinationMedia"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).isEmpty()) { throw new AuditException("Must one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
protected Element participantObjectIdentification(ParticipantObjectIdentificationType poi) { Element element = new Element("ParticipantObjectIdentification"); if (poi != null) { conditionallyAddAttribute(element, "ParticipantObjectID", poi.getParticipantObjectID()); if (poi.getParticipantObjectTypeCode() != null) { conditionallyAddAttribute(element, "ParticipantObjectTypeCode", poi.getParticipantObjectTypeCode().getValue().toString()); } conditionallyAddAttribute(element, "ParticipantObjectTypeCodeRole", poi.getParticipantObjectTypeCodeRole()); conditionallyAddAttribute(element, "ParticipantObjectDataLifeCycle", poi.getParticipantObjectDataLifeCycle()); conditionallyAddAttribute(element, "ParticipantObjectSensitivity", poi.getParticipantObjectSensitivity()); element.addContent(codedValueType("ParticipantObjectIDTypeCode", poi.getParticipantObjectIDTypeCode())); if (poi.getParticipantObjectName() != null) { element.addContent(new Element("ParticipantObjectName") .addContent(poi.getParticipantObjectName())); } if (poi.getParticipantObjectQuery() != null) { element.addContent(new Element("ParticipantObjectQuery") .addContent(new String( Base64.getEncoder().encode(poi.getParticipantObjectQuery()), StandardCharsets.UTF_8))); } poi.getParticipantObjectDetails().stream() .map(participantObjectDetail -> typeValuePairType("ParticipantObjectDetail", participantObjectDetail)) .forEach(element::addContent); poi.getParticipantObjectDescriptions().stream() .map(this::dicomObjectDescription) .forEach(element::addContent); } return element; }
private void testRequest(boolean serverSide, Iti59AuditStrategy strategy) { Iti59AuditDataset auditDataset = getHpdAuditDataset(strategy); AuditMessage[] auditMessages = makeAuditMessages(strategy, auditContext, auditDataset); assertEquals(3, auditMessages.length); for (AuditMessage auditMessage : auditMessages) { auditMessage.validate(); System.out.println(printAuditMessage(auditMessage)); assertEquals(1, auditMessage.getParticipantObjectIdentifications().size()); ParticipantObjectIdentificationType participant = auditMessage.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCodeRole.Provider, participant.getParticipantObjectTypeCodeRole()); assertEquals(HpdParticipantObjectIdTypeCode.RelativeDistinguishedName, participant.getParticipantObjectIDTypeCode()); } assertCommonHpdAuditAttributes(auditMessages[0], EventOutcomeIndicator.Success, serverSide ? EventIdCode.Import : EventIdCode.Export, EventActionCode.Update, serverSide); ParticipantObjectIdentificationType participant = auditMessages[2].getParticipantObjectIdentifications().get(0); assertEquals(1, participant.getParticipantObjectDetails().size()); assertEquals("old uid", participant.getParticipantObjectDetails().get(0).getType()); assertEquals("1.11.111.1111:klmno", new String(participant.getParticipantObjectDetails().get(0).getValue())); }
assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); assertEquals(ParticipantObjectIdTypeCode.PatientNumber, patient.getParticipantObjectIDTypeCode()); assertEquals("Patient/a2", patient.getParticipantObjectID()); ParticipantObjectIdType poitTypeCode = poit.getParticipantObjectIDTypeCode(); assertEquals("urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd", poitTypeCode.getCode()); assertEquals("IHE XDS Metadata", poitTypeCode.getCodeSystemName());
new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8)); assertEquals(FhirParticipantObjectIdTypeCode.MobilePatientIdentifierCrossReferenceQuery, patient.getParticipantObjectIDTypeCode());
assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); assertEquals(ParticipantObjectIdTypeCode.PatientNumber, patient.getParticipantObjectIDTypeCode()); assertEquals("Patient/a2", patient.getParticipantObjectID()); ParticipantObjectIdType poitTypeCode = poit.getParticipantObjectIDTypeCode(); assertEquals("urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd", poitTypeCode.getCode()); assertEquals("IHE XDS Metadata", poitTypeCode.getCodeSystemName());
new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8)); assertEquals(FhirParticipantObjectIdTypeCode.MobilePatientIdentifierCrossReferenceQuery, patient.getParticipantObjectIDTypeCode());
new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8)); assertEquals(FhirParticipantObjectIdTypeCode.MobilePatientDemographicsQuery, patient.getParticipantObjectIDTypeCode());
new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8)); assertEquals(FhirParticipantObjectIdTypeCode.MobilePatientDemographicsQuery, patient.getParticipantObjectIDTypeCode());
new String(query.getParticipantObjectQuery(), StandardCharsets.UTF_8)); assertEquals(FhirParticipantObjectIdTypeCode.MobileDocumentManifestQuery, query.getParticipantObjectIDTypeCode());
new String(query.getParticipantObjectQuery(), StandardCharsets.UTF_8)); assertEquals(FhirParticipantObjectIdTypeCode.MobileDocumentManifestQuery, query.getParticipantObjectIDTypeCode());