use of org.openehealth.ipf.commons.ihe.xds.core.requests.query.PatientIdBasedStoredQuery in project ipf by oehf.
the class Iti18AuditStrategyTest method testRequest.
private void testRequest(boolean serverSide, StoredQuery query) {
if (query instanceof PatientIdBasedStoredQuery) {
((PatientIdBasedStoredQuery) query).setPatientId(Hl7v2Based.parse(AuditorTestBase.PATIENT_IDS[0], Identifiable.class));
}
var strategy = new Iti18AuditStrategy(serverSide);
var auditDataset = getXdsAuditDataset(strategy);
EbXMLAdhocQueryRequest ebXmlQueryRequest = new QueryRegistryTransformer().toEbXML(new QueryRegistry(query));
strategy.enrichAuditDatasetFromRequest(auditDataset, ebXmlQueryRequest.getInternal(), null);
var auditMessages = makeAuditMessages(strategy, auditContext, auditDataset);
assertEquals(1, auditMessages.length);
for (var auditMessage : auditMessages) {
auditMessage.validate();
}
assertEquals(ebXmlQueryRequest.getId(), auditMessages[0].findParticipantObjectIdentifications(p -> p.getParticipantObjectTypeCode().equals(ParticipantObjectTypeCode.System)).get(0).getParticipantObjectID());
assertCommonXdsAuditAttributes(auditMessages[0], EventOutcomeIndicator.Success, EventIdCode.Query, EventActionCode.Execute, serverSide, true);
}
Aggregations